diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/suggestions | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/ui/suggestions/abi-typo.fixed (renamed from src/test/ui/suggestions/abi-typo.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/abi-typo.rs (renamed from src/test/ui/suggestions/abi-typo.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/abi-typo.stderr (renamed from src/test/ui/suggestions/abi-typo.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs (renamed from src/test/ui/suggestions/adt-param-with-implicit-sized-bound.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr (renamed from src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/args-instead-of-tuple-errors.rs (renamed from src/test/ui/suggestions/args-instead-of-tuple-errors.rs) | 2 | ||||
-rw-r--r-- | tests/ui/suggestions/args-instead-of-tuple-errors.stderr | 107 | ||||
-rw-r--r-- | tests/ui/suggestions/args-instead-of-tuple.fixed | 33 | ||||
-rw-r--r-- | tests/ui/suggestions/args-instead-of-tuple.rs | 33 | ||||
-rw-r--r-- | tests/ui/suggestions/args-instead-of-tuple.stderr (renamed from src/test/ui/suggestions/args-instead-of-tuple.stderr) | 25 | ||||
-rw-r--r-- | tests/ui/suggestions/as-ref-2.rs (renamed from src/test/ui/suggestions/as-ref-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/as-ref-2.stderr (renamed from src/test/ui/suggestions/as-ref-2.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/as-ref.rs (renamed from src/test/ui/suggestions/as-ref.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/as-ref.stderr (renamed from src/test/ui/suggestions/as-ref.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-const-as-field.rs (renamed from src/test/ui/suggestions/assoc-const-as-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-const-as-field.stderr (renamed from src/test/ui/suggestions/assoc-const-as-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-const-as-fn.rs (renamed from src/test/ui/suggestions/assoc-const-as-fn.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-const-as-fn.stderr (renamed from src/test/ui/suggestions/assoc-const-as-fn.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-ct-for-assoc-method.rs | 25 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-ct-for-assoc-method.stderr | 47 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-type-in-method-return.rs (renamed from src/test/ui/suggestions/assoc-type-in-method-return.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc-type-in-method-return.stderr (renamed from src/test/ui/suggestions/assoc-type-in-method-return.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc_fn_without_self.rs (renamed from src/test/ui/suggestions/assoc_fn_without_self.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/assoc_fn_without_self.stderr (renamed from src/test/ui/suggestions/assoc_fn_without_self.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs (renamed from src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr (renamed from src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/attribute-typos.rs (renamed from src/test/ui/suggestions/attribute-typos.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/attribute-typos.stderr (renamed from src/test/ui/suggestions/attribute-typos.stderr) | 6 | ||||
-rw-r--r-- | tests/ui/suggestions/auxiliary/foo.rs (renamed from src/test/ui/suggestions/auxiliary/foo.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/auxiliary/issue-61963-1.rs (renamed from src/test/ui/suggestions/auxiliary/issue-61963-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/auxiliary/issue-61963.rs (renamed from src/test/ui/suggestions/auxiliary/issue-61963.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/auxiliary/issue-81839.rs (renamed from src/test/ui/suggestions/auxiliary/issue-81839.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/auxiliary/meow.rs (renamed from src/test/ui/suggestions/auxiliary/meow.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/auxiliary/not-object-safe.rs (renamed from src/test/ui/suggestions/auxiliary/not-object-safe.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/auxiliary/proc-macro-type-error.rs (renamed from src/test/ui/suggestions/auxiliary/proc-macro-type-error.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/bad-hex-float-lit.rs | 13 | ||||
-rw-r--r-- | tests/ui/suggestions/bad-hex-float-lit.stderr | 48 | ||||
-rw-r--r-- | tests/ui/suggestions/bool_typo_err_suggest.rs (renamed from src/test/ui/suggestions/bool_typo_err_suggest.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/bool_typo_err_suggest.stderr (renamed from src/test/ui/suggestions/bool_typo_err_suggest.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/borrow-for-loop-head.rs (renamed from src/test/ui/suggestions/borrow-for-loop-head.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/borrow-for-loop-head.stderr (renamed from src/test/ui/suggestions/borrow-for-loop-head.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/bound-suggestions.fixed (renamed from src/test/ui/suggestions/bound-suggestions.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/bound-suggestions.rs (renamed from src/test/ui/suggestions/bound-suggestions.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/bound-suggestions.stderr (renamed from src/test/ui/suggestions/bound-suggestions.stderr) | 15 | ||||
-rw-r--r-- | tests/ui/suggestions/box-future-wrong-output.rs (renamed from src/test/ui/suggestions/box-future-wrong-output.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/box-future-wrong-output.stderr (renamed from src/test/ui/suggestions/box-future-wrong-output.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/boxed-variant-field.rs (renamed from src/test/ui/suggestions/boxed-variant-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/boxed-variant-field.stderr (renamed from src/test/ui/suggestions/boxed-variant-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-boxed.rs (renamed from src/test/ui/suggestions/call-boxed.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-boxed.stderr (renamed from src/test/ui/suggestions/call-boxed.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-missing.rs (renamed from src/test/ui/suggestions/call-on-missing.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-missing.stderr (renamed from src/test/ui/suggestions/call-on-missing.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-unimplemented-ctor.rs (renamed from src/test/ui/suggestions/call-on-unimplemented-ctor.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-unimplemented-ctor.stderr (renamed from src/test/ui/suggestions/call-on-unimplemented-ctor.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-unimplemented-fn-ptr.rs (renamed from src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-unimplemented-fn-ptr.stderr (renamed from src/test/ui/suggestions/call-on-unimplemented-fn-ptr.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs | 13 | ||||
-rw-r--r-- | tests/ui/suggestions/call-on-unimplemented-with-autoderef.stderr | 21 | ||||
-rw-r--r-- | tests/ui/suggestions/chain-method-call-mutation-in-place.rs (renamed from src/test/ui/suggestions/chain-method-call-mutation-in-place.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/chain-method-call-mutation-in-place.stderr (renamed from src/test/ui/suggestions/chain-method-call-mutation-in-place.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed | 16 | ||||
-rw-r--r-- | tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.rs | 15 | ||||
-rw-r--r-- | tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr | 43 | ||||
-rw-r--r-- | tests/ui/suggestions/const-in-struct-pat.rs (renamed from src/test/ui/suggestions/const-in-struct-pat.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/const-in-struct-pat.stderr (renamed from src/test/ui/suggestions/const-in-struct-pat.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/const-no-type.rs (renamed from src/test/ui/suggestions/const-no-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/const-no-type.stderr (renamed from src/test/ui/suggestions/const-no-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs | 11 | ||||
-rw-r--r-- | tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr | 18 | ||||
-rw-r--r-- | tests/ui/suggestions/constrain-suggest-ice.rs (renamed from src/test/ui/suggestions/constrain-suggest-ice.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/constrain-suggest-ice.stderr (renamed from src/test/ui/suggestions/constrain-suggest-ice.stderr) | 11 | ||||
-rw-r--r-- | tests/ui/suggestions/constrain-trait.fixed (renamed from src/test/ui/suggestions/constrain-trait.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/constrain-trait.rs (renamed from src/test/ui/suggestions/constrain-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/constrain-trait.stderr (renamed from src/test/ui/suggestions/constrain-trait.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/copied-and-cloned.fixed (renamed from src/test/ui/suggestions/copied-and-cloned.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/copied-and-cloned.rs (renamed from src/test/ui/suggestions/copied-and-cloned.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/copied-and-cloned.stderr (renamed from src/test/ui/suggestions/copied-and-cloned.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/core-std-import-order-issue-83564.rs (renamed from src/test/ui/suggestions/core-std-import-order-issue-83564.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/core-std-import-order-issue-83564.stderr (renamed from src/test/ui/suggestions/core-std-import-order-issue-83564.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/count2len.rs (renamed from src/test/ui/suggestions/count2len.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/count2len.stderr (renamed from src/test/ui/suggestions/count2len.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/crate-or-module-typo.rs (renamed from src/test/ui/suggestions/crate-or-module-typo.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/crate-or-module-typo.stderr (renamed from src/test/ui/suggestions/crate-or-module-typo.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/deref-path-method.rs (renamed from src/test/ui/suggestions/deref-path-method.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/deref-path-method.stderr (renamed from src/test/ui/suggestions/deref-path-method.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/derive-clone-for-eq.fixed (renamed from src/test/ui/suggestions/derive-clone-for-eq.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/derive-clone-for-eq.rs (renamed from src/test/ui/suggestions/derive-clone-for-eq.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/derive-clone-for-eq.stderr (renamed from src/test/ui/suggestions/derive-clone-for-eq.stderr) | 7 | ||||
-rw-r--r-- | tests/ui/suggestions/derive-macro-missing-bounds.rs (renamed from src/test/ui/suggestions/derive-macro-missing-bounds.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/derive-macro-missing-bounds.stderr (renamed from src/test/ui/suggestions/derive-macro-missing-bounds.stderr) | 10 | ||||
-rw-r--r-- | tests/ui/suggestions/derive-trait-for-method-call.rs (renamed from src/test/ui/suggestions/derive-trait-for-method-call.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/derive-trait-for-method-call.stderr | 105 | ||||
-rw-r--r-- | tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.rs (renamed from src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr (renamed from src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr) | 6 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs (renamed from src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr (renamed from src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-child.rs (renamed from src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-child.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-parent.rs (renamed from src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-parent.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.rs (renamed from src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr (renamed from src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.rs (renamed from src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr (renamed from src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-pin-array-dot-set.rs (renamed from src/test/ui/suggestions/dont-suggest-pin-array-dot-set.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-pin-array-dot-set.stderr (renamed from src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs | 131 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr | 309 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ref/move-into-closure.rs (renamed from src/test/ui/suggestions/dont-suggest-ref/move-into-closure.rs) | 21 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr (renamed from src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr) | 187 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ref/simple.rs | 336 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ref/simple.stderr | 985 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-try_into-in-macros.rs (renamed from src/test/ui/suggestions/dont-suggest-try_into-in-macros.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr | 14 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ufcs-for-const.rs (renamed from src/test/ui/suggestions/dont-suggest-ufcs-for-const.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-suggest-ufcs-for-const.stderr (renamed from src/test/ui/suggestions/dont-suggest-ufcs-for-const.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-try-removing-the-field.rs (renamed from src/test/ui/suggestions/dont-try-removing-the-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-try-removing-the-field.stderr (renamed from src/test/ui/suggestions/dont-try-removing-the-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs (renamed from src/test/ui/suggestions/dont-wrap-ambiguous-receivers.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr (renamed from src/test/ui/suggestions/dont-wrap-ambiguous-receivers.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/enum-method-probe.fixed (renamed from src/test/ui/suggestions/enum-method-probe.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/enum-method-probe.rs (renamed from src/test/ui/suggestions/enum-method-probe.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/enum-method-probe.stderr (renamed from src/test/ui/suggestions/enum-method-probe.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/enum-variant-arg-mismatch.rs | 10 | ||||
-rw-r--r-- | tests/ui/suggestions/enum-variant-arg-mismatch.stderr | 22 | ||||
-rw-r--r-- | tests/ui/suggestions/expected-boxed-future-isnt-pinned.rs (renamed from src/test/ui/suggestions/expected-boxed-future-isnt-pinned.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr (renamed from src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr) | 12 | ||||
-rw-r--r-- | tests/ui/suggestions/field-access-considering-privacy.rs (renamed from src/test/ui/suggestions/field-access-considering-privacy.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/field-access-considering-privacy.stderr (renamed from src/test/ui/suggestions/field-access-considering-privacy.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/field-access.fixed (renamed from src/test/ui/suggestions/field-access.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/field-access.rs (renamed from src/test/ui/suggestions/field-access.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/field-access.stderr (renamed from src/test/ui/suggestions/field-access.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/field-has-method.rs (renamed from src/test/ui/suggestions/field-has-method.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/field-has-method.stderr (renamed from src/test/ui/suggestions/field-has-method.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs (renamed from src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr (renamed from src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-missing-lifetime-in-item.rs (renamed from src/test/ui/suggestions/fn-missing-lifetime-in-item.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-missing-lifetime-in-item.stderr (renamed from src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-needing-specified-return-type-param.rs (renamed from src/test/ui/suggestions/fn-needing-specified-return-type-param.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-needing-specified-return-type-param.stderr (renamed from src/test/ui/suggestions/fn-needing-specified-return-type-param.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs (renamed from src/test/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-or-tuple-struct-with-underscore-args.stderr (renamed from src/test/ui/suggestions/fn-or-tuple-struct-with-underscore-args.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-or-tuple-struct-without-args.rs (renamed from src/test/ui/suggestions/fn-or-tuple-struct-without-args.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr (renamed from src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr) | 44 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-to-method-deeply-nested.rs | 13 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-to-method-deeply-nested.stderr | 39 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-to-method.rs (renamed from src/test/ui/suggestions/fn-to-method.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-to-method.stderr (renamed from src/test/ui/suggestions/fn-to-method.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-trait-notation.fixed (renamed from src/test/ui/suggestions/fn-trait-notation.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-trait-notation.rs (renamed from src/test/ui/suggestions/fn-trait-notation.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/fn-trait-notation.stderr (renamed from src/test/ui/suggestions/fn-trait-notation.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/for-i-in-vec.fixed (renamed from src/test/ui/suggestions/for-i-in-vec.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/for-i-in-vec.rs (renamed from src/test/ui/suggestions/for-i-in-vec.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/for-i-in-vec.stderr (renamed from src/test/ui/suggestions/for-i-in-vec.stderr) | 10 | ||||
-rw-r--r-- | tests/ui/suggestions/format-borrow.rs (renamed from src/test/ui/suggestions/format-borrow.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/format-borrow.stderr (renamed from src/test/ui/suggestions/format-borrow.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/if-let-typo.rs (renamed from src/test/ui/suggestions/if-let-typo.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/if-let-typo.stderr (renamed from src/test/ui/suggestions/if-let-typo.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/if-then-neeing-semi.rs (renamed from src/test/ui/suggestions/if-then-neeing-semi.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/if-then-neeing-semi.stderr (renamed from src/test/ui/suggestions/if-then-neeing-semi.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/ignore-nested-field-binding.fixed (renamed from src/test/ui/suggestions/ignore-nested-field-binding.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/ignore-nested-field-binding.rs (renamed from src/test/ui/suggestions/ignore-nested-field-binding.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/ignore-nested-field-binding.stderr (renamed from src/test/ui/suggestions/ignore-nested-field-binding.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs (renamed from src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr (renamed from src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/imm-ref-trait-object-literal.rs (renamed from src/test/ui/suggestions/imm-ref-trait-object-literal.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/imm-ref-trait-object-literal.stderr (renamed from src/test/ui/suggestions/imm-ref-trait-object-literal.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/imm-ref-trait-object.rs (renamed from src/test/ui/suggestions/imm-ref-trait-object.rs) | 2 | ||||
-rw-r--r-- | tests/ui/suggestions/imm-ref-trait-object.stderr | 13 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs (renamed from src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr (renamed from src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs (renamed from src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr (renamed from src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-missing-lifetime-gated.rs (renamed from src/test/ui/suggestions/impl-trait-missing-lifetime-gated.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr (renamed from src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-missing-lifetime.rs (renamed from src/test/ui/suggestions/impl-trait-missing-lifetime.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-missing-lifetime.stderr (renamed from src/test/ui/suggestions/impl-trait-missing-lifetime.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-return-trailing-semicolon.rs (renamed from src/test/ui/suggestions/impl-trait-return-trailing-semicolon.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr (renamed from src/test/ui/suggestions/impl-trait-return-trailing-semicolon.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-with-missing-bounds.rs (renamed from src/test/ui/suggestions/impl-trait-with-missing-bounds.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-with-missing-bounds.stderr (renamed from src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.fixed (renamed from src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs (renamed from src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr (renamed from src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/import-trait-for-method-call.rs (renamed from src/test/ui/suggestions/import-trait-for-method-call.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/import-trait-for-method-call.stderr (renamed from src/test/ui/suggestions/import-trait-for-method-call.stderr) | 6 | ||||
-rw-r--r-- | tests/ui/suggestions/inner_type.fixed (renamed from src/test/ui/suggestions/inner_type.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/inner_type.rs (renamed from src/test/ui/suggestions/inner_type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/inner_type.stderr (renamed from src/test/ui/suggestions/inner_type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/inner_type2.rs (renamed from src/test/ui/suggestions/inner_type2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/inner_type2.stderr (renamed from src/test/ui/suggestions/inner_type2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/into-convert.rs (renamed from src/test/ui/suggestions/into-convert.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/into-convert.stderr (renamed from src/test/ui/suggestions/into-convert.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/into-str.rs (renamed from src/test/ui/suggestions/into-str.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/into-str.stderr (renamed from src/test/ui/suggestions/into-str.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/invalid-bin-op.rs (renamed from src/test/ui/suggestions/invalid-bin-op.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/invalid-bin-op.stderr (renamed from src/test/ui/suggestions/invalid-bin-op.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101065.fixed (renamed from src/test/ui/suggestions/issue-101065.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101065.rs (renamed from src/test/ui/suggestions/issue-101065.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101065.stderr (renamed from src/test/ui/suggestions/issue-101065.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101421.rs (renamed from src/test/ui/suggestions/issue-101421.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101421.stderr (renamed from src/test/ui/suggestions/issue-101421.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101465.rs (renamed from src/test/ui/suggestions/issue-101465.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101465.stderr (renamed from src/test/ui/suggestions/issue-101465.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101623.rs (renamed from src/test/ui/suggestions/issue-101623.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101623.stderr (renamed from src/test/ui/suggestions/issue-101623.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101984.rs (renamed from src/test/ui/suggestions/issue-101984.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-101984.stderr (renamed from src/test/ui/suggestions/issue-101984.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-102354.rs (renamed from src/test/ui/suggestions/issue-102354.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-102354.stderr (renamed from src/test/ui/suggestions/issue-102354.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-102892.rs (renamed from src/test/ui/suggestions/issue-102892.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-102892.stderr (renamed from src/test/ui/suggestions/issue-102892.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-103112.rs (renamed from src/test/ui/suggestions/issue-103112.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-103112.stderr (renamed from src/test/ui/suggestions/issue-103112.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104086-suggest-let.rs (renamed from src/test/ui/suggestions/issue-104086-suggest-let.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104086-suggest-let.stderr (renamed from src/test/ui/suggestions/issue-104086-suggest-let.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104287.rs | 13 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104287.stderr | 30 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104327.rs | 12 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104327.stderr | 17 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104328.rs | 12 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-104328.stderr | 17 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105226.rs | 22 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105226.stderr | 31 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105494.rs | 22 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105494.stderr | 54 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105645.rs | 8 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105645.stderr | 18 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed | 28 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs | 28 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr | 49 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs | 23 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr | 35 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-106443-sugg-clone-for-bound.rs | 20 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-106443-sugg-clone-for-bound.stderr | 29 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-21673.rs (renamed from src/test/ui/suggestions/issue-21673.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-21673.stderr (renamed from src/test/ui/suggestions/issue-21673.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs (renamed from src/test/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr (renamed from src/test/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-52820.fixed (renamed from src/test/ui/suggestions/issue-52820.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-52820.rs (renamed from src/test/ui/suggestions/issue-52820.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-52820.stderr (renamed from src/test/ui/suggestions/issue-52820.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-53692.fixed (renamed from src/test/ui/suggestions/issue-53692.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-53692.rs (renamed from src/test/ui/suggestions/issue-53692.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-53692.stderr (renamed from src/test/ui/suggestions/issue-53692.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-57672.rs (renamed from src/test/ui/suggestions/issue-57672.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-59819.fixed (renamed from src/test/ui/suggestions/issue-59819.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-59819.rs (renamed from src/test/ui/suggestions/issue-59819.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-59819.stderr (renamed from src/test/ui/suggestions/issue-59819.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-61226.fixed (renamed from src/test/ui/suggestions/issue-61226.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-61226.rs (renamed from src/test/ui/suggestions/issue-61226.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-61226.stderr (renamed from src/test/ui/suggestions/issue-61226.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-61963.rs (renamed from src/test/ui/suggestions/issue-61963.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-61963.stderr (renamed from src/test/ui/suggestions/issue-61963.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-62843.rs (renamed from src/test/ui/suggestions/issue-62843.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-62843.stderr (renamed from src/test/ui/suggestions/issue-62843.stderr) | 3 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-64252-self-type.rs (renamed from src/test/ui/suggestions/issue-64252-self-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-64252-self-type.stderr (renamed from src/test/ui/suggestions/issue-64252-self-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-66968-suggest-sorted-words.rs (renamed from src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-66968-suggest-sorted-words.stderr (renamed from src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-68049-1.rs (renamed from src/test/ui/suggestions/issue-68049-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-68049-1.stderr (renamed from src/test/ui/suggestions/issue-68049-1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-68049-2.rs (renamed from src/test/ui/suggestions/issue-68049-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-68049-2.stderr | 25 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-71394-no-from-impl.rs (renamed from src/test/ui/suggestions/issue-71394-no-from-impl.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-71394-no-from-impl.stderr | 14 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-72766.rs (renamed from src/test/ui/suggestions/issue-72766.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-72766.stderr (renamed from src/test/ui/suggestions/issue-72766.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs (renamed from src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr (renamed from src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-81098.rs (renamed from src/test/ui/suggestions/issue-81098.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-81098.stderr (renamed from src/test/ui/suggestions/issue-81098.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-81839.rs (renamed from src/test/ui/suggestions/issue-81839.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-81839.stderr (renamed from src/test/ui/suggestions/issue-81839.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-82361.fixed (renamed from src/test/ui/suggestions/issue-82361.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-82361.rs (renamed from src/test/ui/suggestions/issue-82361.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-82361.stderr (renamed from src/test/ui/suggestions/issue-82361.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-82566-1.rs (renamed from src/test/ui/suggestions/issue-82566-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-82566-1.stderr (renamed from src/test/ui/suggestions/issue-82566-1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-82566-2.rs (renamed from src/test/ui/suggestions/issue-82566-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-82566-2.stderr (renamed from src/test/ui/suggestions/issue-82566-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-83892.fixed (renamed from src/test/ui/suggestions/issue-83892.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-83892.rs (renamed from src/test/ui/suggestions/issue-83892.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-83892.stderr (renamed from src/test/ui/suggestions/issue-83892.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-83943.fixed (renamed from src/test/ui/suggestions/issue-83943.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-83943.rs (renamed from src/test/ui/suggestions/issue-83943.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-83943.stderr (renamed from src/test/ui/suggestions/issue-83943.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84592.rs (renamed from src/test/ui/suggestions/issue-84592.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84592.stderr (renamed from src/test/ui/suggestions/issue-84592.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84700.rs (renamed from src/test/ui/suggestions/issue-84700.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84700.stderr (renamed from src/test/ui/suggestions/issue-84700.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973-2.rs (renamed from src/test/ui/suggestions/issue-84973-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973-2.stderr (renamed from src/test/ui/suggestions/issue-84973-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973-blacklist.rs (renamed from src/test/ui/suggestions/issue-84973-blacklist.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973-blacklist.stderr (renamed from src/test/ui/suggestions/issue-84973-blacklist.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973-negative.rs (renamed from src/test/ui/suggestions/issue-84973-negative.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973-negative.stderr (renamed from src/test/ui/suggestions/issue-84973-negative.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973.rs (renamed from src/test/ui/suggestions/issue-84973.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-84973.stderr (renamed from src/test/ui/suggestions/issue-84973.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-85347.rs (renamed from src/test/ui/suggestions/issue-85347.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-85347.stderr (renamed from src/test/ui/suggestions/issue-85347.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs (renamed from src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr (renamed from src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.rs (renamed from src/test/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.stderr (renamed from src/test/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-86100-tuple-paren-comma.rs (renamed from src/test/ui/suggestions/issue-86100-tuple-paren-comma.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr (renamed from src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-86667.rs (renamed from src/test/ui/suggestions/issue-86667.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-86667.stderr (renamed from src/test/ui/suggestions/issue-86667.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-88730.rs | 15 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-88730.stderr | 17 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-89064.rs (renamed from src/test/ui/suggestions/issue-89064.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-89064.stderr (renamed from src/test/ui/suggestions/issue-89064.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-89333.rs (renamed from src/test/ui/suggestions/issue-89333.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-89333.stderr (renamed from src/test/ui/suggestions/issue-89333.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs (renamed from src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr (renamed from src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-90974.rs (renamed from src/test/ui/suggestions/issue-90974.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-90974.stderr (renamed from src/test/ui/suggestions/issue-90974.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-96223.rs (renamed from src/test/ui/suggestions/issue-96223.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-96223.stderr (renamed from src/test/ui/suggestions/issue-96223.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-96555.rs (renamed from src/test/ui/suggestions/issue-96555.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-96555.stderr (renamed from src/test/ui/suggestions/issue-96555.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97677.fixed (renamed from src/test/ui/suggestions/issue-97677.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97677.rs (renamed from src/test/ui/suggestions/issue-97677.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97677.stderr (renamed from src/test/ui/suggestions/issue-97677.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97704.fixed (renamed from src/test/ui/suggestions/issue-97704.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97704.rs (renamed from src/test/ui/suggestions/issue-97704.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97704.stderr (renamed from src/test/ui/suggestions/issue-97704.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97760.rs (renamed from src/test/ui/suggestions/issue-97760.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-97760.stderr (renamed from src/test/ui/suggestions/issue-97760.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-98500.rs (renamed from src/test/ui/suggestions/issue-98500.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-98500.stderr (renamed from src/test/ui/suggestions/issue-98500.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-99080.rs (renamed from src/test/ui/suggestions/issue-99080.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-99080.stderr (renamed from src/test/ui/suggestions/issue-99080.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-99240-2.rs (renamed from src/test/ui/suggestions/issue-99240-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-99240-2.stderr (renamed from src/test/ui/suggestions/issue-99240-2.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-99240.rs (renamed from src/test/ui/suggestions/issue-99240.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/issue-99240.stderr (renamed from src/test/ui/suggestions/issue-99240.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/js-style-comparison-op-separate-eq-token.rs (renamed from src/test/ui/suggestions/js-style-comparison-op-separate-eq-token.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/js-style-comparison-op-separate-eq-token.stderr (renamed from src/test/ui/suggestions/js-style-comparison-op-separate-eq-token.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/js-style-comparison-op.fixed (renamed from src/test/ui/suggestions/js-style-comparison-op.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/js-style-comparison-op.rs (renamed from src/test/ui/suggestions/js-style-comparison-op.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/js-style-comparison-op.stderr (renamed from src/test/ui/suggestions/js-style-comparison-op.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/let-binding-init-expr-as-ty.rs (renamed from src/test/ui/suggestions/let-binding-init-expr-as-ty.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/let-binding-init-expr-as-ty.stderr (renamed from src/test/ui/suggestions/let-binding-init-expr-as-ty.stderr) | 7 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/issue-105544.fixed | 45 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/issue-105544.rs | 45 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/issue-105544.stderr | 110 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.fixed | 29 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs) | 3 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr | 30 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.fixed (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.rs (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.stderr (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr (renamed from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr) | 14 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs (renamed from src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr (renamed from src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/many-type-ascription.rs (renamed from src/test/ui/suggestions/many-type-ascription.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/many-type-ascription.stderr (renamed from src/test/ui/suggestions/many-type-ascription.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-ergonomics.rs (renamed from src/test/ui/suggestions/match-ergonomics.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-ergonomics.stderr (renamed from src/test/ui/suggestions/match-ergonomics.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-needing-semi.rs (renamed from src/test/ui/suggestions/match-needing-semi.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-needing-semi.stderr (renamed from src/test/ui/suggestions/match-needing-semi.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-prev-arm-needing-semi.rs (renamed from src/test/ui/suggestions/match-prev-arm-needing-semi.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-prev-arm-needing-semi.stderr (renamed from src/test/ui/suggestions/match-prev-arm-needing-semi.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.rs (renamed from src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr (renamed from src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/method-access-to-range-literal-typo.fixed | 34 | ||||
-rw-r--r-- | tests/ui/suggestions/method-access-to-range-literal-typo.rs | 34 | ||||
-rw-r--r-- | tests/ui/suggestions/method-access-to-range-literal-typo.stderr | 48 | ||||
-rw-r--r-- | tests/ui/suggestions/method-missing-parentheses.rs (renamed from src/test/ui/suggestions/method-missing-parentheses.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/method-missing-parentheses.stderr (renamed from src/test/ui/suggestions/method-missing-parentheses.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/mismatched-types-numeric-from.rs (renamed from src/test/ui/suggestions/mismatched-types-numeric-from.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/mismatched-types-numeric-from.stderr (renamed from src/test/ui/suggestions/mismatched-types-numeric-from.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed (renamed from src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs (renamed from src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr (renamed from src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-assoc-fn.rs (renamed from src/test/ui/suggestions/missing-assoc-fn.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-assoc-fn.stderr (renamed from src/test/ui/suggestions/missing-assoc-fn.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-assoc-type-bound-restriction.rs (renamed from src/test/ui/suggestions/missing-assoc-type-bound-restriction.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.rs (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr (renamed from src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed (renamed from src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs (renamed from src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr (renamed from src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed (renamed from src/test/ui/suggestions/missing-bound-in-manual-copy-impl.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs (renamed from src/test/ui/suggestions/missing-bound-in-manual-copy-impl.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr (renamed from src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs (renamed from src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr (renamed from src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-lifetime-specifier.rs (renamed from src/test/ui/suggestions/missing-lifetime-specifier.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-lifetime-specifier.stderr (renamed from src/test/ui/suggestions/missing-lifetime-specifier.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-lt-for-hrtb.rs (renamed from src/test/ui/suggestions/missing-lt-for-hrtb.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-lt-for-hrtb.stderr (renamed from src/test/ui/suggestions/missing-lt-for-hrtb.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-trait-item.fixed (renamed from src/test/ui/suggestions/missing-trait-item.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-trait-item.rs (renamed from src/test/ui/suggestions/missing-trait-item.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-trait-item.stderr (renamed from src/test/ui/suggestions/missing-trait-item.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-type-param-used-in-param.fixed | 8 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-type-param-used-in-param.rs | 8 | ||||
-rw-r--r-- | tests/ui/suggestions/missing-type-param-used-in-param.stderr (renamed from src/test/ui/suggestions/missing-type-param-used-in-param.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/move-generic-to-trait-in-method-with-params.rs (renamed from src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr (renamed from src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/multibyte-escapes.rs (renamed from src/test/ui/suggestions/multibyte-escapes.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/multibyte-escapes.stderr (renamed from src/test/ui/suggestions/multibyte-escapes.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/mut-borrow-needed-by-trait.rs (renamed from src/test/ui/suggestions/mut-borrow-needed-by-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/mut-borrow-needed-by-trait.stderr (renamed from src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr) | 16 | ||||
-rw-r--r-- | tests/ui/suggestions/mut-ref-reassignment.rs (renamed from src/test/ui/suggestions/mut-ref-reassignment.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/mut-ref-reassignment.stderr (renamed from src/test/ui/suggestions/mut-ref-reassignment.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/negative-literal-index.fixed (renamed from src/test/ui/suggestions/negative-literal-index.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/negative-literal-index.rs (renamed from src/test/ui/suggestions/negative-literal-index.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/negative-literal-index.stderr (renamed from src/test/ui/suggestions/negative-literal-index.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/nested-non-tuple-tuple-struct.rs (renamed from src/test/ui/suggestions/nested-non-tuple-tuple-struct.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/nested-non-tuple-tuple-struct.stderr (renamed from src/test/ui/suggestions/nested-non-tuple-tuple-struct.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/no-extern-crate-in-type.rs (renamed from src/test/ui/suggestions/no-extern-crate-in-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/no-extern-crate-in-type.stderr (renamed from src/test/ui/suggestions/no-extern-crate-in-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs (renamed from src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr (renamed from src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/non-existent-field-present-in-subfield.fixed (renamed from src/test/ui/suggestions/non-existent-field-present-in-subfield.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/non-existent-field-present-in-subfield.rs (renamed from src/test/ui/suggestions/non-existent-field-present-in-subfield.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/non-existent-field-present-in-subfield.stderr (renamed from src/test/ui/suggestions/non-existent-field-present-in-subfield.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/object-unsafe-trait-references-self.rs (renamed from src/test/ui/suggestions/object-unsafe-trait-references-self.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/object-unsafe-trait-references-self.stderr (renamed from src/test/ui/suggestions/object-unsafe-trait-references-self.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/object-unsafe-trait-should-use-self.rs (renamed from src/test/ui/suggestions/object-unsafe-trait-should-use-self.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/object-unsafe-trait-should-use-self.stderr (renamed from src/test/ui/suggestions/object-unsafe-trait-should-use-self.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.fixed (renamed from src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.rs (renamed from src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr (renamed from src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/opaque-type-error.rs (renamed from src/test/ui/suggestions/opaque-type-error.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/opaque-type-error.stderr (renamed from src/test/ui/suggestions/opaque-type-error.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/option-content-move-from-tuple-match.rs (renamed from src/test/ui/suggestions/option-content-move-from-tuple-match.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/option-content-move-from-tuple-match.stderr (renamed from src/test/ui/suggestions/option-content-move-from-tuple-match.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/option-content-move.rs (renamed from src/test/ui/suggestions/option-content-move.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/option-content-move.stderr | 35 | ||||
-rw-r--r-- | tests/ui/suggestions/option-content-move2.rs (renamed from src/test/ui/suggestions/option-content-move2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/option-content-move2.stderr (renamed from src/test/ui/suggestions/option-content-move2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/option-to-bool.rs (renamed from src/test/ui/suggestions/option-to-bool.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/option-to-bool.stderr (renamed from src/test/ui/suggestions/option-to-bool.stderr) | 4 | ||||
-rw-r--r-- | tests/ui/suggestions/parenthesized-deref-suggestion.rs (renamed from src/test/ui/suggestions/parenthesized-deref-suggestion.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/parenthesized-deref-suggestion.stderr (renamed from src/test/ui/suggestions/parenthesized-deref-suggestion.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/path-by-value.rs (renamed from src/test/ui/suggestions/path-by-value.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/path-by-value.stderr (renamed from src/test/ui/suggestions/path-by-value.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/path-display.rs (renamed from src/test/ui/suggestions/path-display.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/path-display.stderr (renamed from src/test/ui/suggestions/path-display.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/pattern-slice-vec.fixed (renamed from src/test/ui/suggestions/pattern-slice-vec.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/pattern-slice-vec.rs (renamed from src/test/ui/suggestions/pattern-slice-vec.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/pattern-slice-vec.stderr (renamed from src/test/ui/suggestions/pattern-slice-vec.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/pattern-struct-with-slice-vec-field.rs (renamed from src/test/ui/suggestions/pattern-struct-with-slice-vec-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/pattern-struct-with-slice-vec-field.stderr (renamed from src/test/ui/suggestions/pattern-struct-with-slice-vec-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/private-field.rs (renamed from src/test/ui/suggestions/private-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/private-field.stderr (renamed from src/test/ui/suggestions/private-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/raw-byte-string-prefix.rs (renamed from src/test/ui/suggestions/raw-byte-string-prefix.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/raw-byte-string-prefix.stderr (renamed from src/test/ui/suggestions/raw-byte-string-prefix.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/raw-name-use-suggestion.rs (renamed from src/test/ui/suggestions/raw-name-use-suggestion.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/raw-name-use-suggestion.stderr (renamed from src/test/ui/suggestions/raw-name-use-suggestion.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/recover-from-semicolon-trailing-item.rs (renamed from src/test/ui/suggestions/recover-from-semicolon-trailing-item.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr (renamed from src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/recover-invalid-float.fixed (renamed from src/test/ui/suggestions/recover-invalid-float.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/recover-invalid-float.rs (renamed from src/test/ui/suggestions/recover-invalid-float.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/recover-invalid-float.stderr (renamed from src/test/ui/suggestions/recover-invalid-float.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.rs (renamed from src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr (renamed from src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/ref-pattern-binding.fixed (renamed from src/test/ui/suggestions/ref-pattern-binding.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/ref-pattern-binding.rs (renamed from src/test/ui/suggestions/ref-pattern-binding.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/ref-pattern-binding.stderr (renamed from src/test/ui/suggestions/ref-pattern-binding.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.rs (renamed from src/test/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr (renamed from src/test/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/remove-as_str.rs (renamed from src/test/ui/suggestions/remove-as_str.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/remove-as_str.stderr (renamed from src/test/ui/suggestions/remove-as_str.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/restrict-type-argument.rs (renamed from src/test/ui/suggestions/restrict-type-argument.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/restrict-type-argument.stderr (renamed from src/test/ui/suggestions/restrict-type-argument.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/restrict-type-not-param.rs (renamed from src/test/ui/suggestions/restrict-type-not-param.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/restrict-type-not-param.stderr (renamed from src/test/ui/suggestions/restrict-type-not-param.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/return-bindings-multi.rs (renamed from src/test/ui/suggestions/return-bindings-multi.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-bindings-multi.stderr (renamed from src/test/ui/suggestions/return-bindings-multi.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-bindings.rs (renamed from src/test/ui/suggestions/return-bindings.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-bindings.stderr (renamed from src/test/ui/suggestions/return-bindings.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-closures.rs (renamed from src/test/ui/suggestions/return-closures.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-closures.stderr (renamed from src/test/ui/suggestions/return-closures.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-cycle-2.rs (renamed from src/test/ui/suggestions/return-cycle-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-cycle-2.stderr (renamed from src/test/ui/suggestions/return-cycle-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-cycle.rs (renamed from src/test/ui/suggestions/return-cycle.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-cycle.stderr (renamed from src/test/ui/suggestions/return-cycle.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-elided-lifetime.rs (renamed from src/test/ui/suggestions/return-elided-lifetime.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-elided-lifetime.stderr (renamed from src/test/ui/suggestions/return-elided-lifetime.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-without-lifetime.rs (renamed from src/test/ui/suggestions/return-without-lifetime.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/return-without-lifetime.stderr (renamed from src/test/ui/suggestions/return-without-lifetime.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/shadowed-lplace-method-2.rs | 23 | ||||
-rw-r--r-- | tests/ui/suggestions/shadowed-lplace-method-2.stderr | 25 | ||||
-rw-r--r-- | tests/ui/suggestions/shadowed-lplace-method.fixed | 10 | ||||
-rw-r--r-- | tests/ui/suggestions/shadowed-lplace-method.rs | 10 | ||||
-rw-r--r-- | tests/ui/suggestions/shadowed-lplace-method.stderr | 26 | ||||
-rw-r--r-- | tests/ui/suggestions/slice-issue-87994.rs (renamed from src/test/ui/suggestions/slice-issue-87994.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/slice-issue-87994.stderr (renamed from src/test/ui/suggestions/slice-issue-87994.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/struct-field-type-including-single-colon.rs (renamed from src/test/ui/suggestions/struct-field-type-including-single-colon.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/struct-field-type-including-single-colon.stderr (renamed from src/test/ui/suggestions/struct-field-type-including-single-colon.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/struct-initializer-comma.fixed (renamed from src/test/ui/suggestions/struct-initializer-comma.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/struct-initializer-comma.rs (renamed from src/test/ui/suggestions/struct-initializer-comma.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/struct-initializer-comma.stderr (renamed from src/test/ui/suggestions/struct-initializer-comma.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/sugg-else-for-closure.fixed (renamed from src/test/ui/suggestions/sugg-else-for-closure.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/sugg-else-for-closure.rs (renamed from src/test/ui/suggestions/sugg-else-for-closure.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/sugg-else-for-closure.stderr | 27 | ||||
-rw-r--r-- | tests/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs (renamed from src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr (renamed from src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-add-self.rs (renamed from src/test/ui/suggestions/suggest-add-self.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-add-self.stderr (renamed from src/test/ui/suggestions/suggest-add-self.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed (renamed from src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs (renamed from src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr (renamed from src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-deref.fixed (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-deref.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-deref.rs (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-deref.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-deref.stderr (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-deref.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.rs (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.rs (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.fixed (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.rs (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr (renamed from src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-blanket-impl-local-trait.rs (renamed from src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-blanket-impl-local-trait.stderr (renamed from src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-borrow-to-dyn-object.rs (renamed from src/test/ui/suggestions/suggest-borrow-to-dyn-object.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr (renamed from src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-box.fixed (renamed from src/test/ui/suggestions/suggest-box.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-box.rs (renamed from src/test/ui/suggestions/suggest-box.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-box.stderr (renamed from src/test/ui/suggestions/suggest-box.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-change-mut.rs (renamed from src/test/ui/suggestions/suggest-change-mut.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-change-mut.stderr (renamed from src/test/ui/suggestions/suggest-change-mut.stderr) | 9 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-closure-return-type-1.rs (renamed from src/test/ui/suggestions/suggest-closure-return-type-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-closure-return-type-1.stderr (renamed from src/test/ui/suggestions/suggest-closure-return-type-1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-closure-return-type-2.rs (renamed from src/test/ui/suggestions/suggest-closure-return-type-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-closure-return-type-2.stderr (renamed from src/test/ui/suggestions/suggest-closure-return-type-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-closure-return-type-3.rs (renamed from src/test/ui/suggestions/suggest-closure-return-type-3.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-closure-return-type-3.stderr (renamed from src/test/ui/suggestions/suggest-closure-return-type-3.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-dereferencing-index.fixed (renamed from src/test/ui/suggestions/suggest-dereferencing-index.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-dereferencing-index.rs (renamed from src/test/ui/suggestions/suggest-dereferencing-index.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-dereferencing-index.stderr (renamed from src/test/ui/suggestions/suggest-dereferencing-index.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-full-enum-variant-for-local-module.rs (renamed from src/test/ui/suggestions/suggest-full-enum-variant-for-local-module.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr (renamed from src/test/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-imm-mut-trait-implementations.rs (renamed from src/test/ui/suggestions/suggest-imm-mut-trait-implementations.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-imm-mut-trait-implementations.stderr (renamed from src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-impl-trait-lifetime.fixed (renamed from src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-impl-trait-lifetime.rs (renamed from src/test/ui/suggestions/suggest-impl-trait-lifetime.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-impl-trait-lifetime.stderr (renamed from src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-labels.rs (renamed from src/test/ui/suggestions/suggest-labels.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-labels.stderr (renamed from src/test/ui/suggestions/suggest-labels.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-let-for-assignment.fixed (renamed from src/test/ui/suggestions/suggest-let-for-assignment.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-let-for-assignment.rs (renamed from src/test/ui/suggestions/suggest-let-for-assignment.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-let-for-assignment.stderr (renamed from src/test/ui/suggestions/suggest-let-for-assignment.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-methods.rs (renamed from src/test/ui/suggestions/suggest-methods.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-methods.stderr (renamed from src/test/ui/suggestions/suggest-methods.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-move-lifetimes.rs (renamed from src/test/ui/suggestions/suggest-move-lifetimes.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-move-lifetimes.stderr (renamed from src/test/ui/suggestions/suggest-move-lifetimes.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-move-types.rs (renamed from src/test/ui/suggestions/suggest-move-types.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-move-types.stderr (renamed from src/test/ui/suggestions/suggest-move-types.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.fixed (renamed from src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.rs (renamed from src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.stderr (renamed from src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-mut-method-for-loop.rs (renamed from src/test/ui/suggestions/suggest-mut-method-for-loop.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-mut-method-for-loop.stderr (renamed from src/test/ui/suggestions/suggest-mut-method-for-loop.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-on-bare-closure-call.rs (renamed from src/test/ui/suggestions/suggest-on-bare-closure-call.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-on-bare-closure-call.stderr (renamed from src/test/ui/suggestions/suggest-on-bare-closure-call.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-ref-macro.rs (renamed from src/test/ui/suggestions/suggest-ref-macro.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-ref-macro.stderr (renamed from src/test/ui/suggestions/suggest-ref-macro.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-ref-mut.rs (renamed from src/test/ui/suggestions/suggest-ref-mut.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-ref-mut.stderr | 47 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-1.fixed (renamed from src/test/ui/suggestions/suggest-remove-refs-1.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-1.rs (renamed from src/test/ui/suggestions/suggest-remove-refs-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-1.stderr | 17 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-2.fixed (renamed from src/test/ui/suggestions/suggest-remove-refs-2.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-2.rs (renamed from src/test/ui/suggestions/suggest-remove-refs-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-2.stderr | 17 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-3.fixed (renamed from src/test/ui/suggestions/suggest-remove-refs-3.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-3.rs (renamed from src/test/ui/suggestions/suggest-remove-refs-3.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-3.stderr | 21 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-4.fixed | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-4.rs | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-4.stderr | 17 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-5.fixed | 8 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-5.rs | 8 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-remove-refs-5.stderr | 37 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed (renamed from src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs (renamed from src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr (renamed from src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-split-at-mut.rs (renamed from src/test/ui/suggestions/suggest-split-at-mut.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-split-at-mut.stderr (renamed from src/test/ui/suggestions/suggest-split-at-mut.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-std-when-using-type.fixed (renamed from src/test/ui/suggestions/suggest-std-when-using-type.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-std-when-using-type.rs (renamed from src/test/ui/suggestions/suggest-std-when-using-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-std-when-using-type.stderr (renamed from src/test/ui/suggestions/suggest-std-when-using-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.rs (renamed from src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr (renamed from src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-swapping-self-ty-and-trait.rs (renamed from src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr (renamed from src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-trait-items.rs (renamed from src/test/ui/suggestions/suggest-trait-items.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-trait-items.stderr (renamed from src/test/ui/suggestions/suggest-trait-items.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-tryinto-edition-change.rs (renamed from src/test/ui/suggestions/suggest-tryinto-edition-change.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-tryinto-edition-change.stderr (renamed from src/test/ui/suggestions/suggest-tryinto-edition-change.stderr) | 6 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-using-chars.rs (renamed from src/test/ui/suggestions/suggest-using-chars.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-using-chars.stderr (renamed from src/test/ui/suggestions/suggest-using-chars.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-variants.rs (renamed from src/test/ui/suggestions/suggest-variants.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest-variants.stderr (renamed from src/test/ui/suggestions/suggest-variants.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest_print_over_printf.rs (renamed from src/test/ui/suggestions/suggest_print_over_printf.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/suggest_print_over_printf.stderr (renamed from src/test/ui/suggestions/suggest_print_over_printf.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/too-many-field-suggestions.rs (renamed from src/test/ui/suggestions/too-many-field-suggestions.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/too-many-field-suggestions.stderr (renamed from src/test/ui/suggestions/too-many-field-suggestions.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.fixed (renamed from src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.rs (renamed from src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr (renamed from src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/trait-with-missing-associated-type-restriction.rs (renamed from src/test/ui/suggestions/trait-with-missing-associated-type-restriction.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/trait-with-missing-associated-type-restriction.stderr (renamed from src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr) | 2 | ||||
-rw-r--r-- | tests/ui/suggestions/try-operator-dont-suggest-semicolon.rs (renamed from src/test/ui/suggestions/try-operator-dont-suggest-semicolon.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/try-operator-dont-suggest-semicolon.stderr (renamed from src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/try-removing-the-field.rs (renamed from src/test/ui/suggestions/try-removing-the-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/try-removing-the-field.stderr (renamed from src/test/ui/suggestions/try-removing-the-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-and-other-error.rs (renamed from src/test/ui/suggestions/type-ascription-and-other-error.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-and-other-error.stderr (renamed from src/test/ui/suggestions/type-ascription-and-other-error.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-let.rs (renamed from src/test/ui/suggestions/type-ascription-instead-of-let.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-let.stderr (renamed from src/test/ui/suggestions/type-ascription-instead-of-let.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-method.fixed (renamed from src/test/ui/suggestions/type-ascription-instead-of-method.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-method.rs (renamed from src/test/ui/suggestions/type-ascription-instead-of-method.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-method.stderr (renamed from src/test/ui/suggestions/type-ascription-instead-of-method.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-path-2.fixed (renamed from src/test/ui/suggestions/type-ascription-instead-of-path-2.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-path-2.rs (renamed from src/test/ui/suggestions/type-ascription-instead-of-path-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-path-2.stderr (renamed from src/test/ui/suggestions/type-ascription-instead-of-path-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs (renamed from src/test/ui/suggestions/type-ascription-instead-of-path-in-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr (renamed from src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-path.rs (renamed from src/test/ui/suggestions/type-ascription-instead-of-path.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-path.stderr (renamed from src/test/ui/suggestions/type-ascription-instead-of-path.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-variant.fixed (renamed from src/test/ui/suggestions/type-ascription-instead-of-variant.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-variant.rs (renamed from src/test/ui/suggestions/type-ascription-instead-of-variant.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-ascription-instead-of-variant.stderr (renamed from src/test/ui/suggestions/type-ascription-instead-of-variant.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-mismatch-byte-literal.rs | 18 | ||||
-rw-r--r-- | tests/ui/suggestions/type-mismatch-byte-literal.stderr | 42 | ||||
-rw-r--r-- | tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.rs (renamed from src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr (renamed from src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-mismatch-struct-field-shorthand.fixed (renamed from src/test/ui/suggestions/type-mismatch-struct-field-shorthand.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-mismatch-struct-field-shorthand.rs (renamed from src/test/ui/suggestions/type-mismatch-struct-field-shorthand.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-mismatch-struct-field-shorthand.stderr (renamed from src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-not-found-in-adt-field.rs (renamed from src/test/ui/suggestions/type-not-found-in-adt-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/type-not-found-in-adt-field.stderr (renamed from src/test/ui/suggestions/type-not-found-in-adt-field.stderr) | 7 | ||||
-rw-r--r-- | tests/ui/suggestions/undeclared-module-alloc.rs (renamed from src/test/ui/suggestions/undeclared-module-alloc.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/undeclared-module-alloc.stderr (renamed from src/test/ui/suggestions/undeclared-module-alloc.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/unnamable-types.rs (renamed from src/test/ui/suggestions/unnamable-types.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/unnamable-types.stderr (renamed from src/test/ui/suggestions/unnamable-types.stderr) | 4 | ||||
-rw-r--r-- | tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.rs (renamed from src/test/ui/suggestions/unnecessary_dot_for_floating_point_literal.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr (renamed from src/test/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr) | 4 | ||||
-rw-r--r-- | tests/ui/suggestions/unsized-function-parameter.fixed (renamed from src/test/ui/suggestions/unsized-function-parameter.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/unsized-function-parameter.rs (renamed from src/test/ui/suggestions/unsized-function-parameter.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/unsized-function-parameter.stderr (renamed from src/test/ui/suggestions/unsized-function-parameter.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/unused-closure-argument.rs (renamed from src/test/ui/suggestions/unused-closure-argument.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/unused-closure-argument.stderr (renamed from src/test/ui/suggestions/unused-closure-argument.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-placement-resolve.fixed (renamed from src/test/ui/suggestions/use-placement-resolve.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-placement-resolve.rs (renamed from src/test/ui/suggestions/use-placement-resolve.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-placement-resolve.stderr (renamed from src/test/ui/suggestions/use-placement-resolve.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-placement-typeck.fixed (renamed from src/test/ui/suggestions/use-placement-typeck.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-placement-typeck.rs (renamed from src/test/ui/suggestions/use-placement-typeck.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-placement-typeck.stderr (renamed from src/test/ui/suggestions/use-placement-typeck.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-type-argument-instead-of-assoc-type.rs (renamed from src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr (renamed from src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/while-let-typo.rs (renamed from src/test/ui/suggestions/while-let-typo.rs) | 0 | ||||
-rw-r--r-- | tests/ui/suggestions/while-let-typo.stderr (renamed from src/test/ui/suggestions/while-let-typo.stderr) | 0 |
666 files changed, 3991 insertions, 240 deletions
diff --git a/src/test/ui/suggestions/abi-typo.fixed b/tests/ui/suggestions/abi-typo.fixed index 04d265865..04d265865 100644 --- a/src/test/ui/suggestions/abi-typo.fixed +++ b/tests/ui/suggestions/abi-typo.fixed diff --git a/src/test/ui/suggestions/abi-typo.rs b/tests/ui/suggestions/abi-typo.rs index 6d80db522..6d80db522 100644 --- a/src/test/ui/suggestions/abi-typo.rs +++ b/tests/ui/suggestions/abi-typo.rs diff --git a/src/test/ui/suggestions/abi-typo.stderr b/tests/ui/suggestions/abi-typo.stderr index 67a84f119..67a84f119 100644 --- a/src/test/ui/suggestions/abi-typo.stderr +++ b/tests/ui/suggestions/abi-typo.stderr diff --git a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.rs b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs index ef64d799b..ef64d799b 100644 --- a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.rs +++ b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs diff --git a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr index b77c8c7fd..b77c8c7fd 100644 --- a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr +++ b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr diff --git a/src/test/ui/suggestions/args-instead-of-tuple-errors.rs b/tests/ui/suggestions/args-instead-of-tuple-errors.rs index 5403b8d6d..f5931a1ba 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple-errors.rs +++ b/tests/ui/suggestions/args-instead-of-tuple-errors.rs @@ -6,7 +6,7 @@ fn main() { let _: Option<(i32, bool)> = Some(1, 2); //~^ ERROR this enum variant takes 1 argument but 2 arguments were supplied int_bool(1, 2); - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR function takes 1 argument but 2 arguments were supplied let _: Option<(i8,)> = Some(); //~^ ERROR this enum variant takes 1 argument but 0 arguments were supplied diff --git a/tests/ui/suggestions/args-instead-of-tuple-errors.stderr b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr new file mode 100644 index 000000000..bc097bf6e --- /dev/null +++ b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr @@ -0,0 +1,107 @@ +error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied + --> $DIR/args-instead-of-tuple-errors.rs:6:34 + | +LL | let _: Option<(i32, bool)> = Some(1, 2); + | ^^^^ - argument of type `{integer}` unexpected + | +note: expected tuple, found integer + --> $DIR/args-instead-of-tuple-errors.rs:6:39 + | +LL | let _: Option<(i32, bool)> = Some(1, 2); + | ^ + = note: expected tuple `(i32, bool)` + found type `{integer}` +help: the type constructed contains `{integer}` due to the type of the argument passed + --> $DIR/args-instead-of-tuple-errors.rs:6:34 + | +LL | let _: Option<(i32, bool)> = Some(1, 2); + | ^^^^^-^^^^ + | | + | this argument influences the type of `Some` +note: tuple variant defined here + --> $SRC_DIR/core/src/option.rs:LL:COL +help: remove the extra argument + | +LL | let _: Option<(i32, bool)> = Some(/* (i32, bool) */); + | ~~~~~~~~~~~~~~~~~~~ + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/args-instead-of-tuple-errors.rs:8:5 + | +LL | int_bool(1, 2); + | ^^^^^^^^ - argument of type `{integer}` unexpected + | +note: expected tuple, found integer + --> $DIR/args-instead-of-tuple-errors.rs:8:14 + | +LL | int_bool(1, 2); + | ^ + = note: expected tuple `(i32, bool)` + found type `{integer}` +note: function defined here + --> $DIR/args-instead-of-tuple-errors.rs:21:4 + | +LL | fn int_bool(_: (i32, bool)) { + | ^^^^^^^^ -------------- +help: remove the extra argument + | +LL | int_bool(/* (i32, bool) */); + | ~~~~~~~~~~~~~~~~~~~ + +error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied + --> $DIR/args-instead-of-tuple-errors.rs:11:28 + | +LL | let _: Option<(i8,)> = Some(); + | ^^^^-- an argument of type `(i8,)` is missing + | +note: tuple variant defined here + --> $SRC_DIR/core/src/option.rs:LL:COL +help: provide the argument + | +LL | let _: Option<(i8,)> = Some(/* (i8,) */); + | ~~~~~~~~~~~~~ + +error[E0308]: mismatched types + --> $DIR/args-instead-of-tuple-errors.rs:14:34 + | +LL | let _: Option<(i32,)> = Some(5_usize); + | ---- ^^^^^^^ expected tuple, found `usize` + | | + | arguments to this enum variant are incorrect + | + = note: expected tuple `(i32,)` + found type `usize` +help: the type constructed contains `usize` due to the type of the argument passed + --> $DIR/args-instead-of-tuple-errors.rs:14:29 + | +LL | let _: Option<(i32,)> = Some(5_usize); + | ^^^^^-------^ + | | + | this argument influences the type of `Some` +note: tuple variant defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + +error[E0308]: mismatched types + --> $DIR/args-instead-of-tuple-errors.rs:17:34 + | +LL | let _: Option<(i32,)> = Some((5_usize)); + | ---- ^^^^^^^^^ expected tuple, found `usize` + | | + | arguments to this enum variant are incorrect + | + = note: expected tuple `(i32,)` + found type `usize` +help: the type constructed contains `usize` due to the type of the argument passed + --> $DIR/args-instead-of-tuple-errors.rs:17:29 + | +LL | let _: Option<(i32,)> = Some((5_usize)); + | ^^^^^---------^ + | | + | this argument influences the type of `Some` +note: tuple variant defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0061, E0308. +For more information about an error, try `rustc --explain E0061`. diff --git a/tests/ui/suggestions/args-instead-of-tuple.fixed b/tests/ui/suggestions/args-instead-of-tuple.fixed new file mode 100644 index 000000000..f913995d7 --- /dev/null +++ b/tests/ui/suggestions/args-instead-of-tuple.fixed @@ -0,0 +1,33 @@ +// Test suggesting tuples where bare arguments may have been passed +// See issue #86481 for details. + +// run-rustfix + +fn main() { + let _: Result<(i32, i8), ()> = Ok((1, 2)); + //~^ ERROR enum variant takes 1 argument but 2 arguments were supplied + let _: Option<(i32, i8, &'static str)> = Some((1, 2, "hi")); + //~^ ERROR enum variant takes 1 argument but 3 arguments were supplied + let _: Option<()> = Some(()); + //~^ ERROR enum variant takes 1 argument but 0 arguments were supplied + + let _: Option<(i32,)> = Some((3,)); + //~^ ERROR mismatched types + + let _: Option<(i32,)> = Some((3,)); + //~^ ERROR mismatched types + + two_ints((1, 2)); //~ ERROR function takes 1 argument + + with_generic((3, 4)); //~ ERROR function takes 1 argument +} + +fn two_ints(_: (i32, i32)) { +} + +fn with_generic<T: Copy + Send>((a, b): (i32, T)) { + if false { + // test generics/bound handling + with_generic((a, b)); //~ ERROR function takes 1 argument + } +} diff --git a/tests/ui/suggestions/args-instead-of-tuple.rs b/tests/ui/suggestions/args-instead-of-tuple.rs new file mode 100644 index 000000000..1c65407b3 --- /dev/null +++ b/tests/ui/suggestions/args-instead-of-tuple.rs @@ -0,0 +1,33 @@ +// Test suggesting tuples where bare arguments may have been passed +// See issue #86481 for details. + +// run-rustfix + +fn main() { + let _: Result<(i32, i8), ()> = Ok(1, 2); + //~^ ERROR enum variant takes 1 argument but 2 arguments were supplied + let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi"); + //~^ ERROR enum variant takes 1 argument but 3 arguments were supplied + let _: Option<()> = Some(); + //~^ ERROR enum variant takes 1 argument but 0 arguments were supplied + + let _: Option<(i32,)> = Some(3); + //~^ ERROR mismatched types + + let _: Option<(i32,)> = Some((3)); + //~^ ERROR mismatched types + + two_ints(1, 2); //~ ERROR function takes 1 argument + + with_generic(3, 4); //~ ERROR function takes 1 argument +} + +fn two_ints(_: (i32, i32)) { +} + +fn with_generic<T: Copy + Send>((a, b): (i32, T)) { + if false { + // test generics/bound handling + with_generic(a, b); //~ ERROR function takes 1 argument + } +} diff --git a/src/test/ui/suggestions/args-instead-of-tuple.stderr b/tests/ui/suggestions/args-instead-of-tuple.stderr index 20f9e5259..3ed9dbf4a 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple.stderr +++ b/tests/ui/suggestions/args-instead-of-tuple.stderr @@ -1,4 +1,4 @@ -error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied +error[E0061]: enum variant takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:7:36 | LL | let _: Result<(i32, i8), ()> = Ok(1, 2); @@ -6,15 +6,12 @@ LL | let _: Result<(i32, i8), ()> = Ok(1, 2); | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ help: wrap these arguments in parentheses to construct a tuple | LL | let _: Result<(i32, i8), ()> = Ok((1, 2)); | + + -error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied +error[E0061]: enum variant takes 1 argument but 3 arguments were supplied --> $DIR/args-instead-of-tuple.rs:9:46 | LL | let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi"); @@ -22,9 +19,6 @@ LL | let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi"); | note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: wrap these arguments in parentheses to construct a tuple | LL | let _: Option<(i32, i8, &'static str)> = Some((1, 2, "hi")); @@ -38,9 +32,6 @@ LL | let _: Option<()> = Some(); | note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: provide the argument | LL | let _: Option<()> = Some(()); @@ -58,9 +49,6 @@ LL | let _: Option<(i32,)> = Some(3); found type `{integer}` note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: use a trailing comma to create a tuple with one element | LL | let _: Option<(i32,)> = Some((3,)); @@ -78,15 +66,12 @@ LL | let _: Option<(i32,)> = Some((3)); found type `{integer}` note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: use a trailing comma to create a tuple with one element | LL | let _: Option<(i32,)> = Some((3,)); | + -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: function takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:20:5 | LL | two_ints(1, 2); @@ -102,7 +87,7 @@ help: wrap these arguments in parentheses to construct a tuple LL | two_ints((1, 2)); | + + -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: function takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:22:5 | LL | with_generic(3, 4); @@ -118,7 +103,7 @@ help: wrap these arguments in parentheses to construct a tuple LL | with_generic((3, 4)); | + + -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: function takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:31:9 | LL | with_generic(a, b); diff --git a/src/test/ui/suggestions/as-ref-2.rs b/tests/ui/suggestions/as-ref-2.rs index b22f409b4..b22f409b4 100644 --- a/src/test/ui/suggestions/as-ref-2.rs +++ b/tests/ui/suggestions/as-ref-2.rs diff --git a/src/test/ui/suggestions/as-ref-2.stderr b/tests/ui/suggestions/as-ref-2.stderr index e15e45d86..e2129b450 100644 --- a/src/test/ui/suggestions/as-ref-2.stderr +++ b/tests/ui/suggestions/as-ref-2.stderr @@ -10,11 +10,8 @@ LL | let _x: Option<Struct> = foo.map(|s| bar(&s)); LL | let _y = foo; | ^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `foo` +note: `Option::<T>::map` takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub const fn map<U, F>(self, f: F) -> Option<U> - | ^^^^ error: aborting due to previous error diff --git a/src/test/ui/suggestions/as-ref.rs b/tests/ui/suggestions/as-ref.rs index a05353441..a05353441 100644 --- a/src/test/ui/suggestions/as-ref.rs +++ b/tests/ui/suggestions/as-ref.rs diff --git a/src/test/ui/suggestions/as-ref.stderr b/tests/ui/suggestions/as-ref.stderr index deafa9f48..deafa9f48 100644 --- a/src/test/ui/suggestions/as-ref.stderr +++ b/tests/ui/suggestions/as-ref.stderr diff --git a/src/test/ui/suggestions/assoc-const-as-field.rs b/tests/ui/suggestions/assoc-const-as-field.rs index 678b58936..678b58936 100644 --- a/src/test/ui/suggestions/assoc-const-as-field.rs +++ b/tests/ui/suggestions/assoc-const-as-field.rs diff --git a/src/test/ui/suggestions/assoc-const-as-field.stderr b/tests/ui/suggestions/assoc-const-as-field.stderr index 78e5634b2..78e5634b2 100644 --- a/src/test/ui/suggestions/assoc-const-as-field.stderr +++ b/tests/ui/suggestions/assoc-const-as-field.stderr diff --git a/src/test/ui/suggestions/assoc-const-as-fn.rs b/tests/ui/suggestions/assoc-const-as-fn.rs index 4b4595dd5..4b4595dd5 100644 --- a/src/test/ui/suggestions/assoc-const-as-fn.rs +++ b/tests/ui/suggestions/assoc-const-as-fn.rs diff --git a/src/test/ui/suggestions/assoc-const-as-fn.stderr b/tests/ui/suggestions/assoc-const-as-fn.stderr index 3b6e947c5..3b6e947c5 100644 --- a/src/test/ui/suggestions/assoc-const-as-fn.stderr +++ b/tests/ui/suggestions/assoc-const-as-fn.stderr diff --git a/tests/ui/suggestions/assoc-ct-for-assoc-method.rs b/tests/ui/suggestions/assoc-ct-for-assoc-method.rs new file mode 100644 index 000000000..fe2227769 --- /dev/null +++ b/tests/ui/suggestions/assoc-ct-for-assoc-method.rs @@ -0,0 +1,25 @@ +struct MyS; + +impl MyS { + const FOO: i32 = 1; + fn foo() -> MyS { + MyS + } +} + +fn main() { + let x: i32 = MyS::foo; + //~^ ERROR mismatched types + //~| HELP try referring to the + + let z: i32 = i32::max; + //~^ ERROR mismatched types + //~| HELP try referring to the + + // This example is still broken though... This is a hard suggestion to make, + // because we don't have access to the associated const probing code to make + // this suggestion where it's emitted, i.e. in trait selection. + let y: i32 = i32::max - 42; + //~^ ERROR cannot subtract + //~| HELP use parentheses +} diff --git a/tests/ui/suggestions/assoc-ct-for-assoc-method.stderr b/tests/ui/suggestions/assoc-ct-for-assoc-method.stderr new file mode 100644 index 000000000..afef38f12 --- /dev/null +++ b/tests/ui/suggestions/assoc-ct-for-assoc-method.stderr @@ -0,0 +1,47 @@ +error[E0308]: mismatched types + --> $DIR/assoc-ct-for-assoc-method.rs:11:18 + | +LL | let x: i32 = MyS::foo; + | --- ^^^^^^^^ expected `i32`, found fn item + | | + | expected due to this + | + = note: expected type `i32` + found fn item `fn() -> MyS {MyS::foo}` +help: try referring to the associated const `FOO` instead + | +LL | let x: i32 = MyS::FOO; + | ~~~ + +error[E0308]: mismatched types + --> $DIR/assoc-ct-for-assoc-method.rs:15:18 + | +LL | let z: i32 = i32::max; + | --- ^^^^^^^^ expected `i32`, found fn item + | | + | expected due to this + | + = note: expected type `i32` + found fn item `fn(i32, i32) -> i32 {<i32 as Ord>::max}` +help: try referring to the associated const `MAX` instead + | +LL | let z: i32 = i32::MAX; + | ~~~ + +error[E0369]: cannot subtract `{integer}` from `fn(i32, i32) -> i32 {<i32 as Ord>::max}` + --> $DIR/assoc-ct-for-assoc-method.rs:22:27 + | +LL | let y: i32 = i32::max - 42; + | -------- ^ -- {integer} + | | + | fn(i32, i32) -> i32 {<i32 as Ord>::max} + | +help: use parentheses to call this associated function + | +LL | let y: i32 = i32::max(/* i32 */, /* i32 */) - 42; + | ++++++++++++++++++++++ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0308, E0369. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/assoc-type-in-method-return.rs b/tests/ui/suggestions/assoc-type-in-method-return.rs index 9bde65998..9bde65998 100644 --- a/src/test/ui/suggestions/assoc-type-in-method-return.rs +++ b/tests/ui/suggestions/assoc-type-in-method-return.rs diff --git a/src/test/ui/suggestions/assoc-type-in-method-return.stderr b/tests/ui/suggestions/assoc-type-in-method-return.stderr index 202e4a16e..202e4a16e 100644 --- a/src/test/ui/suggestions/assoc-type-in-method-return.stderr +++ b/tests/ui/suggestions/assoc-type-in-method-return.stderr diff --git a/src/test/ui/suggestions/assoc_fn_without_self.rs b/tests/ui/suggestions/assoc_fn_without_self.rs index 778d98477..778d98477 100644 --- a/src/test/ui/suggestions/assoc_fn_without_self.rs +++ b/tests/ui/suggestions/assoc_fn_without_self.rs diff --git a/src/test/ui/suggestions/assoc_fn_without_self.stderr b/tests/ui/suggestions/assoc_fn_without_self.stderr index febdd6733..febdd6733 100644 --- a/src/test/ui/suggestions/assoc_fn_without_self.stderr +++ b/tests/ui/suggestions/assoc_fn_without_self.stderr diff --git a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs b/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs index 156162c90..156162c90 100644 --- a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs +++ b/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs diff --git a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr index 8ed62f854..8ed62f854 100644 --- a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr +++ b/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr diff --git a/src/test/ui/suggestions/attribute-typos.rs b/tests/ui/suggestions/attribute-typos.rs index 7c8231bbb..7c8231bbb 100644 --- a/src/test/ui/suggestions/attribute-typos.rs +++ b/tests/ui/suggestions/attribute-typos.rs diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/tests/ui/suggestions/attribute-typos.stderr index 54122cb73..b871c9b45 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/tests/ui/suggestions/attribute-typos.stderr @@ -15,11 +15,9 @@ error: cannot find attribute `tests` in this scope | LL | #[tests] | ^^^^^ help: an attribute macro with a similar name exists: `test` + --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | pub macro test($item:item) { - | -------------- similarly named attribute macro `test` defined here + = note: similarly named attribute macro `test` defined here error: cannot find attribute `deprcated` in this scope --> $DIR/attribute-typos.rs:1:3 diff --git a/src/test/ui/suggestions/auxiliary/foo.rs b/tests/ui/suggestions/auxiliary/foo.rs index e90bbef6d..e90bbef6d 100644 --- a/src/test/ui/suggestions/auxiliary/foo.rs +++ b/tests/ui/suggestions/auxiliary/foo.rs diff --git a/src/test/ui/suggestions/auxiliary/issue-61963-1.rs b/tests/ui/suggestions/auxiliary/issue-61963-1.rs index 6c2df7e84..6c2df7e84 100644 --- a/src/test/ui/suggestions/auxiliary/issue-61963-1.rs +++ b/tests/ui/suggestions/auxiliary/issue-61963-1.rs diff --git a/src/test/ui/suggestions/auxiliary/issue-61963.rs b/tests/ui/suggestions/auxiliary/issue-61963.rs index e86f1610a..e86f1610a 100644 --- a/src/test/ui/suggestions/auxiliary/issue-61963.rs +++ b/tests/ui/suggestions/auxiliary/issue-61963.rs diff --git a/src/test/ui/suggestions/auxiliary/issue-81839.rs b/tests/ui/suggestions/auxiliary/issue-81839.rs index 5683c45ad..5683c45ad 100644 --- a/src/test/ui/suggestions/auxiliary/issue-81839.rs +++ b/tests/ui/suggestions/auxiliary/issue-81839.rs diff --git a/src/test/ui/suggestions/auxiliary/meow.rs b/tests/ui/suggestions/auxiliary/meow.rs index 115df70a6..115df70a6 100644 --- a/src/test/ui/suggestions/auxiliary/meow.rs +++ b/tests/ui/suggestions/auxiliary/meow.rs diff --git a/src/test/ui/suggestions/auxiliary/not-object-safe.rs b/tests/ui/suggestions/auxiliary/not-object-safe.rs index 7c9829b82..7c9829b82 100644 --- a/src/test/ui/suggestions/auxiliary/not-object-safe.rs +++ b/tests/ui/suggestions/auxiliary/not-object-safe.rs diff --git a/src/test/ui/suggestions/auxiliary/proc-macro-type-error.rs b/tests/ui/suggestions/auxiliary/proc-macro-type-error.rs index d71747f96..d71747f96 100644 --- a/src/test/ui/suggestions/auxiliary/proc-macro-type-error.rs +++ b/tests/ui/suggestions/auxiliary/proc-macro-type-error.rs diff --git a/tests/ui/suggestions/bad-hex-float-lit.rs b/tests/ui/suggestions/bad-hex-float-lit.rs new file mode 100644 index 000000000..cd6fdbde9 --- /dev/null +++ b/tests/ui/suggestions/bad-hex-float-lit.rs @@ -0,0 +1,13 @@ +fn main() { + let _f: f32 = 0xAAf32; + //~^ ERROR mismatched types + //~| HELP rewrite this + + let _f: f32 = 0xAB_f32; + //~^ ERROR mismatched types + //~| HELP rewrite this + + let _f: f64 = 0xFF_f64; + //~^ ERROR mismatched types + //~| HELP rewrite this +} diff --git a/tests/ui/suggestions/bad-hex-float-lit.stderr b/tests/ui/suggestions/bad-hex-float-lit.stderr new file mode 100644 index 000000000..bc09abb1a --- /dev/null +++ b/tests/ui/suggestions/bad-hex-float-lit.stderr @@ -0,0 +1,48 @@ +error[E0308]: mismatched types + --> $DIR/bad-hex-float-lit.rs:2:19 + | +LL | let _f: f32 = 0xAAf32; + | --- ^^^^^^^ expected `f32`, found integer + | | + | expected due to this + | +help: rewrite this as a decimal floating point literal, or use `as` to turn a hex literal into a float + | +LL | let _f: f32 = 0xAA as f32; + | ~~~~~~~~~~~ +LL | let _f: f32 = 170_f32; + | ~~~~~~~ + +error[E0308]: mismatched types + --> $DIR/bad-hex-float-lit.rs:6:19 + | +LL | let _f: f32 = 0xAB_f32; + | --- ^^^^^^^^ expected `f32`, found integer + | | + | expected due to this + | +help: rewrite this as a decimal floating point literal, or use `as` to turn a hex literal into a float + | +LL | let _f: f32 = 0xAB as f32; + | ~~~~~~~~~~~ +LL | let _f: f32 = 171_f32; + | ~~~~~~~ + +error[E0308]: mismatched types + --> $DIR/bad-hex-float-lit.rs:10:19 + | +LL | let _f: f64 = 0xFF_f64; + | --- ^^^^^^^^ expected `f64`, found integer + | | + | expected due to this + | +help: rewrite this as a decimal floating point literal, or use `as` to turn a hex literal into a float + | +LL | let _f: f64 = 0xFF as f64; + | ~~~~~~~~~~~ +LL | let _f: f64 = 255_f64; + | ~~~~~~~ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/bool_typo_err_suggest.rs b/tests/ui/suggestions/bool_typo_err_suggest.rs index deab0fb05..deab0fb05 100644 --- a/src/test/ui/suggestions/bool_typo_err_suggest.rs +++ b/tests/ui/suggestions/bool_typo_err_suggest.rs diff --git a/src/test/ui/suggestions/bool_typo_err_suggest.stderr b/tests/ui/suggestions/bool_typo_err_suggest.stderr index 52bde07ca..52bde07ca 100644 --- a/src/test/ui/suggestions/bool_typo_err_suggest.stderr +++ b/tests/ui/suggestions/bool_typo_err_suggest.stderr diff --git a/src/test/ui/suggestions/borrow-for-loop-head.rs b/tests/ui/suggestions/borrow-for-loop-head.rs index c2bda55e5..c2bda55e5 100644 --- a/src/test/ui/suggestions/borrow-for-loop-head.rs +++ b/tests/ui/suggestions/borrow-for-loop-head.rs diff --git a/src/test/ui/suggestions/borrow-for-loop-head.stderr b/tests/ui/suggestions/borrow-for-loop-head.stderr index 0cc8994fe..cbdb94877 100644 --- a/src/test/ui/suggestions/borrow-for-loop-head.stderr +++ b/tests/ui/suggestions/borrow-for-loop-head.stderr @@ -16,11 +16,8 @@ LL | for i in &a { LL | for j in a { | ^ `a` moved due to this implicit call to `.into_iter()`, in previous iteration of loop | -note: this function takes ownership of the receiver `self`, which moves `a` +note: `into_iter` takes ownership of the receiver `self`, which moves `a` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec<i32>`'s content to avoid moving into the `for` loop | LL | for j in &a { diff --git a/src/test/ui/suggestions/bound-suggestions.fixed b/tests/ui/suggestions/bound-suggestions.fixed index 17a019c69..17a019c69 100644 --- a/src/test/ui/suggestions/bound-suggestions.fixed +++ b/tests/ui/suggestions/bound-suggestions.fixed diff --git a/src/test/ui/suggestions/bound-suggestions.rs b/tests/ui/suggestions/bound-suggestions.rs index 86f708d42..86f708d42 100644 --- a/src/test/ui/suggestions/bound-suggestions.rs +++ b/tests/ui/suggestions/bound-suggestions.rs diff --git a/src/test/ui/suggestions/bound-suggestions.stderr b/tests/ui/suggestions/bound-suggestions.stderr index d53715937..cd27947f0 100644 --- a/src/test/ui/suggestions/bound-suggestions.stderr +++ b/tests/ui/suggestions/bound-suggestions.stderr @@ -78,9 +78,6 @@ LL | const SIZE: usize = core::mem::size_of::<Self>(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of<T>() -> usize { - | ^ required by this bound in `std::mem::size_of` help: consider further restricting `Self` | LL | trait Foo<T>: Sized { @@ -94,9 +91,6 @@ LL | const SIZE: usize = core::mem::size_of::<Self>(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of<T>() -> usize { - | ^ required by this bound in `std::mem::size_of` help: consider further restricting `Self` | LL | trait Bar: std::fmt::Display + Sized { @@ -110,9 +104,6 @@ LL | const SIZE: usize = core::mem::size_of::<Self>(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of<T>() -> usize { - | ^ required by this bound in `std::mem::size_of` help: consider further restricting `Self` | LL | trait Baz: Sized where Self: std::fmt::Display { @@ -126,9 +117,6 @@ LL | const SIZE: usize = core::mem::size_of::<Self>(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of<T>() -> usize { - | ^ required by this bound in `std::mem::size_of` help: consider further restricting `Self` | LL | trait Qux<T>: Sized where Self: std::fmt::Display { @@ -142,9 +130,6 @@ LL | const SIZE: usize = core::mem::size_of::<Self>(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of<T>() -> usize { - | ^ required by this bound in `std::mem::size_of` help: consider further restricting `Self` | LL | trait Bat<T>: std::fmt::Display + Sized { diff --git a/src/test/ui/suggestions/box-future-wrong-output.rs b/tests/ui/suggestions/box-future-wrong-output.rs index d49819fcb..d49819fcb 100644 --- a/src/test/ui/suggestions/box-future-wrong-output.rs +++ b/tests/ui/suggestions/box-future-wrong-output.rs diff --git a/src/test/ui/suggestions/box-future-wrong-output.stderr b/tests/ui/suggestions/box-future-wrong-output.stderr index e0c57af25..e0c57af25 100644 --- a/src/test/ui/suggestions/box-future-wrong-output.stderr +++ b/tests/ui/suggestions/box-future-wrong-output.stderr diff --git a/src/test/ui/suggestions/boxed-variant-field.rs b/tests/ui/suggestions/boxed-variant-field.rs index 6050963c4..6050963c4 100644 --- a/src/test/ui/suggestions/boxed-variant-field.rs +++ b/tests/ui/suggestions/boxed-variant-field.rs diff --git a/src/test/ui/suggestions/boxed-variant-field.stderr b/tests/ui/suggestions/boxed-variant-field.stderr index 9ae36a06a..9ae36a06a 100644 --- a/src/test/ui/suggestions/boxed-variant-field.stderr +++ b/tests/ui/suggestions/boxed-variant-field.stderr diff --git a/src/test/ui/suggestions/call-boxed.rs b/tests/ui/suggestions/call-boxed.rs index d19e4596a..d19e4596a 100644 --- a/src/test/ui/suggestions/call-boxed.rs +++ b/tests/ui/suggestions/call-boxed.rs diff --git a/src/test/ui/suggestions/call-boxed.stderr b/tests/ui/suggestions/call-boxed.stderr index 9b619ac9a..9b619ac9a 100644 --- a/src/test/ui/suggestions/call-boxed.stderr +++ b/tests/ui/suggestions/call-boxed.stderr diff --git a/src/test/ui/suggestions/call-on-missing.rs b/tests/ui/suggestions/call-on-missing.rs index 25ced84dd..25ced84dd 100644 --- a/src/test/ui/suggestions/call-on-missing.rs +++ b/tests/ui/suggestions/call-on-missing.rs diff --git a/src/test/ui/suggestions/call-on-missing.stderr b/tests/ui/suggestions/call-on-missing.stderr index ca9abc7e9..ca9abc7e9 100644 --- a/src/test/ui/suggestions/call-on-missing.stderr +++ b/tests/ui/suggestions/call-on-missing.stderr diff --git a/src/test/ui/suggestions/call-on-unimplemented-ctor.rs b/tests/ui/suggestions/call-on-unimplemented-ctor.rs index 5f811044e..5f811044e 100644 --- a/src/test/ui/suggestions/call-on-unimplemented-ctor.rs +++ b/tests/ui/suggestions/call-on-unimplemented-ctor.rs diff --git a/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr b/tests/ui/suggestions/call-on-unimplemented-ctor.stderr index 58612cbfb..58612cbfb 100644 --- a/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr +++ b/tests/ui/suggestions/call-on-unimplemented-ctor.stderr diff --git a/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs b/tests/ui/suggestions/call-on-unimplemented-fn-ptr.rs index 86490c724..86490c724 100644 --- a/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs +++ b/tests/ui/suggestions/call-on-unimplemented-fn-ptr.rs diff --git a/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.stderr b/tests/ui/suggestions/call-on-unimplemented-fn-ptr.stderr index 167f7e592..167f7e592 100644 --- a/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.stderr +++ b/tests/ui/suggestions/call-on-unimplemented-fn-ptr.stderr diff --git a/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs b/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs new file mode 100644 index 000000000..9021dd752 --- /dev/null +++ b/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs @@ -0,0 +1,13 @@ +trait Foo {} + +impl Foo for i32 {} + +fn needs_foo(_: impl Foo) {} + +fn test(x: &Box<dyn Fn() -> i32>) { + needs_foo(x); + //~^ ERROR the trait bound + //~| HELP use parentheses to call this trait object +} + +fn main() {} diff --git a/tests/ui/suggestions/call-on-unimplemented-with-autoderef.stderr b/tests/ui/suggestions/call-on-unimplemented-with-autoderef.stderr new file mode 100644 index 000000000..90f44cce0 --- /dev/null +++ b/tests/ui/suggestions/call-on-unimplemented-with-autoderef.stderr @@ -0,0 +1,21 @@ +error[E0277]: the trait bound `&Box<dyn Fn() -> i32>: Foo` is not satisfied + --> $DIR/call-on-unimplemented-with-autoderef.rs:8:15 + | +LL | needs_foo(x); + | --------- ^ the trait `Foo` is not implemented for `&Box<dyn Fn() -> i32>` + | | + | required by a bound introduced by this call + | +note: required by a bound in `needs_foo` + --> $DIR/call-on-unimplemented-with-autoderef.rs:5:22 + | +LL | fn needs_foo(_: impl Foo) {} + | ^^^ required by this bound in `needs_foo` +help: use parentheses to call this trait object + | +LL | needs_foo(x()); + | ++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/suggestions/chain-method-call-mutation-in-place.rs b/tests/ui/suggestions/chain-method-call-mutation-in-place.rs index cb92ab87a..cb92ab87a 100644 --- a/src/test/ui/suggestions/chain-method-call-mutation-in-place.rs +++ b/tests/ui/suggestions/chain-method-call-mutation-in-place.rs diff --git a/src/test/ui/suggestions/chain-method-call-mutation-in-place.stderr b/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr index 965dbb967..965dbb967 100644 --- a/src/test/ui/suggestions/chain-method-call-mutation-in-place.stderr +++ b/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr diff --git a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed new file mode 100644 index 000000000..4f9e93a47 --- /dev/null +++ b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed @@ -0,0 +1,16 @@ +// run-rustfix +fn wat<T: Clone>(t: &T) -> T { + t.clone() //~ ERROR E0308 +} + +#[derive(Clone)] +struct Foo; + +fn wut(t: &Foo) -> Foo { + t.clone() //~ ERROR E0308 +} + +fn main() { + wat(&42); + wut(&Foo); +} diff --git a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.rs b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.rs new file mode 100644 index 000000000..89b077d67 --- /dev/null +++ b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.rs @@ -0,0 +1,15 @@ +// run-rustfix +fn wat<T>(t: &T) -> T { + t.clone() //~ ERROR E0308 +} + +struct Foo; + +fn wut(t: &Foo) -> Foo { + t.clone() //~ ERROR E0308 +} + +fn main() { + wat(&42); + wut(&Foo); +} diff --git a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr new file mode 100644 index 000000000..26ab515d9 --- /dev/null +++ b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr @@ -0,0 +1,43 @@ +error[E0308]: mismatched types + --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:3:5 + | +LL | fn wat<T>(t: &T) -> T { + | - - expected `T` because of return type + | | + | this type parameter +LL | t.clone() + | ^^^^^^^^^ expected type parameter `T`, found `&T` + | + = note: expected type parameter `T` + found reference `&T` +note: `T` does not implement `Clone`, so `&T` was cloned instead + --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:3:5 + | +LL | t.clone() + | ^ +help: consider restricting type parameter `T` + | +LL | fn wat<T: Clone>(t: &T) -> T { + | +++++++ + +error[E0308]: mismatched types + --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:9:5 + | +LL | fn wut(t: &Foo) -> Foo { + | --- expected `Foo` because of return type +LL | t.clone() + | ^^^^^^^^^ expected struct `Foo`, found `&Foo` + | +note: `Foo` does not implement `Clone`, so `&Foo` was cloned instead + --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:9:5 + | +LL | t.clone() + | ^ +help: consider annotating `Foo` with `#[derive(Clone)]` + | +LL | #[derive(Clone)] + | + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/const-in-struct-pat.rs b/tests/ui/suggestions/const-in-struct-pat.rs index 1cbba9354..1cbba9354 100644 --- a/src/test/ui/suggestions/const-in-struct-pat.rs +++ b/tests/ui/suggestions/const-in-struct-pat.rs diff --git a/src/test/ui/suggestions/const-in-struct-pat.stderr b/tests/ui/suggestions/const-in-struct-pat.stderr index c8b93f3dc..c8b93f3dc 100644 --- a/src/test/ui/suggestions/const-in-struct-pat.stderr +++ b/tests/ui/suggestions/const-in-struct-pat.stderr diff --git a/src/test/ui/suggestions/const-no-type.rs b/tests/ui/suggestions/const-no-type.rs index c6fdcdadb..c6fdcdadb 100644 --- a/src/test/ui/suggestions/const-no-type.rs +++ b/tests/ui/suggestions/const-no-type.rs diff --git a/src/test/ui/suggestions/const-no-type.stderr b/tests/ui/suggestions/const-no-type.stderr index bd703992f..bd703992f 100644 --- a/src/test/ui/suggestions/const-no-type.stderr +++ b/tests/ui/suggestions/const-no-type.stderr diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs new file mode 100644 index 000000000..15f08486f --- /dev/null +++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs @@ -0,0 +1,11 @@ +fn main() { + let A = 3; + //~^ ERROR refutable pattern in local binding + //~| patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered + //~| missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable + //~| HELP introduce a variable instead + //~| SUGGESTION a_var + + const A: i32 = 2; + //~^ constant defined here +} diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr new file mode 100644 index 000000000..1c1cab25f --- /dev/null +++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr @@ -0,0 +1,18 @@ +error[E0005]: refutable pattern in local binding + --> $DIR/const-pat-non-exaustive-let-new-var.rs:2:9 + | +LL | let A = 3; + | ^ + | | + | patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered + | missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable + | help: introduce a variable instead: `a_var` +... +LL | const A: i32 = 2; + | ------------ constant defined here + | + = note: the matched value is of type `i32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/suggestions/constrain-suggest-ice.rs b/tests/ui/suggestions/constrain-suggest-ice.rs index 69b874bed..69b874bed 100644 --- a/src/test/ui/suggestions/constrain-suggest-ice.rs +++ b/tests/ui/suggestions/constrain-suggest-ice.rs diff --git a/src/test/ui/suggestions/constrain-suggest-ice.stderr b/tests/ui/suggestions/constrain-suggest-ice.stderr index 477eb2786..2af7c2f69 100644 --- a/src/test/ui/suggestions/constrain-suggest-ice.stderr +++ b/tests/ui/suggestions/constrain-suggest-ice.stderr @@ -24,16 +24,7 @@ error[E0425]: cannot find value `F` in this scope --> $DIR/constrain-suggest-ice.rs:6:9 | LL | F - | ^ - | -help: a local variable with a similar name exists - | -LL | x - | ~ -help: you might be missing a type parameter - | -LL | struct Bug<S, F>{ - | +++ + | ^ help: a local variable with a similar name exists: `x` error: generic `Self` types are currently not permitted in anonymous constants --> $DIR/constrain-suggest-ice.rs:3:21 diff --git a/src/test/ui/suggestions/constrain-trait.fixed b/tests/ui/suggestions/constrain-trait.fixed index f292f27f0..f292f27f0 100644 --- a/src/test/ui/suggestions/constrain-trait.fixed +++ b/tests/ui/suggestions/constrain-trait.fixed diff --git a/src/test/ui/suggestions/constrain-trait.rs b/tests/ui/suggestions/constrain-trait.rs index 99ccf7a7f..99ccf7a7f 100644 --- a/src/test/ui/suggestions/constrain-trait.rs +++ b/tests/ui/suggestions/constrain-trait.rs diff --git a/src/test/ui/suggestions/constrain-trait.stderr b/tests/ui/suggestions/constrain-trait.stderr index a26f86917..a26f86917 100644 --- a/src/test/ui/suggestions/constrain-trait.stderr +++ b/tests/ui/suggestions/constrain-trait.stderr diff --git a/src/test/ui/suggestions/copied-and-cloned.fixed b/tests/ui/suggestions/copied-and-cloned.fixed index f801403fe..f801403fe 100644 --- a/src/test/ui/suggestions/copied-and-cloned.fixed +++ b/tests/ui/suggestions/copied-and-cloned.fixed diff --git a/src/test/ui/suggestions/copied-and-cloned.rs b/tests/ui/suggestions/copied-and-cloned.rs index 640450b76..640450b76 100644 --- a/src/test/ui/suggestions/copied-and-cloned.rs +++ b/tests/ui/suggestions/copied-and-cloned.rs diff --git a/src/test/ui/suggestions/copied-and-cloned.stderr b/tests/ui/suggestions/copied-and-cloned.stderr index a6336281b..a6336281b 100644 --- a/src/test/ui/suggestions/copied-and-cloned.stderr +++ b/tests/ui/suggestions/copied-and-cloned.stderr diff --git a/src/test/ui/suggestions/core-std-import-order-issue-83564.rs b/tests/ui/suggestions/core-std-import-order-issue-83564.rs index b7fe5af7b..b7fe5af7b 100644 --- a/src/test/ui/suggestions/core-std-import-order-issue-83564.rs +++ b/tests/ui/suggestions/core-std-import-order-issue-83564.rs diff --git a/src/test/ui/suggestions/core-std-import-order-issue-83564.stderr b/tests/ui/suggestions/core-std-import-order-issue-83564.stderr index e4e1fc591..e4e1fc591 100644 --- a/src/test/ui/suggestions/core-std-import-order-issue-83564.stderr +++ b/tests/ui/suggestions/core-std-import-order-issue-83564.stderr diff --git a/src/test/ui/suggestions/count2len.rs b/tests/ui/suggestions/count2len.rs index f11a789ef..f11a789ef 100644 --- a/src/test/ui/suggestions/count2len.rs +++ b/tests/ui/suggestions/count2len.rs diff --git a/src/test/ui/suggestions/count2len.stderr b/tests/ui/suggestions/count2len.stderr index 6394a84dd..6394a84dd 100644 --- a/src/test/ui/suggestions/count2len.stderr +++ b/tests/ui/suggestions/count2len.stderr diff --git a/src/test/ui/suggestions/crate-or-module-typo.rs b/tests/ui/suggestions/crate-or-module-typo.rs index 2471b11c6..2471b11c6 100644 --- a/src/test/ui/suggestions/crate-or-module-typo.rs +++ b/tests/ui/suggestions/crate-or-module-typo.rs diff --git a/src/test/ui/suggestions/crate-or-module-typo.stderr b/tests/ui/suggestions/crate-or-module-typo.stderr index 98b88b4fb..98b88b4fb 100644 --- a/src/test/ui/suggestions/crate-or-module-typo.stderr +++ b/tests/ui/suggestions/crate-or-module-typo.stderr diff --git a/src/test/ui/suggestions/deref-path-method.rs b/tests/ui/suggestions/deref-path-method.rs index 0281cdb6b..0281cdb6b 100644 --- a/src/test/ui/suggestions/deref-path-method.rs +++ b/tests/ui/suggestions/deref-path-method.rs diff --git a/src/test/ui/suggestions/deref-path-method.stderr b/tests/ui/suggestions/deref-path-method.stderr index 1cc37d611..1cc37d611 100644 --- a/src/test/ui/suggestions/deref-path-method.stderr +++ b/tests/ui/suggestions/deref-path-method.stderr diff --git a/src/test/ui/suggestions/derive-clone-for-eq.fixed b/tests/ui/suggestions/derive-clone-for-eq.fixed index f07784d53..f07784d53 100644 --- a/src/test/ui/suggestions/derive-clone-for-eq.fixed +++ b/tests/ui/suggestions/derive-clone-for-eq.fixed diff --git a/src/test/ui/suggestions/derive-clone-for-eq.rs b/tests/ui/suggestions/derive-clone-for-eq.rs index 15c0d4659..15c0d4659 100644 --- a/src/test/ui/suggestions/derive-clone-for-eq.rs +++ b/tests/ui/suggestions/derive-clone-for-eq.rs diff --git a/src/test/ui/suggestions/derive-clone-for-eq.stderr b/tests/ui/suggestions/derive-clone-for-eq.stderr index 0645f0cdd..9d843c251 100644 --- a/src/test/ui/suggestions/derive-clone-for-eq.stderr +++ b/tests/ui/suggestions/derive-clone-for-eq.stderr @@ -8,12 +8,11 @@ note: required for `Struct<T>` to implement `PartialEq` --> $DIR/derive-clone-for-eq.rs:9:19 | LL | impl<T: Clone, U> PartialEq<U> for Struct<T> - | ^^^^^^^^^^^^ ^^^^^^^^^ + | ----- ^^^^^^^^^^^^ ^^^^^^^^^ + | | + | unsatisfied trait bound introduced here note: required by a bound in `Eq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub trait Eq: PartialEq<Self> { - | ^^^^^^^^^^^^^^^ required by this bound in `Eq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | diff --git a/src/test/ui/suggestions/derive-macro-missing-bounds.rs b/tests/ui/suggestions/derive-macro-missing-bounds.rs index 56c218f97..56c218f97 100644 --- a/src/test/ui/suggestions/derive-macro-missing-bounds.rs +++ b/tests/ui/suggestions/derive-macro-missing-bounds.rs diff --git a/src/test/ui/suggestions/derive-macro-missing-bounds.stderr b/tests/ui/suggestions/derive-macro-missing-bounds.stderr index b9f773965..79036279d 100644 --- a/src/test/ui/suggestions/derive-macro-missing-bounds.stderr +++ b/tests/ui/suggestions/derive-macro-missing-bounds.stderr @@ -30,7 +30,9 @@ note: required for `c::Inner<T>` to implement `Debug` --> $DIR/derive-macro-missing-bounds.rs:34:28 | LL | impl<T: Debug + Trait> Debug for Inner<T> { - | ^^^^^ ^^^^^^^^ + | ----- ^^^^^ ^^^^^^^^ + | | + | unsatisfied trait bound introduced here = note: 1 redundant requirement hidden = note: required for `&c::Inner<T>` to implement `Debug` = note: required for the cast from `&c::Inner<T>` to the object type `dyn Debug` @@ -52,7 +54,7 @@ note: required for `d::Inner<T>` to implement `Debug` --> $DIR/derive-macro-missing-bounds.rs:49:13 | LL | impl<T> Debug for Inner<T> where T: Debug, T: Trait { - | ^^^^^ ^^^^^^^^ + | ^^^^^ ^^^^^^^^ ----- unsatisfied trait bound introduced here = note: 1 redundant requirement hidden = note: required for `&d::Inner<T>` to implement `Debug` = note: required for the cast from `&d::Inner<T>` to the object type `dyn Debug` @@ -74,7 +76,7 @@ note: required for `e::Inner<T>` to implement `Debug` --> $DIR/derive-macro-missing-bounds.rs:64:13 | LL | impl<T> Debug for Inner<T> where T: Debug + Trait { - | ^^^^^ ^^^^^^^^ + | ^^^^^ ^^^^^^^^ ----- unsatisfied trait bound introduced here = note: 1 redundant requirement hidden = note: required for `&e::Inner<T>` to implement `Debug` = note: required for the cast from `&e::Inner<T>` to the object type `dyn Debug` @@ -96,7 +98,7 @@ note: required for `f::Inner<T>` to implement `Debug` --> $DIR/derive-macro-missing-bounds.rs:79:20 | LL | impl<T: Debug> Debug for Inner<T> where T: Trait { - | ^^^^^ ^^^^^^^^ + | ^^^^^ ^^^^^^^^ ----- unsatisfied trait bound introduced here = note: 1 redundant requirement hidden = note: required for `&f::Inner<T>` to implement `Debug` = note: required for the cast from `&f::Inner<T>` to the object type `dyn Debug` diff --git a/src/test/ui/suggestions/derive-trait-for-method-call.rs b/tests/ui/suggestions/derive-trait-for-method-call.rs index 25043da52..25043da52 100644 --- a/src/test/ui/suggestions/derive-trait-for-method-call.rs +++ b/tests/ui/suggestions/derive-trait-for-method-call.rs diff --git a/tests/ui/suggestions/derive-trait-for-method-call.stderr b/tests/ui/suggestions/derive-trait-for-method-call.stderr new file mode 100644 index 000000000..924b26a8c --- /dev/null +++ b/tests/ui/suggestions/derive-trait-for-method-call.stderr @@ -0,0 +1,105 @@ +error[E0599]: the method `test` exists for struct `Foo<Enum, CloneEnum>`, but its trait bounds were not satisfied + --> $DIR/derive-trait-for-method-call.rs:28:15 + | +LL | enum Enum { + | --------- + | | + | doesn't satisfy `Enum: Clone` + | doesn't satisfy `Enum: Default` +... +LL | enum CloneEnum { + | -------------- doesn't satisfy `CloneEnum: Default` +... +LL | struct Foo<X, Y> (X, Y); + | ---------------- method `test` not found for this struct +... +LL | let y = x.test(); + | ^^^^ method cannot be called on `Foo<Enum, CloneEnum>` due to unsatisfied trait bounds + | +note: the following trait bounds were not satisfied: + `CloneEnum: Default` + `Enum: Clone` + `Enum: Default` + --> $DIR/derive-trait-for-method-call.rs:20:9 + | +LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> { + | ^^^^^ ^^^^^^^ ^^^^^^^ --------- + | | | | + | | | unsatisfied trait bound introduced here + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here +note: the trait `Default` must be implemented + --> $SRC_DIR/core/src/default.rs:LL:COL +help: consider annotating `Enum` with `#[derive(Clone)]` + | +LL | #[derive(Clone)] + | + +error[E0599]: the method `test` exists for struct `Foo<Struct, CloneStruct>`, but its trait bounds were not satisfied + --> $DIR/derive-trait-for-method-call.rs:34:15 + | +LL | struct Struct { + | ------------- + | | + | doesn't satisfy `Struct: Clone` + | doesn't satisfy `Struct: Default` +... +LL | struct CloneStruct { + | ------------------ doesn't satisfy `CloneStruct: Default` +... +LL | struct Foo<X, Y> (X, Y); + | ---------------- method `test` not found for this struct +... +LL | let y = x.test(); + | ^^^^ method cannot be called on `Foo<Struct, CloneStruct>` due to unsatisfied trait bounds + | +note: the following trait bounds were not satisfied: + `CloneStruct: Default` + `Struct: Clone` + `Struct: Default` + --> $DIR/derive-trait-for-method-call.rs:20:9 + | +LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> { + | ^^^^^ ^^^^^^^ ^^^^^^^ --------- + | | | | + | | | unsatisfied trait bound introduced here + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here +help: consider annotating `CloneStruct` with `#[derive(Default)]` + | +LL | #[derive(Default)] + | +help: consider annotating `Struct` with `#[derive(Clone, Default)]` + | +LL | #[derive(Clone, Default)] + | + +error[E0599]: the method `test` exists for struct `Foo<Vec<Enum>, Instant>`, but its trait bounds were not satisfied + --> $DIR/derive-trait-for-method-call.rs:40:15 + | +LL | struct Foo<X, Y> (X, Y); + | ---------------- method `test` not found for this struct +... +LL | let y = x.test(); + | ^^^^ method cannot be called on `Foo<Vec<Enum>, Instant>` due to unsatisfied trait bounds + --> $SRC_DIR/std/src/time.rs:LL:COL + | + = note: doesn't satisfy `Instant: Default` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + | + = note: doesn't satisfy `Vec<Enum>: Clone` + | +note: the following trait bounds were not satisfied: + `Instant: Default` + `Vec<Enum>: Clone` + --> $DIR/derive-trait-for-method-call.rs:20:9 + | +LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> { + | ^^^^^ ^^^^^^^ --------- + | | | + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.rs b/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.rs index a25be862a..a25be862a 100644 --- a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.rs +++ b/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.rs diff --git a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr b/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr index 7bdc8e00f..0cd6267b3 100644 --- a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr +++ b/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr @@ -3,11 +3,9 @@ error[E0573]: expected type, found module `result` | LL | impl result { | ^^^^^^ help: an enum with a similar name exists: `Result` + --> $SRC_DIR/core/src/result.rs:LL:COL | - ::: $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result<T, E> { - | --------------------- similarly named enum `Result` defined here + = note: similarly named enum `Result` defined here error[E0573]: expected type, found variant `Err` --> $DIR/do-not-attempt-to-add-suggestions-with-no-changes.rs:3:25 diff --git a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs b/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs index ef1c09d21..ef1c09d21 100644 --- a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs +++ b/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs diff --git a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr b/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr index 5dc4e6444..5dc4e6444 100644 --- a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr +++ b/tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr diff --git a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-child.rs b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-child.rs index 15e0af1de..15e0af1de 100644 --- a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-child.rs +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-child.rs diff --git a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-parent.rs b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-parent.rs index 5a5079d82..5a5079d82 100644 --- a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-parent.rs +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/auxiliary/hidden-parent.rs diff --git a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.rs b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.rs index 38dabc9d7..38dabc9d7 100644 --- a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.rs +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.rs diff --git a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr index 67f4ac08d..67f4ac08d 100644 --- a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr diff --git a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.rs b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.rs index 4d96d6c16..4d96d6c16 100644 --- a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.rs +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.rs diff --git a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr index d92b81279..d92b81279 100644 --- a/src/test/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr +++ b/tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr diff --git a/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.rs b/tests/ui/suggestions/dont-suggest-pin-array-dot-set.rs index acb897571..acb897571 100644 --- a/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.rs +++ b/tests/ui/suggestions/dont-suggest-pin-array-dot-set.rs diff --git a/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr b/tests/ui/suggestions/dont-suggest-pin-array-dot-set.stderr index c66da3ea6..c66da3ea6 100644 --- a/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr +++ b/tests/ui/suggestions/dont-suggest-pin-array-dot-set.stderr diff --git a/tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs b/tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs new file mode 100644 index 000000000..e19d497f2 --- /dev/null +++ b/tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs @@ -0,0 +1,131 @@ +#[derive(Clone)] +enum Either { + One(X), + Two(X), +} + +#[derive(Clone)] +struct X(Y); + +#[derive(Clone)] +struct Y; + + +pub fn main() { + let e = Either::One(X(Y)); + let mut em = Either::One(X(Y)); + + let r = &e; + let rm = &mut Either::One(X(Y)); + + let x = X(Y); + let mut xm = X(Y); + + let s = &x; + let sm = &mut X(Y); + + let ve = vec![Either::One(X(Y))]; + + let vr = &ve; + let vrm = &mut vec![Either::One(X(Y))]; + + let vx = vec![X(Y)]; + + let vs = &vx; + let vsm = &mut vec![X(Y)]; + + // test for duplicate suggestions + + let &(X(_t), X(_u)) = &(x.clone(), x.clone()); + //~^ ERROR cannot move + //~| HELP consider removing the borrow + if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the borrow + while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the borrow + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the borrow + &(Either::Two(_t), Either::One(_u)) => (), + //~^ HELP consider removing the borrow + _ => (), + } + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) + //~^ HELP consider removing the borrow + | &(Either::Two(_t), Either::One(_u)) => (), + // FIXME: would really like a suggestion here too + _ => (), + } + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the borrow + &(Either::Two(ref _t), Either::One(ref _u)) => (), + _ => (), + } + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the borrow + (Either::Two(_t), Either::One(_u)) => (), + _ => (), + } + fn f5(&(X(_t), X(_u)): &(X, X)) { } + //~^ ERROR cannot move + //~| HELP consider removing the borrow + + let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); + //~^ ERROR cannot move + //~| HELP consider removing the mutable borrow + if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the mutable borrow + while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the mutable borrow + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the mutable borrow + &mut (Either::Two(_t), Either::One(_u)) => (), + //~^ HELP consider removing the mutable borrow + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) + //~^ HELP consider removing the mutable borrow + | &mut (Either::Two(_t), Either::One(_u)) => (), + // FIXME: would really like a suggestion here too + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the mutable borrow + &mut (Either::Two(ref _t), Either::One(ref _u)) => (), + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the mutable borrow + &mut (Either::Two(ref mut _t), Either::One(ref mut _u)) => (), + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the mutable borrow + (Either::Two(_t), Either::One(_u)) => (), + _ => (), + } + fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } + //~^ ERROR cannot move + //~| HELP consider removing the mutable borrow +} diff --git a/tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr b/tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr new file mode 100644 index 000000000..b96b3713f --- /dev/null +++ b/tests/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr @@ -0,0 +1,309 @@ +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:39:27 + | +LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); + | -- -- ^^^^^^^^^^^^^^^^^^^^^^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - let &(X(_t), X(_u)) = &(x.clone(), x.clone()); +LL + let (X(_t), X(_u)) = &(x.clone(), x.clone()); + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:42:50 + | +LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | -- -- ^^^^^^^^^^^^^^^^^^^^^^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } +LL + if let (Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:45:53 + | +LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | -- -- ^^^^^^^^^^^^^^^^^^^^^^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } +LL + while let (Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:48:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &(Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here +LL | +LL | &(Either::Two(_t), Either::One(_u)) => (), + | -- ...and here -- ...and here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - &(Either::One(_t), Either::Two(_u)) => (), +LL + (Either::One(_t), Either::Two(_u)) => (), + | +help: consider removing the borrow + | +LL - &(Either::Two(_t), Either::One(_u)) => (), +LL + (Either::Two(_t), Either::One(_u)) => (), + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:56:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &(Either::One(_t), Either::Two(_u)) + | -- -- ...and here + | | + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - &(Either::One(_t), Either::Two(_u)) +LL + (Either::One(_t), Either::Two(_u)) + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:64:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &(Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - &(Either::One(_t), Either::Two(_u)) => (), +LL + (Either::One(_t), Either::Two(_u)) => (), + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:71:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &(Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - &(Either::One(_t), Either::Two(_u)) => (), +LL + (Either::One(_t), Either::Two(_u)) => (), + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:82:31 + | +LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); + | -- -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); +LL + let (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:85:54 + | +LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | -- -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } +LL + if let (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:88:57 + | +LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | -- -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } +LL + while let (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:91:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here +LL | +LL | &mut (Either::Two(_t), Either::One(_u)) => (), + | -- ...and here -- ...and here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - &mut (Either::One(_t), Either::Two(_u)) => (), +LL + (Either::One(_t), Either::Two(_u)) => (), + | +help: consider removing the mutable borrow + | +LL - &mut (Either::Two(_t), Either::One(_u)) => (), +LL + (Either::Two(_t), Either::One(_u)) => (), + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:99:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &mut (Either::One(_t), Either::Two(_u)) + | -- -- ...and here + | | + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - &mut (Either::One(_t), Either::Two(_u)) +LL + (Either::One(_t), Either::Two(_u)) + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:107:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - &mut (Either::One(_t), Either::Two(_u)) => (), +LL + (Either::One(_t), Either::Two(_u)) => (), + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:114:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - &mut (Either::One(_t), Either::Two(_u)) => (), +LL + (Either::One(_t), Either::Two(_u)) => (), + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:121:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - &mut (Either::One(_t), Either::Two(_u)) => (), +LL + (Either::One(_t), Either::Two(_u)) => (), + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/duplicate-suggestions.rs:78:11 + | +LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } + | ^^^^--^^^^^--^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the borrow + | +LL - fn f5(&(X(_t), X(_u)): &(X, X)) { } +LL + fn f5((X(_t), X(_u)): &(X, X)) { } + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/duplicate-suggestions.rs:128:11 + | +LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } + | ^^^^^^^^--^^^^^--^^ + | | | + | | ...and here + | data moved here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } +LL + fn f6((X(_t), X(_u)): &mut (X, X)) { } + | + +error: aborting due to 17 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.rs b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.rs index f1e043c30..44eac3691 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.rs +++ b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.rs @@ -28,26 +28,21 @@ fn move_into_fn() { let X(_t) = x; //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &x if let Either::One(_t) = e { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e while let Either::One(_t) = e { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e match e { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e Either::One(_t) | Either::Two(_t) => (), } match e { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e Either::One(_t) => (), Either::Two(ref _t) => (), // FIXME: should suggest removing `ref` too @@ -56,26 +51,21 @@ fn move_into_fn() { let X(mut _t) = x; //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &x if let Either::One(mut _t) = em { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em while let Either::One(mut _t) = em { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em match em { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em Either::One(mut _t) | Either::Two(mut _t) => (), } match em { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em Either::One(mut _t) => (), Either::Two(ref _t) => (), // FIXME: should suggest removing `ref` too @@ -95,26 +85,21 @@ fn move_into_fnmut() { let X(_t) = x; //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &x if let Either::One(_t) = e { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e while let Either::One(_t) = e { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e match e { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e Either::One(_t) | Either::Two(_t) => (), } match e { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &e Either::One(_t) => (), Either::Two(ref _t) => (), // FIXME: should suggest removing `ref` too @@ -123,26 +108,21 @@ fn move_into_fnmut() { let X(mut _t) = x; //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &x if let Either::One(mut _t) = em { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em while let Either::One(mut _t) = em { } //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em match em { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em Either::One(mut _t) | Either::Two(mut _t) => (), } match em { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em Either::One(mut _t) => (), Either::Two(ref _t) => (), // FIXME: should suggest removing `ref` too @@ -150,7 +130,6 @@ fn move_into_fnmut() { match em { //~^ ERROR cannot move //~| HELP consider borrowing here - //~| SUGGESTION &em Either::One(mut _t) => (), Either::Two(ref mut _t) => (), // FIXME: should suggest removing `ref` too diff --git a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr index e06ee4290..edda2cbc7 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr +++ b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr @@ -7,13 +7,18 @@ LL | let x = X(Y); LL | consume_fn(|| { | -- captured by this `Fn` closure LL | let X(_t) = x; - | -- ^ help: consider borrowing here: `&x` + | -- ^ | | | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | let X(_t) = &x; + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:32:34 + --> $DIR/move-into-closure.rs:31:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -22,13 +27,18 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | if let Either::One(_t) = e { } - | -- ^ help: consider borrowing here: `&e` + | -- ^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | if let Either::One(_t) = &e { } + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:36:37 + --> $DIR/move-into-closure.rs:34:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -37,13 +47,18 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | while let Either::One(_t) = e { } - | -- ^ help: consider borrowing here: `&e` + | -- ^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | while let Either::One(_t) = &e { } + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:40:15 + --> $DIR/move-into-closure.rs:37:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -52,16 +67,21 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | match e { - | ^ help: consider borrowing here: `&e` + | ^ ... LL | Either::One(_t) | -- | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &e { + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:47:15 + --> $DIR/move-into-closure.rs:43:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -70,16 +90,21 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | match e { - | ^ help: consider borrowing here: `&e` + | ^ ... LL | Either::One(_t) => (), | -- | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &e { + | + error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:56:25 + --> $DIR/move-into-closure.rs:51:25 | LL | let x = X(Y); | - captured outer variable @@ -88,13 +113,18 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | let X(mut _t) = x; - | ------ ^ help: consider borrowing here: `&x` + | ------ ^ | | | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | let X(mut _t) = &x; + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:60:38 + --> $DIR/move-into-closure.rs:54:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -103,13 +133,18 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | if let Either::One(mut _t) = em { } - | ------ ^^ help: consider borrowing here: `&em` + | ------ ^^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | if let Either::One(mut _t) = &em { } + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:64:41 + --> $DIR/move-into-closure.rs:57:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -118,13 +153,18 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | while let Either::One(mut _t) = em { } - | ------ ^^ help: consider borrowing here: `&em` + | ------ ^^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | while let Either::One(mut _t) = &em { } + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:68:15 + --> $DIR/move-into-closure.rs:60:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -133,16 +173,21 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | match em { - | ^^ help: consider borrowing here: `&em` + | ^^ ... LL | Either::One(mut _t) | ------ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &em { + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:75:15 + --> $DIR/move-into-closure.rs:66:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -151,16 +196,21 @@ LL | consume_fn(|| { | -- captured by this `Fn` closure ... LL | match em { - | ^^ help: consider borrowing here: `&em` + | ^^ ... LL | Either::One(mut _t) => (), | ------ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &em { + | + error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:95:21 + --> $DIR/move-into-closure.rs:85:21 | LL | let x = X(Y); | - captured outer variable @@ -168,13 +218,18 @@ LL | let x = X(Y); LL | consume_fnmut(|| { | -- captured by this `FnMut` closure LL | let X(_t) = x; - | -- ^ help: consider borrowing here: `&x` + | -- ^ | | | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | let X(_t) = &x; + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:99:34 + --> $DIR/move-into-closure.rs:88:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -183,13 +238,18 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | if let Either::One(_t) = e { } - | -- ^ help: consider borrowing here: `&e` + | -- ^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | if let Either::One(_t) = &e { } + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:103:37 + --> $DIR/move-into-closure.rs:91:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -198,13 +258,18 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | while let Either::One(_t) = e { } - | -- ^ help: consider borrowing here: `&e` + | -- ^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | while let Either::One(_t) = &e { } + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:107:15 + --> $DIR/move-into-closure.rs:94:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -213,16 +278,21 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | match e { - | ^ help: consider borrowing here: `&e` + | ^ ... LL | Either::One(_t) | -- | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &e { + | + error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:114:15 + --> $DIR/move-into-closure.rs:100:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -231,16 +301,21 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | match e { - | ^ help: consider borrowing here: `&e` + | ^ ... LL | Either::One(_t) => (), | -- | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &e { + | + error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:123:25 + --> $DIR/move-into-closure.rs:108:25 | LL | let x = X(Y); | - captured outer variable @@ -249,13 +324,18 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | let X(mut _t) = x; - | ------ ^ help: consider borrowing here: `&x` + | ------ ^ | | | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | let X(mut _t) = &x; + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:127:38 + --> $DIR/move-into-closure.rs:111:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -264,13 +344,18 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | if let Either::One(mut _t) = em { } - | ------ ^^ help: consider borrowing here: `&em` + | ------ ^^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | if let Either::One(mut _t) = &em { } + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:131:41 + --> $DIR/move-into-closure.rs:114:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -279,13 +364,18 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | while let Either::One(mut _t) = em { } - | ------ ^^ help: consider borrowing here: `&em` + | ------ ^^ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | while let Either::One(mut _t) = &em { } + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:135:15 + --> $DIR/move-into-closure.rs:117:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -294,16 +384,21 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | match em { - | ^^ help: consider borrowing here: `&em` + | ^^ ... LL | Either::One(mut _t) | ------ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &em { + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:142:15 + --> $DIR/move-into-closure.rs:123:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -312,16 +407,21 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | match em { - | ^^ help: consider borrowing here: `&em` + | ^^ ... LL | Either::One(mut _t) => (), | ------ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &em { + | + error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:150:15 + --> $DIR/move-into-closure.rs:130:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -330,13 +430,18 @@ LL | consume_fnmut(|| { | -- captured by this `FnMut` closure ... LL | match em { - | ^^ help: consider borrowing here: `&em` + | ^^ ... LL | Either::One(mut _t) => (), | ------ | | | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &em { + | + error: aborting due to 21 previous errors diff --git a/tests/ui/suggestions/dont-suggest-ref/simple.rs b/tests/ui/suggestions/dont-suggest-ref/simple.rs new file mode 100644 index 000000000..1e40e60a1 --- /dev/null +++ b/tests/ui/suggestions/dont-suggest-ref/simple.rs @@ -0,0 +1,336 @@ +#[derive(Clone)] +enum Either { + One(X), + Two(X), +} + +#[derive(Clone)] +struct X(Y); + +#[derive(Clone)] +struct Y; + +pub fn main() { + let e = Either::One(X(Y)); + let mut em = Either::One(X(Y)); + + let r = &e; + let rm = &mut Either::One(X(Y)); + + let x = X(Y); + let mut xm = X(Y); + + let s = &x; + let sm = &mut X(Y); + + let ve = vec![Either::One(X(Y))]; + + let vr = &ve; + let vrm = &mut vec![Either::One(X(Y))]; + + let vx = vec![X(Y)]; + + let vs = &vx; + let vsm = &mut vec![X(Y)]; + + // move from Either/X place + + let X(_t) = *s; + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + if let Either::One(_t) = *r { } + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + while let Either::One(_t) = *r { } + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + match *r { + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + Either::One(_t) + | Either::Two(_t) => (), + } + match *r { + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + Either::One(_t) => (), + Either::Two(ref _t) => (), + // FIXME: should suggest removing `ref` too + } + + let X(_t) = *sm; + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + if let Either::One(_t) = *rm { } + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + while let Either::One(_t) = *rm { } + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + match *rm { + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + Either::One(_t) + | Either::Two(_t) => (), + } + match *rm { + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + Either::One(_t) => (), + Either::Two(ref _t) => (), + // FIXME: should suggest removing `ref` too + } + match *rm { + //~^ ERROR cannot move + //~| HELP consider removing the dereference here + Either::One(_t) => (), + Either::Two(ref mut _t) => (), + // FIXME: should suggest removing `ref` too + } + + let X(_t) = vs[0]; + //~^ ERROR cannot move + //~| HELP consider borrowing here + if let Either::One(_t) = vr[0] { } + //~^ ERROR cannot move + //~| HELP consider borrowing here + while let Either::One(_t) = vr[0] { } + //~^ ERROR cannot move + //~| HELP consider borrowing here + match vr[0] { + //~^ ERROR cannot move + //~| HELP consider borrowing here + Either::One(_t) + | Either::Two(_t) => (), + } + match vr[0] { + //~^ ERROR cannot move + //~| HELP consider borrowing here + Either::One(_t) => (), + Either::Two(ref _t) => (), + // FIXME: should suggest removing `ref` too + } + + let X(_t) = vsm[0]; + //~^ ERROR cannot move + //~| HELP consider borrowing here + if let Either::One(_t) = vrm[0] { } + //~^ ERROR cannot move + //~| HELP consider borrowing here + while let Either::One(_t) = vrm[0] { } + //~^ ERROR cannot move + //~| HELP consider borrowing here + match vrm[0] { + //~^ ERROR cannot move + //~| HELP consider borrowing here + Either::One(_t) + | Either::Two(_t) => (), + } + match vrm[0] { + //~^ ERROR cannot move + //~| HELP consider borrowing here + Either::One(_t) => (), + Either::Two(ref _t) => (), + // FIXME: should suggest removing `ref` too + } + match vrm[0] { + //~^ ERROR cannot move + //~| HELP consider borrowing here + Either::One(_t) => (), + Either::Two(ref mut _t) => (), + // FIXME: should suggest removing `ref` too + } + + // move from &Either/&X place + + let &X(_t) = s; + //~^ ERROR cannot move + //~| HELP consider removing + if let &Either::One(_t) = r { } + //~^ ERROR cannot move + //~| HELP consider removing + while let &Either::One(_t) = r { } + //~^ ERROR cannot move + //~| HELP consider removing + match r { + //~^ ERROR cannot move + &Either::One(_t) + //~^ HELP consider removing + | &Either::Two(_t) => (), + // FIXME: would really like a suggestion here too + } + match r { + //~^ ERROR cannot move + &Either::One(_t) => (), + //~^ HELP consider removing + &Either::Two(ref _t) => (), + } + match r { + //~^ ERROR cannot move + &Either::One(_t) => (), + //~^ HELP consider removing + Either::Two(_t) => (), + } + fn f1(&X(_t): &X) { } + //~^ ERROR cannot move + //~| HELP consider removing + + let &mut X(_t) = sm; + //~^ ERROR cannot move + //~| HELP consider removing + if let &mut Either::One(_t) = rm { } + //~^ ERROR cannot move + //~| HELP consider removing + while let &mut Either::One(_t) = rm { } + //~^ ERROR cannot move + //~| HELP consider removing + match rm { + //~^ ERROR cannot move + &mut Either::One(_t) => (), + //~^ HELP consider removing + &mut Either::Two(_t) => (), + //~^ HELP consider removing + } + match rm { + //~^ ERROR cannot move + &mut Either::One(_t) => (), + //~^ HELP consider removing + &mut Either::Two(ref _t) => (), + } + match rm { + //~^ ERROR cannot move + &mut Either::One(_t) => (), + //~^ HELP consider removing + &mut Either::Two(ref mut _t) => (), + } + match rm { + //~^ ERROR cannot move + &mut Either::One(_t) => (), + //~^ HELP consider removing + Either::Two(_t) => (), + } + fn f2(&mut X(_t): &mut X) { } + //~^ ERROR cannot move + //~| HELP consider removing + + // move from tuple of &Either/&X + + // FIXME: These should have suggestions. + + let (&X(_t),) = (&x.clone(),); + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + if let (&Either::One(_t),) = (&e.clone(),) { } + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + while let (&Either::One(_t),) = (&e.clone(),) { } + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + match (&e.clone(),) { + //~^ ERROR cannot move + (&Either::One(_t),) + //~^ HELP consider borrowing the pattern binding + | (&Either::Two(_t),) => (), + } + fn f3((&X(_t),): (&X,)) { } + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + + let (&mut X(_t),) = (&mut xm.clone(),); + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + if let (&mut Either::One(_t),) = (&mut em.clone(),) { } + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + while let (&mut Either::One(_t),) = (&mut em.clone(),) { } + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + match (&mut em.clone(),) { + //~^ ERROR cannot move + (&mut Either::One(_t),) => (), + //~^ HELP consider borrowing the pattern binding + (&mut Either::Two(_t),) => (), + //~^ HELP consider borrowing the pattern binding + } + fn f4((&mut X(_t),): (&mut X,)) { } + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + + // move from &Either/&X value + + let &X(_t) = &x; + //~^ ERROR cannot move + //~| HELP consider removing + if let &Either::One(_t) = &e { } + //~^ ERROR cannot move + //~| HELP consider removing + while let &Either::One(_t) = &e { } + //~^ ERROR cannot move + //~| HELP consider removing + match &e { + //~^ ERROR cannot move + &Either::One(_t) + //~^ HELP consider removing + | &Either::Two(_t) => (), + // FIXME: would really like a suggestion here too + } + match &e { + //~^ ERROR cannot move + &Either::One(_t) => (), + //~^ HELP consider removing + &Either::Two(ref _t) => (), + } + match &e { + //~^ ERROR cannot move + &Either::One(_t) => (), + //~^ HELP consider removing + Either::Two(_t) => (), + } + + let &mut X(_t) = &mut xm; + //~^ ERROR cannot move + //~| HELP consider removing + if let &mut Either::One(_t) = &mut em { } + //~^ ERROR cannot move + //~| HELP consider removing + while let &mut Either::One(_t) = &mut em { } + //~^ ERROR cannot move + //~| HELP consider removing + match &mut em { + //~^ ERROR cannot move + &mut Either::One(_t) + //~^ HELP consider removing + | &mut Either::Two(_t) => (), + // FIXME: would really like a suggestion here too + } + match &mut em { + //~^ ERROR cannot move + &mut Either::One(_t) => (), + //~^ HELP consider removing + &mut Either::Two(ref _t) => (), + } + match &mut em { + //~^ ERROR cannot move + &mut Either::One(_t) => (), + //~^ HELP consider removing + &mut Either::Two(ref mut _t) => (), + } + match &mut em { + //~^ ERROR cannot move + &mut Either::One(_t) => (), + //~^ HELP consider removing + Either::Two(_t) => (), + } +} + +struct Testing { + a: Option<String> +} + +fn testing(a: &Testing) { + let Some(_s) = a.a else { + //~^ ERROR cannot move + //~| HELP consider borrowing the pattern binding + return; + }; +} diff --git a/tests/ui/suggestions/dont-suggest-ref/simple.stderr b/tests/ui/suggestions/dont-suggest-ref/simple.stderr new file mode 100644 index 000000000..526326524 --- /dev/null +++ b/tests/ui/suggestions/dont-suggest-ref/simple.stderr @@ -0,0 +1,985 @@ +error[E0507]: cannot move out of `s` which is behind a shared reference + --> $DIR/simple.rs:38:17 + | +LL | let X(_t) = *s; + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - let X(_t) = *s; +LL + let X(_t) = s; + | + +error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference + --> $DIR/simple.rs:41:30 + | +LL | if let Either::One(_t) = *r { } + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - if let Either::One(_t) = *r { } +LL + if let Either::One(_t) = r { } + | + +error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference + --> $DIR/simple.rs:44:33 + | +LL | while let Either::One(_t) = *r { } + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - while let Either::One(_t) = *r { } +LL + while let Either::One(_t) = r { } + | + +error[E0507]: cannot move out of `r` as enum variant `Two` which is behind a shared reference + --> $DIR/simple.rs:47:11 + | +LL | match *r { + | ^^ +... +LL | Either::One(_t) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - match *r { +LL + match r { + | + +error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference + --> $DIR/simple.rs:53:11 + | +LL | match *r { + | ^^ +... +LL | Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - match *r { +LL + match r { + | + +error[E0507]: cannot move out of `sm` which is behind a mutable reference + --> $DIR/simple.rs:61:17 + | +LL | let X(_t) = *sm; + | -- ^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - let X(_t) = *sm; +LL + let X(_t) = sm; + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:64:30 + | +LL | if let Either::One(_t) = *rm { } + | -- ^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - if let Either::One(_t) = *rm { } +LL + if let Either::One(_t) = rm { } + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:67:33 + | +LL | while let Either::One(_t) = *rm { } + | -- ^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - while let Either::One(_t) = *rm { } +LL + while let Either::One(_t) = rm { } + | + +error[E0507]: cannot move out of `rm` as enum variant `Two` which is behind a mutable reference + --> $DIR/simple.rs:70:11 + | +LL | match *rm { + | ^^^ +... +LL | Either::One(_t) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - match *rm { +LL + match rm { + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:76:11 + | +LL | match *rm { + | ^^^ +... +LL | Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - match *rm { +LL + match rm { + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:83:11 + | +LL | match *rm { + | ^^^ +... +LL | Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the dereference here + | +LL - match *rm { +LL + match rm { + | + +error[E0507]: cannot move out of index of `Vec<X>` + --> $DIR/simple.rs:91:17 + | +LL | let X(_t) = vs[0]; + | -- ^^^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | let X(_t) = &vs[0]; + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:94:30 + | +LL | if let Either::One(_t) = vr[0] { } + | -- ^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | if let Either::One(_t) = &vr[0] { } + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:97:33 + | +LL | while let Either::One(_t) = vr[0] { } + | -- ^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | while let Either::One(_t) = &vr[0] { } + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:100:11 + | +LL | match vr[0] { + | ^^^^^ +... +LL | Either::One(_t) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &vr[0] { + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:106:11 + | +LL | match vr[0] { + | ^^^^^ +... +LL | Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &vr[0] { + | + + +error[E0507]: cannot move out of index of `Vec<X>` + --> $DIR/simple.rs:114:17 + | +LL | let X(_t) = vsm[0]; + | -- ^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | let X(_t) = &vsm[0]; + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:117:30 + | +LL | if let Either::One(_t) = vrm[0] { } + | -- ^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | if let Either::One(_t) = &vrm[0] { } + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:120:33 + | +LL | while let Either::One(_t) = vrm[0] { } + | -- ^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | while let Either::One(_t) = &vrm[0] { } + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:123:11 + | +LL | match vrm[0] { + | ^^^^^^ +... +LL | Either::One(_t) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &vrm[0] { + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:129:11 + | +LL | match vrm[0] { + | ^^^^^^ +... +LL | Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &vrm[0] { + | + + +error[E0507]: cannot move out of index of `Vec<Either>` + --> $DIR/simple.rs:136:11 + | +LL | match vrm[0] { + | ^^^^^^ +... +LL | Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing here + | +LL | match &vrm[0] { + | + + +error[E0507]: cannot move out of `s` which is behind a shared reference + --> $DIR/simple.rs:146:18 + | +LL | let &X(_t) = s; + | -- ^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - let &X(_t) = s; +LL + let X(_t) = s; + | + +error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference + --> $DIR/simple.rs:149:31 + | +LL | if let &Either::One(_t) = r { } + | -- ^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - if let &Either::One(_t) = r { } +LL + if let Either::One(_t) = r { } + | + +error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference + --> $DIR/simple.rs:152:34 + | +LL | while let &Either::One(_t) = r { } + | -- ^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - while let &Either::One(_t) = r { } +LL + while let Either::One(_t) = r { } + | + +error[E0507]: cannot move out of `r` as enum variant `Two` which is behind a shared reference + --> $DIR/simple.rs:155:11 + | +LL | match r { + | ^ +LL | +LL | &Either::One(_t) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - &Either::One(_t) +LL + Either::One(_t) + | + +error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference + --> $DIR/simple.rs:162:11 + | +LL | match r { + | ^ +LL | +LL | &Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - &Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference + --> $DIR/simple.rs:168:11 + | +LL | match r { + | ^ +LL | +LL | &Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - &Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of `sm` which is behind a mutable reference + --> $DIR/simple.rs:178:22 + | +LL | let &mut X(_t) = sm; + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - let &mut X(_t) = sm; +LL + let X(_t) = sm; + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:181:35 + | +LL | if let &mut Either::One(_t) = rm { } + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - if let &mut Either::One(_t) = rm { } +LL + if let Either::One(_t) = rm { } + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:184:38 + | +LL | while let &mut Either::One(_t) = rm { } + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - while let &mut Either::One(_t) = rm { } +LL + while let Either::One(_t) = rm { } + | + +error[E0507]: cannot move out of `rm` as enum variant `Two` which is behind a mutable reference + --> $DIR/simple.rs:187:11 + | +LL | match rm { + | ^^ +LL | +LL | &mut Either::One(_t) => (), + | -- data moved here +LL | +LL | &mut Either::Two(_t) => (), + | -- ...and here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) => (), +LL + Either::One(_t) => (), + | +help: consider removing the mutable borrow + | +LL - &mut Either::Two(_t) => (), +LL + Either::Two(_t) => (), + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:194:11 + | +LL | match rm { + | ^^ +LL | +LL | &mut Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:200:11 + | +LL | match rm { + | ^^ +LL | +LL | &mut Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference + --> $DIR/simple.rs:206:11 + | +LL | match rm { + | ^^ +LL | +LL | &mut Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:220:21 + | +LL | let (&X(_t),) = (&x.clone(),); + | -- ^^^^^^^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | let (&X(ref _t),) = (&x.clone(),); + | +++ + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:223:34 + | +LL | if let (&Either::One(_t),) = (&e.clone(),) { } + | -- ^^^^^^^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | if let (&Either::One(ref _t),) = (&e.clone(),) { } + | +++ + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:226:37 + | +LL | while let (&Either::One(_t),) = (&e.clone(),) { } + | -- ^^^^^^^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | while let (&Either::One(ref _t),) = (&e.clone(),) { } + | +++ + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:229:11 + | +LL | match (&e.clone(),) { + | ^^^^^^^^^^^^^ +LL | +LL | (&Either::One(_t),) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | (&Either::One(ref _t),) + | +++ + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:239:25 + | +LL | let (&mut X(_t),) = (&mut xm.clone(),); + | -- ^^^^^^^^^^^^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | let (&mut X(ref _t),) = (&mut xm.clone(),); + | +++ + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:242:38 + | +LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } + | -- ^^^^^^^^^^^^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | if let (&mut Either::One(ref _t),) = (&mut em.clone(),) { } + | +++ + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:245:41 + | +LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } + | -- ^^^^^^^^^^^^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | while let (&mut Either::One(ref _t),) = (&mut em.clone(),) { } + | +++ + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:248:11 + | +LL | match (&mut em.clone(),) { + | ^^^^^^^^^^^^^^^^^^ +LL | +LL | (&mut Either::One(_t),) => (), + | -- data moved here +LL | +LL | (&mut Either::Two(_t),) => (), + | -- ...and here + | + = note: move occurs because these variables have types that don't implement the `Copy` trait +help: consider borrowing the pattern binding + | +LL | (&mut Either::One(ref _t),) => (), + | +++ +help: consider borrowing the pattern binding + | +LL | (&mut Either::Two(ref _t),) => (), + | +++ + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:261:18 + | +LL | let &X(_t) = &x; + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - let &X(_t) = &x; +LL + let X(_t) = &x; + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:264:31 + | +LL | if let &Either::One(_t) = &e { } + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - if let &Either::One(_t) = &e { } +LL + if let Either::One(_t) = &e { } + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:267:34 + | +LL | while let &Either::One(_t) = &e { } + | -- ^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - while let &Either::One(_t) = &e { } +LL + while let Either::One(_t) = &e { } + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:270:11 + | +LL | match &e { + | ^^ +LL | +LL | &Either::One(_t) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - &Either::One(_t) +LL + Either::One(_t) + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:277:11 + | +LL | match &e { + | ^^ +LL | +LL | &Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - &Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:283:11 + | +LL | match &e { + | ^^ +LL | +LL | &Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - &Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:290:22 + | +LL | let &mut X(_t) = &mut xm; + | -- ^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - let &mut X(_t) = &mut xm; +LL + let X(_t) = &mut xm; + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:293:35 + | +LL | if let &mut Either::One(_t) = &mut em { } + | -- ^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - if let &mut Either::One(_t) = &mut em { } +LL + if let Either::One(_t) = &mut em { } + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:296:38 + | +LL | while let &mut Either::One(_t) = &mut em { } + | -- ^^^^^^^ + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - while let &mut Either::One(_t) = &mut em { } +LL + while let Either::One(_t) = &mut em { } + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:299:11 + | +LL | match &mut em { + | ^^^^^^^ +LL | +LL | &mut Either::One(_t) + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) +LL + Either::One(_t) + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:306:11 + | +LL | match &mut em { + | ^^^^^^^ +LL | +LL | &mut Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:312:11 + | +LL | match &mut em { + | ^^^^^^^ +LL | +LL | &mut Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:318:11 + | +LL | match &mut em { + | ^^^^^^^ +LL | +LL | &mut Either::One(_t) => (), + | -- + | | + | data moved here + | move occurs because `_t` has type `X`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - &mut Either::One(_t) => (), +LL + Either::One(_t) => (), + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:174:11 + | +LL | fn f1(&X(_t): &X) { } + | ^^^--^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - fn f1(&X(_t): &X) { } +LL + fn f1(X(_t): &X) { } + | + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:212:11 + | +LL | fn f2(&mut X(_t): &mut X) { } + | ^^^^^^^--^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider removing the mutable borrow + | +LL - fn f2(&mut X(_t): &mut X) { } +LL + fn f2(X(_t): &mut X) { } + | + +error[E0507]: cannot move out of a shared reference + --> $DIR/simple.rs:235:11 + | +LL | fn f3((&X(_t),): (&X,)) { } + | ^^^^--^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | fn f3((&X(ref _t),): (&X,)) { } + | +++ + +error[E0507]: cannot move out of a mutable reference + --> $DIR/simple.rs:255:11 + | +LL | fn f4((&mut X(_t),): (&mut X,)) { } + | ^^^^^^^^--^^^ + | | + | data moved here + | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | fn f4((&mut X(ref _t),): (&mut X,)) { } + | +++ + +error[E0507]: cannot move out of `a.a` as enum variant `Some` which is behind a shared reference + --> $DIR/simple.rs:331:20 + | +LL | let Some(_s) = a.a else { + | -- ^^^ + | | + | data moved here + | move occurs because `_s` has type `String`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | let Some(ref _s) = a.a else { + | +++ + +error: aborting due to 61 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.rs b/tests/ui/suggestions/dont-suggest-try_into-in-macros.rs index d625199c9..d625199c9 100644 --- a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.rs +++ b/tests/ui/suggestions/dont-suggest-try_into-in-macros.rs diff --git a/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr new file mode 100644 index 000000000..bc6342004 --- /dev/null +++ b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/dont-suggest-try_into-in-macros.rs:2:5 + | +LL | assert_eq!(10u64, 10usize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected `u64`, found `usize` + | expected because this is `u64` + | + = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/dont-suggest-ufcs-for-const.rs b/tests/ui/suggestions/dont-suggest-ufcs-for-const.rs index 06cf243f1..06cf243f1 100644 --- a/src/test/ui/suggestions/dont-suggest-ufcs-for-const.rs +++ b/tests/ui/suggestions/dont-suggest-ufcs-for-const.rs diff --git a/src/test/ui/suggestions/dont-suggest-ufcs-for-const.stderr b/tests/ui/suggestions/dont-suggest-ufcs-for-const.stderr index 0d9543e0b..0d9543e0b 100644 --- a/src/test/ui/suggestions/dont-suggest-ufcs-for-const.stderr +++ b/tests/ui/suggestions/dont-suggest-ufcs-for-const.stderr diff --git a/src/test/ui/suggestions/dont-try-removing-the-field.rs b/tests/ui/suggestions/dont-try-removing-the-field.rs index 948aa2b94..948aa2b94 100644 --- a/src/test/ui/suggestions/dont-try-removing-the-field.rs +++ b/tests/ui/suggestions/dont-try-removing-the-field.rs diff --git a/src/test/ui/suggestions/dont-try-removing-the-field.stderr b/tests/ui/suggestions/dont-try-removing-the-field.stderr index 263171a4a..263171a4a 100644 --- a/src/test/ui/suggestions/dont-try-removing-the-field.stderr +++ b/tests/ui/suggestions/dont-try-removing-the-field.stderr diff --git a/src/test/ui/suggestions/dont-wrap-ambiguous-receivers.rs b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs index baa2128eb..baa2128eb 100644 --- a/src/test/ui/suggestions/dont-wrap-ambiguous-receivers.rs +++ b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs diff --git a/src/test/ui/suggestions/dont-wrap-ambiguous-receivers.stderr b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr index 4658ecb3a..4658ecb3a 100644 --- a/src/test/ui/suggestions/dont-wrap-ambiguous-receivers.stderr +++ b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr diff --git a/src/test/ui/suggestions/enum-method-probe.fixed b/tests/ui/suggestions/enum-method-probe.fixed index 6499c92bc..6499c92bc 100644 --- a/src/test/ui/suggestions/enum-method-probe.fixed +++ b/tests/ui/suggestions/enum-method-probe.fixed diff --git a/src/test/ui/suggestions/enum-method-probe.rs b/tests/ui/suggestions/enum-method-probe.rs index 18ea8ed8a..18ea8ed8a 100644 --- a/src/test/ui/suggestions/enum-method-probe.rs +++ b/tests/ui/suggestions/enum-method-probe.rs diff --git a/src/test/ui/suggestions/enum-method-probe.stderr b/tests/ui/suggestions/enum-method-probe.stderr index 6ed14984f..6ed14984f 100644 --- a/src/test/ui/suggestions/enum-method-probe.stderr +++ b/tests/ui/suggestions/enum-method-probe.stderr diff --git a/tests/ui/suggestions/enum-variant-arg-mismatch.rs b/tests/ui/suggestions/enum-variant-arg-mismatch.rs new file mode 100644 index 000000000..8de5bae92 --- /dev/null +++ b/tests/ui/suggestions/enum-variant-arg-mismatch.rs @@ -0,0 +1,10 @@ +pub enum Sexpr<'a> { + Ident(&'a str), +} + +fn map<'a, F: Fn(String) -> Sexpr<'a>>(f: F) {} + +fn main() { + map(Sexpr::Ident); + //~^ ERROR type mismatch in function arguments +} diff --git a/tests/ui/suggestions/enum-variant-arg-mismatch.stderr b/tests/ui/suggestions/enum-variant-arg-mismatch.stderr new file mode 100644 index 000000000..f76019b70 --- /dev/null +++ b/tests/ui/suggestions/enum-variant-arg-mismatch.stderr @@ -0,0 +1,22 @@ +error[E0631]: type mismatch in function arguments + --> $DIR/enum-variant-arg-mismatch.rs:8:9 + | +LL | Ident(&'a str), + | ----- found signature defined here +... +LL | map(Sexpr::Ident); + | --- ^^^^^^^^^^^^ expected due to this + | | + | required by a bound introduced by this call + | + = note: expected function signature `fn(String) -> _` + found function signature `fn(&str) -> _` +note: required by a bound in `map` + --> $DIR/enum-variant-arg-mismatch.rs:5:15 + | +LL | fn map<'a, F: Fn(String) -> Sexpr<'a>>(f: F) {} + | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0631`. diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.rs b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.rs index 7e9c5492d..7e9c5492d 100644 --- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.rs +++ b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.rs diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index 34ff59a9b..b1e04dab8 100644 --- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -41,9 +41,6 @@ LL | Pin::new(x) found type parameter `F` note: associated function defined here --> $SRC_DIR/core/src/pin.rs:LL:COL - | -LL | pub const fn new(pointer: P) -> Pin<P> { - | ^^^ error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned --> $DIR/expected-boxed-future-isnt-pinned.rs:19:14 @@ -56,9 +53,6 @@ LL | Pin::new(x) = note: consider using `Box::pin` note: required by a bound in `Pin::<P>::new` --> $SRC_DIR/core/src/pin.rs:LL:COL - | -LL | impl<P: Deref<Target: Unpin>> Pin<P> { - | ^^^^^ required by this bound in `Pin::<P>::new` error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned --> $DIR/expected-boxed-future-isnt-pinned.rs:24:14 @@ -71,9 +65,6 @@ LL | Pin::new(Box::new(x)) = note: consider using `Box::pin` note: required by a bound in `Pin::<P>::new` --> $SRC_DIR/core/src/pin.rs:LL:COL - | -LL | impl<P: Deref<Target: Unpin>> Pin<P> { - | ^^^^^ required by this bound in `Pin::<P>::new` error[E0308]: mismatched types --> $DIR/expected-boxed-future-isnt-pinned.rs:28:5 @@ -90,9 +81,6 @@ LL | | } found `async` block `[async block@$DIR/expected-boxed-future-isnt-pinned.rs:28:5: 30:6]` note: function defined here --> $SRC_DIR/core/src/future/mod.rs:LL:COL - | -LL | pub const fn identity_future<O, Fut: Future<Output = O>>(f: Fut) -> Fut { - | ^^^^^^^^^^^^^^^ help: you need to pin and box this expression | LL ~ Box::pin(async { diff --git a/src/test/ui/suggestions/field-access-considering-privacy.rs b/tests/ui/suggestions/field-access-considering-privacy.rs index 3de06b214..3de06b214 100644 --- a/src/test/ui/suggestions/field-access-considering-privacy.rs +++ b/tests/ui/suggestions/field-access-considering-privacy.rs diff --git a/src/test/ui/suggestions/field-access-considering-privacy.stderr b/tests/ui/suggestions/field-access-considering-privacy.stderr index cbf6f3d10..cbf6f3d10 100644 --- a/src/test/ui/suggestions/field-access-considering-privacy.stderr +++ b/tests/ui/suggestions/field-access-considering-privacy.stderr diff --git a/src/test/ui/suggestions/field-access.fixed b/tests/ui/suggestions/field-access.fixed index ed9aef6e3..ed9aef6e3 100644 --- a/src/test/ui/suggestions/field-access.fixed +++ b/tests/ui/suggestions/field-access.fixed diff --git a/src/test/ui/suggestions/field-access.rs b/tests/ui/suggestions/field-access.rs index d80488e8a..d80488e8a 100644 --- a/src/test/ui/suggestions/field-access.rs +++ b/tests/ui/suggestions/field-access.rs diff --git a/src/test/ui/suggestions/field-access.stderr b/tests/ui/suggestions/field-access.stderr index b9f0f788b..b9f0f788b 100644 --- a/src/test/ui/suggestions/field-access.stderr +++ b/tests/ui/suggestions/field-access.stderr diff --git a/src/test/ui/suggestions/field-has-method.rs b/tests/ui/suggestions/field-has-method.rs index 980000151..980000151 100644 --- a/src/test/ui/suggestions/field-has-method.rs +++ b/tests/ui/suggestions/field-has-method.rs diff --git a/src/test/ui/suggestions/field-has-method.stderr b/tests/ui/suggestions/field-has-method.stderr index def164017..def164017 100644 --- a/src/test/ui/suggestions/field-has-method.stderr +++ b/tests/ui/suggestions/field-has-method.stderr diff --git a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs b/tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs index 4303e5c54..4303e5c54 100644 --- a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs +++ b/tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs diff --git a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr index 955148315..955148315 100644 --- a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr +++ b/tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr diff --git a/src/test/ui/suggestions/fn-missing-lifetime-in-item.rs b/tests/ui/suggestions/fn-missing-lifetime-in-item.rs index dac6610b3..dac6610b3 100644 --- a/src/test/ui/suggestions/fn-missing-lifetime-in-item.rs +++ b/tests/ui/suggestions/fn-missing-lifetime-in-item.rs diff --git a/src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr b/tests/ui/suggestions/fn-missing-lifetime-in-item.stderr index 6d7c3d730..6d7c3d730 100644 --- a/src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr +++ b/tests/ui/suggestions/fn-missing-lifetime-in-item.stderr diff --git a/src/test/ui/suggestions/fn-needing-specified-return-type-param.rs b/tests/ui/suggestions/fn-needing-specified-return-type-param.rs index bcc91b5cb..bcc91b5cb 100644 --- a/src/test/ui/suggestions/fn-needing-specified-return-type-param.rs +++ b/tests/ui/suggestions/fn-needing-specified-return-type-param.rs diff --git a/src/test/ui/suggestions/fn-needing-specified-return-type-param.stderr b/tests/ui/suggestions/fn-needing-specified-return-type-param.stderr index 9dea667fb..9dea667fb 100644 --- a/src/test/ui/suggestions/fn-needing-specified-return-type-param.stderr +++ b/tests/ui/suggestions/fn-needing-specified-return-type-param.stderr diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs b/tests/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs index ae1dbfeea..ae1dbfeea 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs +++ b/tests/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-with-underscore-args.stderr b/tests/ui/suggestions/fn-or-tuple-struct-with-underscore-args.stderr index aa5620306..aa5620306 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-with-underscore-args.stderr +++ b/tests/ui/suggestions/fn-or-tuple-struct-with-underscore-args.stderr diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.rs b/tests/ui/suggestions/fn-or-tuple-struct-without-args.rs index dd5af3e34..dd5af3e34 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.rs +++ b/tests/ui/suggestions/fn-or-tuple-struct-without-args.rs diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr index d0ddb34d9..4cbcd31fa 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:29:20 | LL | fn foo(a: usize, b: usize) -> usize { a } - | ----------------------------------- fn(usize, usize) -> usize {foo} defined here + | ----------------------------------- function `foo` defined here ... LL | let _: usize = foo; | ----- ^^^ expected `usize`, found fn item @@ -20,15 +20,15 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:30:16 | LL | struct S(usize, usize); - | -------- fn(usize, usize) -> S {S} defined here + | -------- `S` defines a struct constructor here, which should be called ... LL | let _: S = S; - | - ^ expected struct `S`, found fn item + | - ^ expected struct `S`, found struct constructor | | | expected due to this | - = note: expected struct `S` - found fn item `fn(usize, usize) -> S {S}` + = note: expected struct `S` + found struct constructor `fn(usize, usize) -> S {S}` help: use parentheses to construct this tuple struct | LL | let _: S = S(/* usize */, /* usize */); @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:31:20 | LL | fn bar() -> usize { 42 } - | ----------------- fn() -> usize {bar} defined here + | ----------------- function `bar` defined here ... LL | let _: usize = bar; | ----- ^^^ expected `usize`, found fn item @@ -56,15 +56,15 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:32:16 | LL | struct V(); - | -------- fn() -> V {V} defined here + | -------- `V` defines a struct constructor here, which should be called ... LL | let _: V = V; - | - ^ expected struct `V`, found fn item + | - ^ expected struct `V`, found struct constructor | | | expected due to this | - = note: expected struct `V` - found fn item `fn() -> V {V}` + = note: expected struct `V` + found struct constructor `fn() -> V {V}` help: use parentheses to construct this tuple struct | LL | let _: V = V(); @@ -74,7 +74,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:33:20 | LL | fn baz(x: usize, y: usize) -> usize { x } - | ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here + | ----------------------------------- associated function `baz` defined here ... LL | let _: usize = T::baz; | ----- ^^^^^^ expected `usize`, found fn item @@ -92,7 +92,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:34:20 | LL | fn bat(x: usize) -> usize { 42 } - | ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here + | ------------------------- associated function `bat` defined here ... LL | let _: usize = T::bat; | ----- ^^^^^^ expected `usize`, found fn item @@ -110,15 +110,15 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:35:16 | LL | A(usize), - | - fn(usize) -> E {E::A} defined here + | - `A` defines an enum variant constructor here, which should be called ... LL | let _: E = E::A; - | - ^^^^ expected enum `E`, found fn item + | - ^^^^ expected enum `E`, found enum constructor | | | expected due to this | - = note: expected enum `E` - found fn item `fn(usize) -> E {E::A}` + = note: expected enum `E` + found enum constructor `fn(usize) -> E {E::A}` help: use parentheses to construct this tuple variant | LL | let _: E = E::A(/* usize */); @@ -134,7 +134,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:37:20 | LL | fn baz(x: usize, y: usize) -> usize { x } - | ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here + | ----------------------------------- associated function `baz` defined here ... LL | let _: usize = X::baz; | ----- ^^^^^^ expected `usize`, found fn item @@ -152,7 +152,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:38:20 | LL | fn bat(x: usize) -> usize { 42 } - | ------------------------- fn(usize) -> usize {<X as T>::bat} defined here + | ------------------------- associated function `bat` defined here ... LL | let _: usize = X::bat; | ----- ^^^^^^ expected `usize`, found fn item @@ -170,7 +170,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:39:20 | LL | fn bax(x: usize) -> usize { 42 } - | ------------------------- fn(usize) -> usize {<X as T>::bax} defined here + | ------------------------- associated function `bax` defined here ... LL | let _: usize = X::bax; | ----- ^^^^^^ expected `usize`, found fn item @@ -188,7 +188,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:40:20 | LL | fn bach(x: usize) -> usize; - | --------------------------- fn(usize) -> usize {<X as T>::bach} defined here + | --------------------------- associated function `bach` defined here ... LL | let _: usize = X::bach; | ----- ^^^^^^^ expected `usize`, found fn item @@ -206,7 +206,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:41:20 | LL | fn ban(&self) -> usize { 42 } - | ---------------------- for<'a> fn(&'a X) -> usize {<X as T>::ban} defined here + | ---------------------- associated function `ban` defined here ... LL | let _: usize = X::ban; | ----- ^^^^^^ expected `usize`, found fn item @@ -224,7 +224,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:42:20 | LL | fn bal(&self) -> usize; - | ----------------------- for<'a> fn(&'a X) -> usize {<X as T>::bal} defined here + | ----------------------- associated function `bal` defined here ... LL | let _: usize = X::bal; | ----- ^^^^^^ expected `usize`, found fn item diff --git a/tests/ui/suggestions/fn-to-method-deeply-nested.rs b/tests/ui/suggestions/fn-to-method-deeply-nested.rs new file mode 100644 index 000000000..58ee3d640 --- /dev/null +++ b/tests/ui/suggestions/fn-to-method-deeply-nested.rs @@ -0,0 +1,13 @@ +fn main() -> Result<(), ()> { + a(b(c(d(e( + //~^ ERROR cannot find function `a` in this scope + //~| ERROR cannot find function `b` in this scope + //~| ERROR cannot find function `c` in this scope + //~| ERROR cannot find function `d` in this scope + //~| ERROR cannot find function `e` in this scope + z???????????????????????????????????????????????????????????????????????????????????????? + ????????????????????????????????????????????????????????????????????????????????????????? + ?????????????????????????????????????????????????????????????????? + //~^^^ ERROR cannot find value `z` in this scope + ))))) +} diff --git a/tests/ui/suggestions/fn-to-method-deeply-nested.stderr b/tests/ui/suggestions/fn-to-method-deeply-nested.stderr new file mode 100644 index 000000000..ce813ea7a --- /dev/null +++ b/tests/ui/suggestions/fn-to-method-deeply-nested.stderr @@ -0,0 +1,39 @@ +error[E0425]: cannot find value `z` in this scope + --> $DIR/fn-to-method-deeply-nested.rs:8:9 + | +LL | z???????????????????????????????????????????????????????????????????????????????????????? + | ^ not found in this scope + +error[E0425]: cannot find function `e` in this scope + --> $DIR/fn-to-method-deeply-nested.rs:2:13 + | +LL | a(b(c(d(e( + | ^ not found in this scope + +error[E0425]: cannot find function `d` in this scope + --> $DIR/fn-to-method-deeply-nested.rs:2:11 + | +LL | a(b(c(d(e( + | ^ not found in this scope + +error[E0425]: cannot find function `c` in this scope + --> $DIR/fn-to-method-deeply-nested.rs:2:9 + | +LL | a(b(c(d(e( + | ^ not found in this scope + +error[E0425]: cannot find function `b` in this scope + --> $DIR/fn-to-method-deeply-nested.rs:2:7 + | +LL | a(b(c(d(e( + | ^ not found in this scope + +error[E0425]: cannot find function `a` in this scope + --> $DIR/fn-to-method-deeply-nested.rs:2:5 + | +LL | a(b(c(d(e( + | ^ not found in this scope + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/suggestions/fn-to-method.rs b/tests/ui/suggestions/fn-to-method.rs index 9a35c3efc..9a35c3efc 100644 --- a/src/test/ui/suggestions/fn-to-method.rs +++ b/tests/ui/suggestions/fn-to-method.rs diff --git a/src/test/ui/suggestions/fn-to-method.stderr b/tests/ui/suggestions/fn-to-method.stderr index 36c17e60d..36c17e60d 100644 --- a/src/test/ui/suggestions/fn-to-method.stderr +++ b/tests/ui/suggestions/fn-to-method.stderr diff --git a/src/test/ui/suggestions/fn-trait-notation.fixed b/tests/ui/suggestions/fn-trait-notation.fixed index cf940f4e9..cf940f4e9 100644 --- a/src/test/ui/suggestions/fn-trait-notation.fixed +++ b/tests/ui/suggestions/fn-trait-notation.fixed diff --git a/src/test/ui/suggestions/fn-trait-notation.rs b/tests/ui/suggestions/fn-trait-notation.rs index f0bb03315..f0bb03315 100644 --- a/src/test/ui/suggestions/fn-trait-notation.rs +++ b/tests/ui/suggestions/fn-trait-notation.rs diff --git a/src/test/ui/suggestions/fn-trait-notation.stderr b/tests/ui/suggestions/fn-trait-notation.stderr index 3e3b54174..3e3b54174 100644 --- a/src/test/ui/suggestions/fn-trait-notation.stderr +++ b/tests/ui/suggestions/fn-trait-notation.stderr diff --git a/src/test/ui/suggestions/for-i-in-vec.fixed b/tests/ui/suggestions/for-i-in-vec.fixed index 4f2007bef..4f2007bef 100644 --- a/src/test/ui/suggestions/for-i-in-vec.fixed +++ b/tests/ui/suggestions/for-i-in-vec.fixed diff --git a/src/test/ui/suggestions/for-i-in-vec.rs b/tests/ui/suggestions/for-i-in-vec.rs index 55fc7ad4e..55fc7ad4e 100644 --- a/src/test/ui/suggestions/for-i-in-vec.rs +++ b/tests/ui/suggestions/for-i-in-vec.rs diff --git a/src/test/ui/suggestions/for-i-in-vec.stderr b/tests/ui/suggestions/for-i-in-vec.stderr index 88be9e30a..c5b81e6b8 100644 --- a/src/test/ui/suggestions/for-i-in-vec.stderr +++ b/tests/ui/suggestions/for-i-in-vec.stderr @@ -7,11 +7,8 @@ LL | for _ in self.v { | `self.v` moved due to this implicit call to `.into_iter()` | move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves `self.v` +note: `into_iter` takes ownership of the receiver `self`, which moves `self.v` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec<u32>`'s content to avoid moving into the `for` loop | LL | for _ in &self.v { @@ -40,11 +37,8 @@ LL | for loader in *LOADERS { | value moved due to this implicit call to `.into_iter()` | move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves value +note: `into_iter` takes ownership of the receiver `self`, which moves value --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop | LL | for loader in &*LOADERS { diff --git a/src/test/ui/suggestions/format-borrow.rs b/tests/ui/suggestions/format-borrow.rs index 599a79fc0..599a79fc0 100644 --- a/src/test/ui/suggestions/format-borrow.rs +++ b/tests/ui/suggestions/format-borrow.rs diff --git a/src/test/ui/suggestions/format-borrow.stderr b/tests/ui/suggestions/format-borrow.stderr index 8ed2b9c9a..8ed2b9c9a 100644 --- a/src/test/ui/suggestions/format-borrow.stderr +++ b/tests/ui/suggestions/format-borrow.stderr diff --git a/src/test/ui/suggestions/if-let-typo.rs b/tests/ui/suggestions/if-let-typo.rs index 375bd3f03..375bd3f03 100644 --- a/src/test/ui/suggestions/if-let-typo.rs +++ b/tests/ui/suggestions/if-let-typo.rs diff --git a/src/test/ui/suggestions/if-let-typo.stderr b/tests/ui/suggestions/if-let-typo.stderr index 02148b7f7..02148b7f7 100644 --- a/src/test/ui/suggestions/if-let-typo.stderr +++ b/tests/ui/suggestions/if-let-typo.stderr diff --git a/src/test/ui/suggestions/if-then-neeing-semi.rs b/tests/ui/suggestions/if-then-neeing-semi.rs index b487f013d..b487f013d 100644 --- a/src/test/ui/suggestions/if-then-neeing-semi.rs +++ b/tests/ui/suggestions/if-then-neeing-semi.rs diff --git a/src/test/ui/suggestions/if-then-neeing-semi.stderr b/tests/ui/suggestions/if-then-neeing-semi.stderr index d7c5818ab..d7c5818ab 100644 --- a/src/test/ui/suggestions/if-then-neeing-semi.stderr +++ b/tests/ui/suggestions/if-then-neeing-semi.stderr diff --git a/src/test/ui/suggestions/ignore-nested-field-binding.fixed b/tests/ui/suggestions/ignore-nested-field-binding.fixed index 1dc44838e..1dc44838e 100644 --- a/src/test/ui/suggestions/ignore-nested-field-binding.fixed +++ b/tests/ui/suggestions/ignore-nested-field-binding.fixed diff --git a/src/test/ui/suggestions/ignore-nested-field-binding.rs b/tests/ui/suggestions/ignore-nested-field-binding.rs index 6dc0263ec..6dc0263ec 100644 --- a/src/test/ui/suggestions/ignore-nested-field-binding.rs +++ b/tests/ui/suggestions/ignore-nested-field-binding.rs diff --git a/src/test/ui/suggestions/ignore-nested-field-binding.stderr b/tests/ui/suggestions/ignore-nested-field-binding.stderr index b2936a22a..b2936a22a 100644 --- a/src/test/ui/suggestions/ignore-nested-field-binding.stderr +++ b/tests/ui/suggestions/ignore-nested-field-binding.stderr diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs b/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs index 319789c4e..319789c4e 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs +++ b/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr b/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr index 864ab0535..864ab0535 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr +++ b/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal.rs b/tests/ui/suggestions/imm-ref-trait-object-literal.rs index 22ca6dde4..22ca6dde4 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object-literal.rs +++ b/tests/ui/suggestions/imm-ref-trait-object-literal.rs diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr b/tests/ui/suggestions/imm-ref-trait-object-literal.stderr index e01102e38..e01102e38 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr +++ b/tests/ui/suggestions/imm-ref-trait-object-literal.stderr diff --git a/src/test/ui/suggestions/imm-ref-trait-object.rs b/tests/ui/suggestions/imm-ref-trait-object.rs index 288d6c699..c1c969b90 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object.rs +++ b/tests/ui/suggestions/imm-ref-trait-object.rs @@ -1,5 +1,5 @@ fn test(t: &dyn Iterator<Item=&u64>) -> u64 { - t.min().unwrap() //~ ERROR the `min` method cannot be invoked on a trait object + t.min().unwrap() //~ ERROR the `min` method cannot be invoked on `&dyn Iterator<Item = &u64>` } fn main() { diff --git a/tests/ui/suggestions/imm-ref-trait-object.stderr b/tests/ui/suggestions/imm-ref-trait-object.stderr new file mode 100644 index 000000000..f7f7902c1 --- /dev/null +++ b/tests/ui/suggestions/imm-ref-trait-object.stderr @@ -0,0 +1,13 @@ +error: the `min` method cannot be invoked on `&dyn Iterator<Item = &u64>` + --> $DIR/imm-ref-trait-object.rs:2:8 + | +LL | t.min().unwrap() + | ^^^ + | +help: you need `&mut dyn Iterator<Item = &u64>` instead of `&dyn Iterator<Item = &u64>` + | +LL | fn test(t: &mut dyn Iterator<Item=&u64>) -> u64 { + | +++ + +error: aborting due to previous error + diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs index 711cbbd38..711cbbd38 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs +++ b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr index 2dc300ac7..2dc300ac7 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr +++ b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs index ae3cd315c..ae3cd315c 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs +++ b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr index 679ebd61e..679ebd61e 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr +++ b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr diff --git a/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.rs b/tests/ui/suggestions/impl-trait-missing-lifetime-gated.rs index a1a51c481..a1a51c481 100644 --- a/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.rs +++ b/tests/ui/suggestions/impl-trait-missing-lifetime-gated.rs diff --git a/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr b/tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr index 50806a672..50806a672 100644 --- a/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr +++ b/tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr diff --git a/src/test/ui/suggestions/impl-trait-missing-lifetime.rs b/tests/ui/suggestions/impl-trait-missing-lifetime.rs index 6f7c912d7..6f7c912d7 100644 --- a/src/test/ui/suggestions/impl-trait-missing-lifetime.rs +++ b/tests/ui/suggestions/impl-trait-missing-lifetime.rs diff --git a/src/test/ui/suggestions/impl-trait-missing-lifetime.stderr b/tests/ui/suggestions/impl-trait-missing-lifetime.stderr index b476d6101..b476d6101 100644 --- a/src/test/ui/suggestions/impl-trait-missing-lifetime.stderr +++ b/tests/ui/suggestions/impl-trait-missing-lifetime.stderr diff --git a/src/test/ui/suggestions/impl-trait-return-trailing-semicolon.rs b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.rs index cd3741356..cd3741356 100644 --- a/src/test/ui/suggestions/impl-trait-return-trailing-semicolon.rs +++ b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.rs diff --git a/src/test/ui/suggestions/impl-trait-return-trailing-semicolon.stderr b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr index e74c2c421..e74c2c421 100644 --- a/src/test/ui/suggestions/impl-trait-return-trailing-semicolon.stderr +++ b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr diff --git a/src/test/ui/suggestions/impl-trait-with-missing-bounds.rs b/tests/ui/suggestions/impl-trait-with-missing-bounds.rs index 949b23600..949b23600 100644 --- a/src/test/ui/suggestions/impl-trait-with-missing-bounds.rs +++ b/tests/ui/suggestions/impl-trait-with-missing-bounds.rs diff --git a/src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr b/tests/ui/suggestions/impl-trait-with-missing-bounds.stderr index a763eb6f2..a763eb6f2 100644 --- a/src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr +++ b/tests/ui/suggestions/impl-trait-with-missing-bounds.stderr diff --git a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.fixed b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.fixed index 5109511f9..5109511f9 100644 --- a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.fixed +++ b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.fixed diff --git a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs index cd05b7738..cd05b7738 100644 --- a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs +++ b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs diff --git a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr index 20f8e65f7..20f8e65f7 100644 --- a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr +++ b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr diff --git a/src/test/ui/suggestions/import-trait-for-method-call.rs b/tests/ui/suggestions/import-trait-for-method-call.rs index 4dbadbdf9..4dbadbdf9 100644 --- a/src/test/ui/suggestions/import-trait-for-method-call.rs +++ b/tests/ui/suggestions/import-trait-for-method-call.rs diff --git a/src/test/ui/suggestions/import-trait-for-method-call.stderr b/tests/ui/suggestions/import-trait-for-method-call.stderr index bac8de798..f159b51a2 100644 --- a/src/test/ui/suggestions/import-trait-for-method-call.stderr +++ b/tests/ui/suggestions/import-trait-for-method-call.stderr @@ -3,11 +3,9 @@ error[E0599]: no method named `finish` found for struct `DefaultHasher` in the c | LL | h.finish() | ^^^^^^ method not found in `DefaultHasher` + --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL - | -LL | fn finish(&self) -> u64; - | ------ the method is available for `DefaultHasher` here + = note: the method is available for `DefaultHasher` here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: diff --git a/src/test/ui/suggestions/inner_type.fixed b/tests/ui/suggestions/inner_type.fixed index 7af7391ca..7af7391ca 100644 --- a/src/test/ui/suggestions/inner_type.fixed +++ b/tests/ui/suggestions/inner_type.fixed diff --git a/src/test/ui/suggestions/inner_type.rs b/tests/ui/suggestions/inner_type.rs index 4aca50716..4aca50716 100644 --- a/src/test/ui/suggestions/inner_type.rs +++ b/tests/ui/suggestions/inner_type.rs diff --git a/src/test/ui/suggestions/inner_type.stderr b/tests/ui/suggestions/inner_type.stderr index 5ac3d04f1..5ac3d04f1 100644 --- a/src/test/ui/suggestions/inner_type.stderr +++ b/tests/ui/suggestions/inner_type.stderr diff --git a/src/test/ui/suggestions/inner_type2.rs b/tests/ui/suggestions/inner_type2.rs index fac68c053..fac68c053 100644 --- a/src/test/ui/suggestions/inner_type2.rs +++ b/tests/ui/suggestions/inner_type2.rs diff --git a/src/test/ui/suggestions/inner_type2.stderr b/tests/ui/suggestions/inner_type2.stderr index 984366123..984366123 100644 --- a/src/test/ui/suggestions/inner_type2.stderr +++ b/tests/ui/suggestions/inner_type2.stderr diff --git a/src/test/ui/suggestions/into-convert.rs b/tests/ui/suggestions/into-convert.rs index 1c9a9e0aa..1c9a9e0aa 100644 --- a/src/test/ui/suggestions/into-convert.rs +++ b/tests/ui/suggestions/into-convert.rs diff --git a/src/test/ui/suggestions/into-convert.stderr b/tests/ui/suggestions/into-convert.stderr index d43104a21..d43104a21 100644 --- a/src/test/ui/suggestions/into-convert.stderr +++ b/tests/ui/suggestions/into-convert.stderr diff --git a/src/test/ui/suggestions/into-str.rs b/tests/ui/suggestions/into-str.rs index 606e44b2e..606e44b2e 100644 --- a/src/test/ui/suggestions/into-str.rs +++ b/tests/ui/suggestions/into-str.rs diff --git a/src/test/ui/suggestions/into-str.stderr b/tests/ui/suggestions/into-str.stderr index a56a2a188..a56a2a188 100644 --- a/src/test/ui/suggestions/into-str.stderr +++ b/tests/ui/suggestions/into-str.stderr diff --git a/src/test/ui/suggestions/invalid-bin-op.rs b/tests/ui/suggestions/invalid-bin-op.rs index bea1b9155..bea1b9155 100644 --- a/src/test/ui/suggestions/invalid-bin-op.rs +++ b/tests/ui/suggestions/invalid-bin-op.rs diff --git a/src/test/ui/suggestions/invalid-bin-op.stderr b/tests/ui/suggestions/invalid-bin-op.stderr index 08502dfeb..08502dfeb 100644 --- a/src/test/ui/suggestions/invalid-bin-op.stderr +++ b/tests/ui/suggestions/invalid-bin-op.stderr diff --git a/src/test/ui/suggestions/issue-101065.fixed b/tests/ui/suggestions/issue-101065.fixed index 88c716cc8..88c716cc8 100644 --- a/src/test/ui/suggestions/issue-101065.fixed +++ b/tests/ui/suggestions/issue-101065.fixed diff --git a/src/test/ui/suggestions/issue-101065.rs b/tests/ui/suggestions/issue-101065.rs index 2715f1027..2715f1027 100644 --- a/src/test/ui/suggestions/issue-101065.rs +++ b/tests/ui/suggestions/issue-101065.rs diff --git a/src/test/ui/suggestions/issue-101065.stderr b/tests/ui/suggestions/issue-101065.stderr index 6f7ecd24c..6f7ecd24c 100644 --- a/src/test/ui/suggestions/issue-101065.stderr +++ b/tests/ui/suggestions/issue-101065.stderr diff --git a/src/test/ui/suggestions/issue-101421.rs b/tests/ui/suggestions/issue-101421.rs index b615997d1..b615997d1 100644 --- a/src/test/ui/suggestions/issue-101421.rs +++ b/tests/ui/suggestions/issue-101421.rs diff --git a/src/test/ui/suggestions/issue-101421.stderr b/tests/ui/suggestions/issue-101421.stderr index f8e1efb88..f8e1efb88 100644 --- a/src/test/ui/suggestions/issue-101421.stderr +++ b/tests/ui/suggestions/issue-101421.stderr diff --git a/src/test/ui/suggestions/issue-101465.rs b/tests/ui/suggestions/issue-101465.rs index 8e42e2c22..8e42e2c22 100644 --- a/src/test/ui/suggestions/issue-101465.rs +++ b/tests/ui/suggestions/issue-101465.rs diff --git a/src/test/ui/suggestions/issue-101465.stderr b/tests/ui/suggestions/issue-101465.stderr index e2ca77712..e2ca77712 100644 --- a/src/test/ui/suggestions/issue-101465.stderr +++ b/tests/ui/suggestions/issue-101465.stderr diff --git a/src/test/ui/suggestions/issue-101623.rs b/tests/ui/suggestions/issue-101623.rs index d18a4a21f..d18a4a21f 100644 --- a/src/test/ui/suggestions/issue-101623.rs +++ b/tests/ui/suggestions/issue-101623.rs diff --git a/src/test/ui/suggestions/issue-101623.stderr b/tests/ui/suggestions/issue-101623.stderr index 361483cc0..361483cc0 100644 --- a/src/test/ui/suggestions/issue-101623.stderr +++ b/tests/ui/suggestions/issue-101623.stderr diff --git a/src/test/ui/suggestions/issue-101984.rs b/tests/ui/suggestions/issue-101984.rs index 5f7ecb77e..5f7ecb77e 100644 --- a/src/test/ui/suggestions/issue-101984.rs +++ b/tests/ui/suggestions/issue-101984.rs diff --git a/src/test/ui/suggestions/issue-101984.stderr b/tests/ui/suggestions/issue-101984.stderr index 81758a700..81758a700 100644 --- a/src/test/ui/suggestions/issue-101984.stderr +++ b/tests/ui/suggestions/issue-101984.stderr diff --git a/src/test/ui/suggestions/issue-102354.rs b/tests/ui/suggestions/issue-102354.rs index f881feb00..f881feb00 100644 --- a/src/test/ui/suggestions/issue-102354.rs +++ b/tests/ui/suggestions/issue-102354.rs diff --git a/src/test/ui/suggestions/issue-102354.stderr b/tests/ui/suggestions/issue-102354.stderr index 08d4b9955..08d4b9955 100644 --- a/src/test/ui/suggestions/issue-102354.stderr +++ b/tests/ui/suggestions/issue-102354.stderr diff --git a/src/test/ui/suggestions/issue-102892.rs b/tests/ui/suggestions/issue-102892.rs index c1a791d8d..c1a791d8d 100644 --- a/src/test/ui/suggestions/issue-102892.rs +++ b/tests/ui/suggestions/issue-102892.rs diff --git a/src/test/ui/suggestions/issue-102892.stderr b/tests/ui/suggestions/issue-102892.stderr index a3dbc7cb8..a3dbc7cb8 100644 --- a/src/test/ui/suggestions/issue-102892.stderr +++ b/tests/ui/suggestions/issue-102892.stderr diff --git a/src/test/ui/suggestions/issue-103112.rs b/tests/ui/suggestions/issue-103112.rs index 111ae7c73..111ae7c73 100644 --- a/src/test/ui/suggestions/issue-103112.rs +++ b/tests/ui/suggestions/issue-103112.rs diff --git a/src/test/ui/suggestions/issue-103112.stderr b/tests/ui/suggestions/issue-103112.stderr index 4ca7fdf9b..4ca7fdf9b 100644 --- a/src/test/ui/suggestions/issue-103112.stderr +++ b/tests/ui/suggestions/issue-103112.stderr diff --git a/src/test/ui/suggestions/issue-104086-suggest-let.rs b/tests/ui/suggestions/issue-104086-suggest-let.rs index d22ad27d0..d22ad27d0 100644 --- a/src/test/ui/suggestions/issue-104086-suggest-let.rs +++ b/tests/ui/suggestions/issue-104086-suggest-let.rs diff --git a/src/test/ui/suggestions/issue-104086-suggest-let.stderr b/tests/ui/suggestions/issue-104086-suggest-let.stderr index fb4ea3121..fb4ea3121 100644 --- a/src/test/ui/suggestions/issue-104086-suggest-let.stderr +++ b/tests/ui/suggestions/issue-104086-suggest-let.stderr diff --git a/tests/ui/suggestions/issue-104287.rs b/tests/ui/suggestions/issue-104287.rs new file mode 100644 index 000000000..e3fa22a8f --- /dev/null +++ b/tests/ui/suggestions/issue-104287.rs @@ -0,0 +1,13 @@ +// The purpose of this test is not to validate the output of the compiler. +// Instead, it ensures the suggestion is generated without performing an arithmetic overflow. + +struct S; +impl S { + fn foo(&self) {} +} +fn main() { + let x = S; + foo::<()>(x); + //~^ ERROR this associated function takes 0 generic arguments but 1 generic argument was supplied + //~| ERROR cannot find function `foo` in this scope +} diff --git a/tests/ui/suggestions/issue-104287.stderr b/tests/ui/suggestions/issue-104287.stderr new file mode 100644 index 000000000..602a01828 --- /dev/null +++ b/tests/ui/suggestions/issue-104287.stderr @@ -0,0 +1,30 @@ +error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied + --> $DIR/issue-104287.rs:10:5 + | +LL | foo::<()>(x); + | ^^^------ help: remove these generics + | | + | expected 0 generic arguments + | +note: associated function defined here, with 0 generic parameters + --> $DIR/issue-104287.rs:6:8 + | +LL | fn foo(&self) {} + | ^^^ + +error[E0425]: cannot find function `foo` in this scope + --> $DIR/issue-104287.rs:10:5 + | +LL | foo::<()>(x); + | ^^^ not found in this scope + | +help: use the `.` operator to call the method `foo` on `&S` + | +LL - foo::<()>(x); +LL + x.foo(); + | + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0107, E0425. +For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/suggestions/issue-104327.rs b/tests/ui/suggestions/issue-104327.rs new file mode 100644 index 000000000..dd621ae71 --- /dev/null +++ b/tests/ui/suggestions/issue-104327.rs @@ -0,0 +1,12 @@ +trait Bar {} + +trait Foo { + fn f() {} +} + +impl Foo for dyn Bar {} + +fn main() { + Foo::f(); + //~^ ERROR cannot call associated function on trait without specifying the corresponding `impl` type +} diff --git a/tests/ui/suggestions/issue-104327.stderr b/tests/ui/suggestions/issue-104327.stderr new file mode 100644 index 000000000..acec3a55d --- /dev/null +++ b/tests/ui/suggestions/issue-104327.stderr @@ -0,0 +1,17 @@ +error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type + --> $DIR/issue-104327.rs:10:5 + | +LL | fn f() {} + | --------- `Foo::f` defined here +... +LL | Foo::f(); + | ^^^^^^ cannot call associated function of trait + | +help: use the fully-qualified path to the only available implementation + | +LL | <(dyn Bar + 'static) as Foo>::f(); + | +++++++++++++++++++++++ + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0790`. diff --git a/tests/ui/suggestions/issue-104328.rs b/tests/ui/suggestions/issue-104328.rs new file mode 100644 index 000000000..c3707baf7 --- /dev/null +++ b/tests/ui/suggestions/issue-104328.rs @@ -0,0 +1,12 @@ +#![feature(object_safe_for_dispatch)] + +trait Foo { + fn f() {} +} + +impl Foo for dyn Sized {} + +fn main() { + Foo::f(); + //~^ ERROR cannot call associated function on trait without specifying the corresponding `impl` type +} diff --git a/tests/ui/suggestions/issue-104328.stderr b/tests/ui/suggestions/issue-104328.stderr new file mode 100644 index 000000000..b31b84781 --- /dev/null +++ b/tests/ui/suggestions/issue-104328.stderr @@ -0,0 +1,17 @@ +error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type + --> $DIR/issue-104328.rs:10:5 + | +LL | fn f() {} + | --------- `Foo::f` defined here +... +LL | Foo::f(); + | ^^^^^^ cannot call associated function of trait + | +help: use the fully-qualified path to the only available implementation + | +LL | <(dyn Sized + 'static) as Foo>::f(); + | +++++++++++++++++++++++++ + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0790`. diff --git a/tests/ui/suggestions/issue-105226.rs b/tests/ui/suggestions/issue-105226.rs new file mode 100644 index 000000000..f123dbf4c --- /dev/null +++ b/tests/ui/suggestions/issue-105226.rs @@ -0,0 +1,22 @@ +use std::fmt; + +struct S { +} + +impl S { + fn hello<P>(&self, val: &P) where P: fmt::Display; { + //~^ ERROR non-item in item list + //~| ERROR associated function in `impl` without body + println!("val: {}", val); + } +} + +impl S { + fn hello_empty<P>(&self, val: &P) where P: fmt::Display; + //~^ ERROR associated function in `impl` without body +} + +fn main() { + let s = S{}; + s.hello(&32); +} diff --git a/tests/ui/suggestions/issue-105226.stderr b/tests/ui/suggestions/issue-105226.stderr new file mode 100644 index 000000000..f16a80901 --- /dev/null +++ b/tests/ui/suggestions/issue-105226.stderr @@ -0,0 +1,31 @@ +error: non-item in item list + --> $DIR/issue-105226.rs:7:56 + | +LL | impl S { + | - item list starts here +LL | fn hello<P>(&self, val: &P) where P: fmt::Display; { + | - ^ non-item starts here + | | + | help: consider removing this semicolon +... +LL | } + | - item list ends here + +error: associated function in `impl` without body + --> $DIR/issue-105226.rs:7:5 + | +LL | fn hello<P>(&self, val: &P) where P: fmt::Display; { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | help: provide a definition for the function: `{ <body> }` + +error: associated function in `impl` without body + --> $DIR/issue-105226.rs:15:5 + | +LL | fn hello_empty<P>(&self, val: &P) where P: fmt::Display; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | help: provide a definition for the function: `{ <body> }` + +error: aborting due to 3 previous errors + diff --git a/tests/ui/suggestions/issue-105494.rs b/tests/ui/suggestions/issue-105494.rs new file mode 100644 index 000000000..8b409232c --- /dev/null +++ b/tests/ui/suggestions/issue-105494.rs @@ -0,0 +1,22 @@ +fn test1() { + let _v: i32 = (1 as i32).to_string(); //~ ERROR mismatched types + + // won't suggestion + let _v: i32 = (1 as i128).to_string(); //~ ERROR mismatched types + + let _v: &str = "foo".to_string(); //~ ERROR mismatched types +} + +fn test2() { + let mut path: String = "/usr".to_string(); + let folder: String = "lib".to_string(); + + path = format!("{}/{}", path, folder).as_str(); //~ ERROR mismatched types + + println!("{}", &path); +} + +fn main() { + test1(); + test2(); +} diff --git a/tests/ui/suggestions/issue-105494.stderr b/tests/ui/suggestions/issue-105494.stderr new file mode 100644 index 000000000..5aa3f2af7 --- /dev/null +++ b/tests/ui/suggestions/issue-105494.stderr @@ -0,0 +1,54 @@ +error[E0308]: mismatched types + --> $DIR/issue-105494.rs:2:19 + | +LL | let _v: i32 = (1 as i32).to_string(); + | --- ^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String` + | | + | expected due to this + | +help: try removing the method call + | +LL - let _v: i32 = (1 as i32).to_string(); +LL + let _v: i32 = (1 as i32); + | + +error[E0308]: mismatched types + --> $DIR/issue-105494.rs:5:19 + | +LL | let _v: i32 = (1 as i128).to_string(); + | --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String` + | | + | expected due to this + +error[E0308]: mismatched types + --> $DIR/issue-105494.rs:7:20 + | +LL | let _v: &str = "foo".to_string(); + | ---- ^^^^^^^^^^^^^^^^^ expected `&str`, found struct `String` + | | + | expected due to this + | +help: try removing the method call + | +LL - let _v: &str = "foo".to_string(); +LL + let _v: &str = "foo"; + | + +error[E0308]: mismatched types + --> $DIR/issue-105494.rs:14:12 + | +LL | let mut path: String = "/usr".to_string(); + | ------ expected due to this type +... +LL | path = format!("{}/{}", path, folder).as_str(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&str` + | +help: try removing the method call + | +LL - path = format!("{}/{}", path, folder).as_str(); +LL + path = format!("{}/{}", path, folder); + | + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/suggestions/issue-105645.rs b/tests/ui/suggestions/issue-105645.rs new file mode 100644 index 000000000..681ce1c6e --- /dev/null +++ b/tests/ui/suggestions/issue-105645.rs @@ -0,0 +1,8 @@ +fn main() { + let mut buf = [0u8; 50]; + let mut bref = buf.as_slice(); + foo(&mut bref); + //~^ ERROR 4:9: 4:18: the trait bound `&[u8]: std::io::Write` is not satisfied [E0277] +} + +fn foo(_: &mut impl std::io::Write) {} diff --git a/tests/ui/suggestions/issue-105645.stderr b/tests/ui/suggestions/issue-105645.stderr new file mode 100644 index 000000000..895f5ffd1 --- /dev/null +++ b/tests/ui/suggestions/issue-105645.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `&[u8]: std::io::Write` is not satisfied + --> $DIR/issue-105645.rs:4:9 + | +LL | foo(&mut bref); + | --- ^^^^^^^^^ the trait `std::io::Write` is not implemented for `&[u8]` + | | + | required by a bound introduced by this call + | + = help: the trait `std::io::Write` is implemented for `&mut [u8]` +note: required by a bound in `foo` + --> $DIR/issue-105645.rs:8:21 + | +LL | fn foo(_: &mut impl std::io::Write) {} + | ^^^^^^^^^^^^^^ required by this bound in `foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed new file mode 100644 index 000000000..78e48364b --- /dev/null +++ b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed @@ -0,0 +1,28 @@ +//run-rustfix +#![allow(unused)] + +struct S; +impl S { + fn foo(&mut self) { + let x = |this: &Self, v: i32| { + this.bar(); + this.hel(); + }; + self.qux(); //~ ERROR cannot borrow `*self` as mutable because it is also borrowed as immutable + x(self, 1); + x(self, 3); + } + fn bar(&self) {} + fn hel(&self) {} + fn qux(&mut self) {} + + fn hello(&mut self) { + let y = |this: &Self| { + this.bar(); + }; + self.qux(); //~ ERROR cannot borrow `*self` as mutable because it is also borrowed as immutable + y(self); + } +} + +fn main() {} diff --git a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs new file mode 100644 index 000000000..6d8a9ffc1 --- /dev/null +++ b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs @@ -0,0 +1,28 @@ +//run-rustfix +#![allow(unused)] + +struct S; +impl S { + fn foo(&mut self) { + let x = |v: i32| { + self.bar(); + self.hel(); + }; + self.qux(); //~ ERROR cannot borrow `*self` as mutable because it is also borrowed as immutable + x(1); + x(3); + } + fn bar(&self) {} + fn hel(&self) {} + fn qux(&mut self) {} + + fn hello(&mut self) { + let y = || { + self.bar(); + }; + self.qux(); //~ ERROR cannot borrow `*self` as mutable because it is also borrowed as immutable + y(); + } +} + +fn main() {} diff --git a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr new file mode 100644 index 000000000..bc97d32eb --- /dev/null +++ b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr @@ -0,0 +1,49 @@ +error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable + --> $DIR/issue-105761-suggest-self-for-closure.rs:11:9 + | +LL | let x = |v: i32| { + | -------- immutable borrow occurs here +LL | self.bar(); + | ---- first borrow occurs due to use of `self` in closure +... +LL | self.qux(); + | ^^^^^^^^^^ mutable borrow occurs here +LL | x(1); + | - immutable borrow later used here + | +help: try explicitly pass `&Self` into the Closure as an argument + | +LL ~ let x = |this: &Self, v: i32| { +LL ~ this.bar(); +LL ~ this.hel(); +LL | }; +LL | self.qux(); +LL ~ x(self, 1); +LL ~ x(self, 3); + | + +error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable + --> $DIR/issue-105761-suggest-self-for-closure.rs:23:9 + | +LL | let y = || { + | -- immutable borrow occurs here +LL | self.bar(); + | ---- first borrow occurs due to use of `self` in closure +LL | }; +LL | self.qux(); + | ^^^^^^^^^^ mutable borrow occurs here +LL | y(); + | - immutable borrow later used here + | +help: try explicitly pass `&Self` into the Closure as an argument + | +LL ~ let y = |this: &Self| { +LL ~ this.bar(); +LL | }; +LL | self.qux(); +LL ~ y(self); + | + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs new file mode 100644 index 000000000..48efdb82c --- /dev/null +++ b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs @@ -0,0 +1,23 @@ +#[derive(Clone)] +struct S; + +// without Clone +struct T; + +fn foo(_: S) {} + +fn test1() { + let s = &S; + foo(s); //~ ERROR mismatched types +} + +fn bar(_: T) {} +fn test2() { + let t = &T; + bar(t); //~ ERROR mismatched types +} + +fn main() { + test1(); + test2(); +} diff --git a/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr new file mode 100644 index 000000000..1e66fe3af --- /dev/null +++ b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr @@ -0,0 +1,35 @@ +error[E0308]: mismatched types + --> $DIR/issue-106443-sugg-clone-for-arg.rs:11:9 + | +LL | foo(s); + | --- ^ expected struct `S`, found `&S` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/issue-106443-sugg-clone-for-arg.rs:7:4 + | +LL | fn foo(_: S) {} + | ^^^ ---- +help: consider using clone here + | +LL | foo(s.clone()); + | ++++++++ + +error[E0308]: mismatched types + --> $DIR/issue-106443-sugg-clone-for-arg.rs:17:9 + | +LL | bar(t); + | --- ^ expected struct `T`, found `&T` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/issue-106443-sugg-clone-for-arg.rs:14:4 + | +LL | fn bar(_: T) {} + | ^^^ ---- + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/suggestions/issue-106443-sugg-clone-for-bound.rs b/tests/ui/suggestions/issue-106443-sugg-clone-for-bound.rs new file mode 100644 index 000000000..3b2e316b2 --- /dev/null +++ b/tests/ui/suggestions/issue-106443-sugg-clone-for-bound.rs @@ -0,0 +1,20 @@ +#[derive(Clone)] +struct S; + +trait X {} + +impl X for S {} + +fn foo<T: X>(_: T) {} +fn bar<T: X>(s: &T) { + foo(s); //~ ERROR the trait bound `&T: X` is not satisfied +} + +fn bar_with_clone<T: X + Clone>(s: &T) { + foo(s); //~ ERROR the trait bound `&T: X` is not satisfied +} + +fn main() { + let s = &S; + bar(s); +} diff --git a/tests/ui/suggestions/issue-106443-sugg-clone-for-bound.stderr b/tests/ui/suggestions/issue-106443-sugg-clone-for-bound.stderr new file mode 100644 index 000000000..8607917ed --- /dev/null +++ b/tests/ui/suggestions/issue-106443-sugg-clone-for-bound.stderr @@ -0,0 +1,29 @@ +error[E0277]: the trait bound `&T: X` is not satisfied + --> $DIR/issue-106443-sugg-clone-for-bound.rs:10:9 + | +LL | foo(s); + | ^ the trait `X` is not implemented for `&T` + | +help: consider further restricting this bound + | +LL | fn bar<T: X + Clone>(s: &T) { + | +++++++ +help: consider using clone here + | +LL | foo(s.clone()); + | ++++++++ + +error[E0277]: the trait bound `&T: X` is not satisfied + --> $DIR/issue-106443-sugg-clone-for-bound.rs:14:9 + | +LL | foo(s); + | ^ the trait `X` is not implemented for `&T` + | +help: consider using clone here + | +LL | foo(s.clone()); + | ++++++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/suggestions/issue-21673.rs b/tests/ui/suggestions/issue-21673.rs index 9d66cae05..9d66cae05 100644 --- a/src/test/ui/suggestions/issue-21673.rs +++ b/tests/ui/suggestions/issue-21673.rs diff --git a/src/test/ui/suggestions/issue-21673.stderr b/tests/ui/suggestions/issue-21673.stderr index 523d7a7cc..523d7a7cc 100644 --- a/src/test/ui/suggestions/issue-21673.stderr +++ b/tests/ui/suggestions/issue-21673.stderr diff --git a/src/test/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs b/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs index 37f078285..37f078285 100644 --- a/src/test/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs +++ b/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs diff --git a/src/test/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr b/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr index 438075083..438075083 100644 --- a/src/test/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr +++ b/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr diff --git a/src/test/ui/suggestions/issue-52820.fixed b/tests/ui/suggestions/issue-52820.fixed index 514690de4..514690de4 100644 --- a/src/test/ui/suggestions/issue-52820.fixed +++ b/tests/ui/suggestions/issue-52820.fixed diff --git a/src/test/ui/suggestions/issue-52820.rs b/tests/ui/suggestions/issue-52820.rs index 17cd9224c..17cd9224c 100644 --- a/src/test/ui/suggestions/issue-52820.rs +++ b/tests/ui/suggestions/issue-52820.rs diff --git a/src/test/ui/suggestions/issue-52820.stderr b/tests/ui/suggestions/issue-52820.stderr index 09269ed4e..09269ed4e 100644 --- a/src/test/ui/suggestions/issue-52820.stderr +++ b/tests/ui/suggestions/issue-52820.stderr diff --git a/src/test/ui/suggestions/issue-53692.fixed b/tests/ui/suggestions/issue-53692.fixed index 35a677b47..35a677b47 100644 --- a/src/test/ui/suggestions/issue-53692.fixed +++ b/tests/ui/suggestions/issue-53692.fixed diff --git a/src/test/ui/suggestions/issue-53692.rs b/tests/ui/suggestions/issue-53692.rs index 6f6707be5..6f6707be5 100644 --- a/src/test/ui/suggestions/issue-53692.rs +++ b/tests/ui/suggestions/issue-53692.rs diff --git a/src/test/ui/suggestions/issue-53692.stderr b/tests/ui/suggestions/issue-53692.stderr index 3a1b624f4..3a1b624f4 100644 --- a/src/test/ui/suggestions/issue-53692.stderr +++ b/tests/ui/suggestions/issue-53692.stderr diff --git a/src/test/ui/suggestions/issue-57672.rs b/tests/ui/suggestions/issue-57672.rs index ee999d83e..ee999d83e 100644 --- a/src/test/ui/suggestions/issue-57672.rs +++ b/tests/ui/suggestions/issue-57672.rs diff --git a/src/test/ui/suggestions/issue-59819.fixed b/tests/ui/suggestions/issue-59819.fixed index 644d2a4e4..644d2a4e4 100644 --- a/src/test/ui/suggestions/issue-59819.fixed +++ b/tests/ui/suggestions/issue-59819.fixed diff --git a/src/test/ui/suggestions/issue-59819.rs b/tests/ui/suggestions/issue-59819.rs index 8e8ff8372..8e8ff8372 100644 --- a/src/test/ui/suggestions/issue-59819.rs +++ b/tests/ui/suggestions/issue-59819.rs diff --git a/src/test/ui/suggestions/issue-59819.stderr b/tests/ui/suggestions/issue-59819.stderr index 40e4c7b78..40e4c7b78 100644 --- a/src/test/ui/suggestions/issue-59819.stderr +++ b/tests/ui/suggestions/issue-59819.stderr diff --git a/src/test/ui/suggestions/issue-61226.fixed b/tests/ui/suggestions/issue-61226.fixed index 6e9d74344..6e9d74344 100644 --- a/src/test/ui/suggestions/issue-61226.fixed +++ b/tests/ui/suggestions/issue-61226.fixed diff --git a/src/test/ui/suggestions/issue-61226.rs b/tests/ui/suggestions/issue-61226.rs index 695fe7341..695fe7341 100644 --- a/src/test/ui/suggestions/issue-61226.rs +++ b/tests/ui/suggestions/issue-61226.rs diff --git a/src/test/ui/suggestions/issue-61226.stderr b/tests/ui/suggestions/issue-61226.stderr index cda962a90..cda962a90 100644 --- a/src/test/ui/suggestions/issue-61226.stderr +++ b/tests/ui/suggestions/issue-61226.stderr diff --git a/src/test/ui/suggestions/issue-61963.rs b/tests/ui/suggestions/issue-61963.rs index a27c38452..a27c38452 100644 --- a/src/test/ui/suggestions/issue-61963.rs +++ b/tests/ui/suggestions/issue-61963.rs diff --git a/src/test/ui/suggestions/issue-61963.stderr b/tests/ui/suggestions/issue-61963.stderr index b99b1b0b9..b99b1b0b9 100644 --- a/src/test/ui/suggestions/issue-61963.stderr +++ b/tests/ui/suggestions/issue-61963.stderr diff --git a/src/test/ui/suggestions/issue-62843.rs b/tests/ui/suggestions/issue-62843.rs index d96b12fd1..d96b12fd1 100644 --- a/src/test/ui/suggestions/issue-62843.rs +++ b/tests/ui/suggestions/issue-62843.rs diff --git a/src/test/ui/suggestions/issue-62843.stderr b/tests/ui/suggestions/issue-62843.stderr index 62f0943d4..b6e271de8 100644 --- a/src/test/ui/suggestions/issue-62843.stderr +++ b/tests/ui/suggestions/issue-62843.stderr @@ -10,9 +10,6 @@ LL | println!("{:?}", line.find(pattern)); = note: required for `String` to implement `Pattern<'_>` note: required by a bound in `core::str::<impl str>::find` --> $SRC_DIR/core/src/str/mod.rs:LL:COL - | -LL | pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> { - | ^^^^^^^^^^^ required by this bound in `core::str::<impl str>::find` help: consider borrowing here | LL | println!("{:?}", line.find(&pattern)); diff --git a/src/test/ui/suggestions/issue-64252-self-type.rs b/tests/ui/suggestions/issue-64252-self-type.rs index 128d5e85c..128d5e85c 100644 --- a/src/test/ui/suggestions/issue-64252-self-type.rs +++ b/tests/ui/suggestions/issue-64252-self-type.rs diff --git a/src/test/ui/suggestions/issue-64252-self-type.stderr b/tests/ui/suggestions/issue-64252-self-type.stderr index c3418dab0..c3418dab0 100644 --- a/src/test/ui/suggestions/issue-64252-self-type.stderr +++ b/tests/ui/suggestions/issue-64252-self-type.stderr diff --git a/src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs b/tests/ui/suggestions/issue-66968-suggest-sorted-words.rs index 440bb653a..440bb653a 100644 --- a/src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs +++ b/tests/ui/suggestions/issue-66968-suggest-sorted-words.rs diff --git a/src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr b/tests/ui/suggestions/issue-66968-suggest-sorted-words.stderr index d7b33ea41..d7b33ea41 100644 --- a/src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr +++ b/tests/ui/suggestions/issue-66968-suggest-sorted-words.stderr diff --git a/src/test/ui/suggestions/issue-68049-1.rs b/tests/ui/suggestions/issue-68049-1.rs index 0acb7b1bf..0acb7b1bf 100644 --- a/src/test/ui/suggestions/issue-68049-1.rs +++ b/tests/ui/suggestions/issue-68049-1.rs diff --git a/src/test/ui/suggestions/issue-68049-1.stderr b/tests/ui/suggestions/issue-68049-1.stderr index 7f931f0cd..7f931f0cd 100644 --- a/src/test/ui/suggestions/issue-68049-1.stderr +++ b/tests/ui/suggestions/issue-68049-1.stderr diff --git a/src/test/ui/suggestions/issue-68049-2.rs b/tests/ui/suggestions/issue-68049-2.rs index 1c3430c14..1c3430c14 100644 --- a/src/test/ui/suggestions/issue-68049-2.rs +++ b/tests/ui/suggestions/issue-68049-2.rs diff --git a/tests/ui/suggestions/issue-68049-2.stderr b/tests/ui/suggestions/issue-68049-2.stderr new file mode 100644 index 000000000..de35aa5b1 --- /dev/null +++ b/tests/ui/suggestions/issue-68049-2.stderr @@ -0,0 +1,25 @@ +error[E0594]: cannot assign to `*input`, which is behind a `&` reference + --> $DIR/issue-68049-2.rs:9:7 + | +LL | *input = self.0; + | ^^^^^^^^^^^^^^^ `input` is a `&` reference, so the data it refers to cannot be written + | +help: consider changing that to be a mutable reference + | +LL | fn example(&self, input: &mut i32); // should suggest here + | ~~~~~~~~ + +error[E0594]: cannot assign to `self.0`, which is behind a `&` reference + --> $DIR/issue-68049-2.rs:17:5 + | +LL | self.0 += *input; + | ^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written + | +help: consider changing that to be a mutable reference + | +LL | fn example(&mut self, input: &i32); // should suggest here + | ~~~~~~~~~ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/suggestions/issue-71394-no-from-impl.rs b/tests/ui/suggestions/issue-71394-no-from-impl.rs index 0c35deb51..0c35deb51 100644 --- a/src/test/ui/suggestions/issue-71394-no-from-impl.rs +++ b/tests/ui/suggestions/issue-71394-no-from-impl.rs diff --git a/tests/ui/suggestions/issue-71394-no-from-impl.stderr b/tests/ui/suggestions/issue-71394-no-from-impl.stderr new file mode 100644 index 000000000..a5e6f5b5f --- /dev/null +++ b/tests/ui/suggestions/issue-71394-no-from-impl.stderr @@ -0,0 +1,14 @@ +error[E0277]: the trait bound `&[i8]: From<&[u8]>` is not satisfied + --> $DIR/issue-71394-no-from-impl.rs:3:25 + | +LL | let _: &[i8] = data.into(); + | ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]` + | + = help: the following other types implement trait `From<T>`: + <[T; LANES] as From<Simd<T, LANES>>> + <[bool; LANES] as From<Mask<T, LANES>>> + = note: required for `&[u8]` to implement `Into<&[i8]>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/suggestions/issue-72766.rs b/tests/ui/suggestions/issue-72766.rs index c54be7f5d..c54be7f5d 100644 --- a/src/test/ui/suggestions/issue-72766.rs +++ b/tests/ui/suggestions/issue-72766.rs diff --git a/src/test/ui/suggestions/issue-72766.stderr b/tests/ui/suggestions/issue-72766.stderr index f257bb9b0..f257bb9b0 100644 --- a/src/test/ui/suggestions/issue-72766.stderr +++ b/tests/ui/suggestions/issue-72766.stderr diff --git a/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs b/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs index 3cd6d336e..3cd6d336e 100644 --- a/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs +++ b/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs diff --git a/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr b/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr index a3ab0b8ef..a3ab0b8ef 100644 --- a/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr +++ b/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr diff --git a/src/test/ui/suggestions/issue-81098.rs b/tests/ui/suggestions/issue-81098.rs index a601b5866..a601b5866 100644 --- a/src/test/ui/suggestions/issue-81098.rs +++ b/tests/ui/suggestions/issue-81098.rs diff --git a/src/test/ui/suggestions/issue-81098.stderr b/tests/ui/suggestions/issue-81098.stderr index 4dc47a202..4dc47a202 100644 --- a/src/test/ui/suggestions/issue-81098.stderr +++ b/tests/ui/suggestions/issue-81098.stderr diff --git a/src/test/ui/suggestions/issue-81839.rs b/tests/ui/suggestions/issue-81839.rs index 0b9b7aefe..0b9b7aefe 100644 --- a/src/test/ui/suggestions/issue-81839.rs +++ b/tests/ui/suggestions/issue-81839.rs diff --git a/src/test/ui/suggestions/issue-81839.stderr b/tests/ui/suggestions/issue-81839.stderr index fae474ced..fae474ced 100644 --- a/src/test/ui/suggestions/issue-81839.stderr +++ b/tests/ui/suggestions/issue-81839.stderr diff --git a/src/test/ui/suggestions/issue-82361.fixed b/tests/ui/suggestions/issue-82361.fixed index d72de982b..d72de982b 100644 --- a/src/test/ui/suggestions/issue-82361.fixed +++ b/tests/ui/suggestions/issue-82361.fixed diff --git a/src/test/ui/suggestions/issue-82361.rs b/tests/ui/suggestions/issue-82361.rs index c068f6d22..c068f6d22 100644 --- a/src/test/ui/suggestions/issue-82361.rs +++ b/tests/ui/suggestions/issue-82361.rs diff --git a/src/test/ui/suggestions/issue-82361.stderr b/tests/ui/suggestions/issue-82361.stderr index e4e8ad15d..e4e8ad15d 100644 --- a/src/test/ui/suggestions/issue-82361.stderr +++ b/tests/ui/suggestions/issue-82361.stderr diff --git a/src/test/ui/suggestions/issue-82566-1.rs b/tests/ui/suggestions/issue-82566-1.rs index 95c31fbaa..95c31fbaa 100644 --- a/src/test/ui/suggestions/issue-82566-1.rs +++ b/tests/ui/suggestions/issue-82566-1.rs diff --git a/src/test/ui/suggestions/issue-82566-1.stderr b/tests/ui/suggestions/issue-82566-1.stderr index 72f0f45fb..72f0f45fb 100644 --- a/src/test/ui/suggestions/issue-82566-1.stderr +++ b/tests/ui/suggestions/issue-82566-1.stderr diff --git a/src/test/ui/suggestions/issue-82566-2.rs b/tests/ui/suggestions/issue-82566-2.rs index 80c8034bd..80c8034bd 100644 --- a/src/test/ui/suggestions/issue-82566-2.rs +++ b/tests/ui/suggestions/issue-82566-2.rs diff --git a/src/test/ui/suggestions/issue-82566-2.stderr b/tests/ui/suggestions/issue-82566-2.stderr index ef9a41430..ef9a41430 100644 --- a/src/test/ui/suggestions/issue-82566-2.stderr +++ b/tests/ui/suggestions/issue-82566-2.stderr diff --git a/src/test/ui/suggestions/issue-83892.fixed b/tests/ui/suggestions/issue-83892.fixed index dd093a7a0..dd093a7a0 100644 --- a/src/test/ui/suggestions/issue-83892.fixed +++ b/tests/ui/suggestions/issue-83892.fixed diff --git a/src/test/ui/suggestions/issue-83892.rs b/tests/ui/suggestions/issue-83892.rs index 1d56ecee8..1d56ecee8 100644 --- a/src/test/ui/suggestions/issue-83892.rs +++ b/tests/ui/suggestions/issue-83892.rs diff --git a/src/test/ui/suggestions/issue-83892.stderr b/tests/ui/suggestions/issue-83892.stderr index baf6b1447..baf6b1447 100644 --- a/src/test/ui/suggestions/issue-83892.stderr +++ b/tests/ui/suggestions/issue-83892.stderr diff --git a/src/test/ui/suggestions/issue-83943.fixed b/tests/ui/suggestions/issue-83943.fixed index e0d4ee29e..e0d4ee29e 100644 --- a/src/test/ui/suggestions/issue-83943.fixed +++ b/tests/ui/suggestions/issue-83943.fixed diff --git a/src/test/ui/suggestions/issue-83943.rs b/tests/ui/suggestions/issue-83943.rs index 68d50c177..68d50c177 100644 --- a/src/test/ui/suggestions/issue-83943.rs +++ b/tests/ui/suggestions/issue-83943.rs diff --git a/src/test/ui/suggestions/issue-83943.stderr b/tests/ui/suggestions/issue-83943.stderr index 885106e84..885106e84 100644 --- a/src/test/ui/suggestions/issue-83943.stderr +++ b/tests/ui/suggestions/issue-83943.stderr diff --git a/src/test/ui/suggestions/issue-84592.rs b/tests/ui/suggestions/issue-84592.rs index aa246aaa3..aa246aaa3 100644 --- a/src/test/ui/suggestions/issue-84592.rs +++ b/tests/ui/suggestions/issue-84592.rs diff --git a/src/test/ui/suggestions/issue-84592.stderr b/tests/ui/suggestions/issue-84592.stderr index 70c96feb1..70c96feb1 100644 --- a/src/test/ui/suggestions/issue-84592.stderr +++ b/tests/ui/suggestions/issue-84592.stderr diff --git a/src/test/ui/suggestions/issue-84700.rs b/tests/ui/suggestions/issue-84700.rs index a27169fdb..a27169fdb 100644 --- a/src/test/ui/suggestions/issue-84700.rs +++ b/tests/ui/suggestions/issue-84700.rs diff --git a/src/test/ui/suggestions/issue-84700.stderr b/tests/ui/suggestions/issue-84700.stderr index ac9f5ab0b..ac9f5ab0b 100644 --- a/src/test/ui/suggestions/issue-84700.stderr +++ b/tests/ui/suggestions/issue-84700.stderr diff --git a/src/test/ui/suggestions/issue-84973-2.rs b/tests/ui/suggestions/issue-84973-2.rs index 050cf8c64..050cf8c64 100644 --- a/src/test/ui/suggestions/issue-84973-2.rs +++ b/tests/ui/suggestions/issue-84973-2.rs diff --git a/src/test/ui/suggestions/issue-84973-2.stderr b/tests/ui/suggestions/issue-84973-2.stderr index 513bf28fb..513bf28fb 100644 --- a/src/test/ui/suggestions/issue-84973-2.stderr +++ b/tests/ui/suggestions/issue-84973-2.stderr diff --git a/src/test/ui/suggestions/issue-84973-blacklist.rs b/tests/ui/suggestions/issue-84973-blacklist.rs index 6813b07a2..6813b07a2 100644 --- a/src/test/ui/suggestions/issue-84973-blacklist.rs +++ b/tests/ui/suggestions/issue-84973-blacklist.rs diff --git a/src/test/ui/suggestions/issue-84973-blacklist.stderr b/tests/ui/suggestions/issue-84973-blacklist.stderr index c20cc8164..c20cc8164 100644 --- a/src/test/ui/suggestions/issue-84973-blacklist.stderr +++ b/tests/ui/suggestions/issue-84973-blacklist.stderr diff --git a/src/test/ui/suggestions/issue-84973-negative.rs b/tests/ui/suggestions/issue-84973-negative.rs index f339251e5..f339251e5 100644 --- a/src/test/ui/suggestions/issue-84973-negative.rs +++ b/tests/ui/suggestions/issue-84973-negative.rs diff --git a/src/test/ui/suggestions/issue-84973-negative.stderr b/tests/ui/suggestions/issue-84973-negative.stderr index ce838bce0..ce838bce0 100644 --- a/src/test/ui/suggestions/issue-84973-negative.stderr +++ b/tests/ui/suggestions/issue-84973-negative.stderr diff --git a/src/test/ui/suggestions/issue-84973.rs b/tests/ui/suggestions/issue-84973.rs index 42468478e..42468478e 100644 --- a/src/test/ui/suggestions/issue-84973.rs +++ b/tests/ui/suggestions/issue-84973.rs diff --git a/src/test/ui/suggestions/issue-84973.stderr b/tests/ui/suggestions/issue-84973.stderr index ae2bf5aac..ae2bf5aac 100644 --- a/src/test/ui/suggestions/issue-84973.stderr +++ b/tests/ui/suggestions/issue-84973.stderr diff --git a/src/test/ui/suggestions/issue-85347.rs b/tests/ui/suggestions/issue-85347.rs index 02b5fb618..02b5fb618 100644 --- a/src/test/ui/suggestions/issue-85347.rs +++ b/tests/ui/suggestions/issue-85347.rs diff --git a/src/test/ui/suggestions/issue-85347.stderr b/tests/ui/suggestions/issue-85347.stderr index 17c1b7dc4..17c1b7dc4 100644 --- a/src/test/ui/suggestions/issue-85347.stderr +++ b/tests/ui/suggestions/issue-85347.stderr diff --git a/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs b/tests/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs index 390d8bbdd..390d8bbdd 100644 --- a/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs +++ b/tests/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs diff --git a/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr b/tests/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr index 752533cdc..752533cdc 100644 --- a/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr +++ b/tests/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr diff --git a/src/test/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.rs b/tests/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.rs index 1a36f6e8e..1a36f6e8e 100644 --- a/src/test/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.rs +++ b/tests/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.rs diff --git a/src/test/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.stderr b/tests/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.stderr index 92be9f764..92be9f764 100644 --- a/src/test/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.stderr +++ b/tests/ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.stderr diff --git a/src/test/ui/suggestions/issue-86100-tuple-paren-comma.rs b/tests/ui/suggestions/issue-86100-tuple-paren-comma.rs index fa9d1a889..fa9d1a889 100644 --- a/src/test/ui/suggestions/issue-86100-tuple-paren-comma.rs +++ b/tests/ui/suggestions/issue-86100-tuple-paren-comma.rs diff --git a/src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr b/tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr index 8c9a41a20..8c9a41a20 100644 --- a/src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr +++ b/tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr diff --git a/src/test/ui/suggestions/issue-86667.rs b/tests/ui/suggestions/issue-86667.rs index 366787df1..366787df1 100644 --- a/src/test/ui/suggestions/issue-86667.rs +++ b/tests/ui/suggestions/issue-86667.rs diff --git a/src/test/ui/suggestions/issue-86667.stderr b/tests/ui/suggestions/issue-86667.stderr index 8d6116416..8d6116416 100644 --- a/src/test/ui/suggestions/issue-86667.stderr +++ b/tests/ui/suggestions/issue-86667.stderr diff --git a/tests/ui/suggestions/issue-88730.rs b/tests/ui/suggestions/issue-88730.rs new file mode 100644 index 000000000..d161ed284 --- /dev/null +++ b/tests/ui/suggestions/issue-88730.rs @@ -0,0 +1,15 @@ +#![allow(unused, nonstandard_style)] + +// If an enum has two different variants, +// then it cannot be matched upon in a function argument. +// It still gets an error, but no suggestions. +enum Foo { + C, + D, +} + +fn foo(C: Foo) {} //~ERROR + +fn main() { + let C = Foo::D; //~ERROR +} diff --git a/tests/ui/suggestions/issue-88730.stderr b/tests/ui/suggestions/issue-88730.stderr new file mode 100644 index 000000000..0bd1b7ba4 --- /dev/null +++ b/tests/ui/suggestions/issue-88730.stderr @@ -0,0 +1,17 @@ +error[E0170]: pattern binding `C` is named the same as one of the variants of the type `Foo` + --> $DIR/issue-88730.rs:11:8 + | +LL | fn foo(C: Foo) {} + | ^ + | + = note: `#[deny(bindings_with_variant_name)]` on by default + +error[E0170]: pattern binding `C` is named the same as one of the variants of the type `Foo` + --> $DIR/issue-88730.rs:14:9 + | +LL | let C = Foo::D; + | ^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0170`. diff --git a/src/test/ui/suggestions/issue-89064.rs b/tests/ui/suggestions/issue-89064.rs index fa5fc899d..fa5fc899d 100644 --- a/src/test/ui/suggestions/issue-89064.rs +++ b/tests/ui/suggestions/issue-89064.rs diff --git a/src/test/ui/suggestions/issue-89064.stderr b/tests/ui/suggestions/issue-89064.stderr index 8b2a38816..93d8da226 100644 --- a/src/test/ui/suggestions/issue-89064.stderr +++ b/tests/ui/suggestions/issue-89064.stderr @@ -62,11 +62,6 @@ error[E0107]: this associated function takes 0 generic arguments but 1 generic a LL | let _ = 42.into::<Option<_>>(); | ^^^^ expected 0 generic arguments | -note: associated function defined here, with 0 generic parameters - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn into(self) -> T; - | ^^^^ help: consider moving this generic argument to the `Into` trait, which takes up to 1 argument | LL | let _ = Into::<Option<_>>::into(42); diff --git a/src/test/ui/suggestions/issue-89333.rs b/tests/ui/suggestions/issue-89333.rs index 03ed28ede..03ed28ede 100644 --- a/src/test/ui/suggestions/issue-89333.rs +++ b/tests/ui/suggestions/issue-89333.rs diff --git a/src/test/ui/suggestions/issue-89333.stderr b/tests/ui/suggestions/issue-89333.stderr index f73f1147d..f73f1147d 100644 --- a/src/test/ui/suggestions/issue-89333.stderr +++ b/tests/ui/suggestions/issue-89333.stderr diff --git a/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs b/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs index 1e36b2fab..1e36b2fab 100644 --- a/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs +++ b/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs diff --git a/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr b/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr index 611f7d5dd..611f7d5dd 100644 --- a/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr +++ b/tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr diff --git a/src/test/ui/suggestions/issue-90974.rs b/tests/ui/suggestions/issue-90974.rs index 83590dbf7..83590dbf7 100644 --- a/src/test/ui/suggestions/issue-90974.rs +++ b/tests/ui/suggestions/issue-90974.rs diff --git a/src/test/ui/suggestions/issue-90974.stderr b/tests/ui/suggestions/issue-90974.stderr index e1fb479a3..e1fb479a3 100644 --- a/src/test/ui/suggestions/issue-90974.stderr +++ b/tests/ui/suggestions/issue-90974.stderr diff --git a/src/test/ui/suggestions/issue-96223.rs b/tests/ui/suggestions/issue-96223.rs index 85667bb84..85667bb84 100644 --- a/src/test/ui/suggestions/issue-96223.rs +++ b/tests/ui/suggestions/issue-96223.rs diff --git a/src/test/ui/suggestions/issue-96223.stderr b/tests/ui/suggestions/issue-96223.stderr index 72a9a739a..d4e9433df 100644 --- a/src/test/ui/suggestions/issue-96223.stderr +++ b/tests/ui/suggestions/issue-96223.stderr @@ -11,12 +11,15 @@ note: required for `Baz<EmptyBis<'de>>` to implement `for<'de> Foo<'de>` --> $DIR/issue-96223.rs:16:14 | LL | impl<'de, T> Foo<'de> for Baz<T> where T: Foo<'de> {} - | ^^^^^^^^ ^^^^^^ + | ^^^^^^^^ ^^^^^^ -------- unsatisfied trait bound introduced here note: required for `Empty` to implement `Dummy<EmptyMarker>` --> $DIR/issue-96223.rs:20:9 | LL | impl<M> Dummy<M> for Empty | ^^^^^^^^ ^^^^^ +... +LL | for<'de> Baz<<M::Bar as Bar<'de>>::Inner>: Foo<'de>, + | -------- unsatisfied trait bound introduced here note: required by a bound in `icey_bounds` --> $DIR/issue-96223.rs:45:19 | diff --git a/src/test/ui/suggestions/issue-96555.rs b/tests/ui/suggestions/issue-96555.rs index 9f0a047c6..9f0a047c6 100644 --- a/src/test/ui/suggestions/issue-96555.rs +++ b/tests/ui/suggestions/issue-96555.rs diff --git a/src/test/ui/suggestions/issue-96555.stderr b/tests/ui/suggestions/issue-96555.stderr index 9a8a183dc..9a8a183dc 100644 --- a/src/test/ui/suggestions/issue-96555.stderr +++ b/tests/ui/suggestions/issue-96555.stderr diff --git a/src/test/ui/suggestions/issue-97677.fixed b/tests/ui/suggestions/issue-97677.fixed index 1e7569fa4..1e7569fa4 100644 --- a/src/test/ui/suggestions/issue-97677.fixed +++ b/tests/ui/suggestions/issue-97677.fixed diff --git a/src/test/ui/suggestions/issue-97677.rs b/tests/ui/suggestions/issue-97677.rs index 2abf2af33..2abf2af33 100644 --- a/src/test/ui/suggestions/issue-97677.rs +++ b/tests/ui/suggestions/issue-97677.rs diff --git a/src/test/ui/suggestions/issue-97677.stderr b/tests/ui/suggestions/issue-97677.stderr index 575d79267..575d79267 100644 --- a/src/test/ui/suggestions/issue-97677.stderr +++ b/tests/ui/suggestions/issue-97677.stderr diff --git a/src/test/ui/suggestions/issue-97704.fixed b/tests/ui/suggestions/issue-97704.fixed index c42bdfff5..c42bdfff5 100644 --- a/src/test/ui/suggestions/issue-97704.fixed +++ b/tests/ui/suggestions/issue-97704.fixed diff --git a/src/test/ui/suggestions/issue-97704.rs b/tests/ui/suggestions/issue-97704.rs index 5dfee6cac..5dfee6cac 100644 --- a/src/test/ui/suggestions/issue-97704.rs +++ b/tests/ui/suggestions/issue-97704.rs diff --git a/src/test/ui/suggestions/issue-97704.stderr b/tests/ui/suggestions/issue-97704.stderr index ca017be45..ca017be45 100644 --- a/src/test/ui/suggestions/issue-97704.stderr +++ b/tests/ui/suggestions/issue-97704.stderr diff --git a/src/test/ui/suggestions/issue-97760.rs b/tests/ui/suggestions/issue-97760.rs index cf9c3c58d..cf9c3c58d 100644 --- a/src/test/ui/suggestions/issue-97760.rs +++ b/tests/ui/suggestions/issue-97760.rs diff --git a/src/test/ui/suggestions/issue-97760.stderr b/tests/ui/suggestions/issue-97760.stderr index bbcc3693f..bbcc3693f 100644 --- a/src/test/ui/suggestions/issue-97760.stderr +++ b/tests/ui/suggestions/issue-97760.stderr diff --git a/src/test/ui/suggestions/issue-98500.rs b/tests/ui/suggestions/issue-98500.rs index a2717fd92..a2717fd92 100644 --- a/src/test/ui/suggestions/issue-98500.rs +++ b/tests/ui/suggestions/issue-98500.rs diff --git a/src/test/ui/suggestions/issue-98500.stderr b/tests/ui/suggestions/issue-98500.stderr index e7251d735..e7251d735 100644 --- a/src/test/ui/suggestions/issue-98500.stderr +++ b/tests/ui/suggestions/issue-98500.stderr diff --git a/src/test/ui/suggestions/issue-99080.rs b/tests/ui/suggestions/issue-99080.rs index 91f574f35..91f574f35 100644 --- a/src/test/ui/suggestions/issue-99080.rs +++ b/tests/ui/suggestions/issue-99080.rs diff --git a/src/test/ui/suggestions/issue-99080.stderr b/tests/ui/suggestions/issue-99080.stderr index d1908dd9d..d1908dd9d 100644 --- a/src/test/ui/suggestions/issue-99080.stderr +++ b/tests/ui/suggestions/issue-99080.stderr diff --git a/src/test/ui/suggestions/issue-99240-2.rs b/tests/ui/suggestions/issue-99240-2.rs index 0a418b5ae..0a418b5ae 100644 --- a/src/test/ui/suggestions/issue-99240-2.rs +++ b/tests/ui/suggestions/issue-99240-2.rs diff --git a/src/test/ui/suggestions/issue-99240-2.stderr b/tests/ui/suggestions/issue-99240-2.stderr index 260df8565..a2b559784 100644 --- a/src/test/ui/suggestions/issue-99240-2.stderr +++ b/tests/ui/suggestions/issue-99240-2.stderr @@ -4,10 +4,7 @@ error[E0618]: expected function, found enum variant `Alias::Unit` LL | Unit, | ---- enum variant `Alias::Unit` defined here ... -LL | Alias:: - | ______^ - | | _____| - | || +LL | // Alias:: LL | || Unit(); | ||________^_- call expression requires function | |________| diff --git a/src/test/ui/suggestions/issue-99240.rs b/tests/ui/suggestions/issue-99240.rs index 2115a4266..2115a4266 100644 --- a/src/test/ui/suggestions/issue-99240.rs +++ b/tests/ui/suggestions/issue-99240.rs diff --git a/src/test/ui/suggestions/issue-99240.stderr b/tests/ui/suggestions/issue-99240.stderr index f1bea688b..f1bea688b 100644 --- a/src/test/ui/suggestions/issue-99240.stderr +++ b/tests/ui/suggestions/issue-99240.stderr diff --git a/src/test/ui/suggestions/js-style-comparison-op-separate-eq-token.rs b/tests/ui/suggestions/js-style-comparison-op-separate-eq-token.rs index b24d25648..b24d25648 100644 --- a/src/test/ui/suggestions/js-style-comparison-op-separate-eq-token.rs +++ b/tests/ui/suggestions/js-style-comparison-op-separate-eq-token.rs diff --git a/src/test/ui/suggestions/js-style-comparison-op-separate-eq-token.stderr b/tests/ui/suggestions/js-style-comparison-op-separate-eq-token.stderr index 6adefe3de..6adefe3de 100644 --- a/src/test/ui/suggestions/js-style-comparison-op-separate-eq-token.stderr +++ b/tests/ui/suggestions/js-style-comparison-op-separate-eq-token.stderr diff --git a/src/test/ui/suggestions/js-style-comparison-op.fixed b/tests/ui/suggestions/js-style-comparison-op.fixed index f7e977b91..f7e977b91 100644 --- a/src/test/ui/suggestions/js-style-comparison-op.fixed +++ b/tests/ui/suggestions/js-style-comparison-op.fixed diff --git a/src/test/ui/suggestions/js-style-comparison-op.rs b/tests/ui/suggestions/js-style-comparison-op.rs index c89c1052e..c89c1052e 100644 --- a/src/test/ui/suggestions/js-style-comparison-op.rs +++ b/tests/ui/suggestions/js-style-comparison-op.rs diff --git a/src/test/ui/suggestions/js-style-comparison-op.stderr b/tests/ui/suggestions/js-style-comparison-op.stderr index 33f7a0844..33f7a0844 100644 --- a/src/test/ui/suggestions/js-style-comparison-op.stderr +++ b/tests/ui/suggestions/js-style-comparison-op.stderr diff --git a/src/test/ui/suggestions/let-binding-init-expr-as-ty.rs b/tests/ui/suggestions/let-binding-init-expr-as-ty.rs index 06ee421fc..06ee421fc 100644 --- a/src/test/ui/suggestions/let-binding-init-expr-as-ty.rs +++ b/tests/ui/suggestions/let-binding-init-expr-as-ty.rs diff --git a/src/test/ui/suggestions/let-binding-init-expr-as-ty.stderr b/tests/ui/suggestions/let-binding-init-expr-as-ty.stderr index 2bf072ef5..b90ae051f 100644 --- a/src/test/ui/suggestions/let-binding-init-expr-as-ty.stderr +++ b/tests/ui/suggestions/let-binding-init-expr-as-ty.stderr @@ -21,7 +21,12 @@ error[E0223]: ambiguous associated type --> $DIR/let-binding-init-expr-as-ty.rs:2:14 | LL | let foo: i32::from_be(num); - | ^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<i32 as Trait>::from_be` + | ^^^^^^^^^^^^^^^^^ + | +help: if there were a trait named `Example` with associated type `from_be` implemented for `i32`, you could use the fully-qualified path + | +LL | let foo: <i32 as Example>::from_be; + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/suggestions/lifetimes/issue-105544.fixed b/tests/ui/suggestions/lifetimes/issue-105544.fixed new file mode 100644 index 000000000..47087eb47 --- /dev/null +++ b/tests/ui/suggestions/lifetimes/issue-105544.fixed @@ -0,0 +1,45 @@ +// run-rustfix + +#![allow(warnings)] + +fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `impl Sized` may not live long enough + //~| NOTE ...so that the type `impl Sized` will meet its required lifetime bounds +} + +fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ { +//~^ HELP consider adding an explicit lifetime bound... + (d, p) //~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds + //~^ ERROR the parameter type `impl Sized` may not live long enough +} + +fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `impl Sized + 'a` may not live long enough + //~| NOTE ...so that the type `impl Sized + 'a` will meet its required lifetime bounds +} + +fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `T` may not live long enough + //~| NOTE ...so that the type `T` will meet its required lifetime bounds +} + +fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ { +//~^ HELP consider adding an explicit lifetime bound... + (d, p) //~ NOTE ...so that the type `T` will meet its required lifetime bounds + //~^ ERROR the parameter type `T` may not live long enough +} + +fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `T` may not live long enough + //~| NOTE ...so that the type `T` will meet its required lifetime bounds +} + +fn main() {} diff --git a/tests/ui/suggestions/lifetimes/issue-105544.rs b/tests/ui/suggestions/lifetimes/issue-105544.rs new file mode 100644 index 000000000..bd3bc1ef9 --- /dev/null +++ b/tests/ui/suggestions/lifetimes/issue-105544.rs @@ -0,0 +1,45 @@ +// run-rustfix + +#![allow(warnings)] + +fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `impl Sized` may not live long enough + //~| NOTE ...so that the type `impl Sized` will meet its required lifetime bounds +} + +fn foo1<'b>(d: impl Sized, p: &'b mut ()) -> impl Sized + '_ { +//~^ HELP consider adding an explicit lifetime bound... + (d, p) //~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds + //~^ ERROR the parameter type `impl Sized` may not live long enough +} + +fn foo2<'a>(d: impl Sized + 'a, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `impl Sized + 'a` may not live long enough + //~| NOTE ...so that the type `impl Sized + 'a` will meet its required lifetime bounds +} + +fn bar<T : Sized>(d: T, p: & mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `T` may not live long enough + //~| NOTE ...so that the type `T` will meet its required lifetime bounds +} + +fn bar1<'b, T : Sized>(d: T, p: &'b mut ()) -> impl Sized + '_ { +//~^ HELP consider adding an explicit lifetime bound... + (d, p) //~ NOTE ...so that the type `T` will meet its required lifetime bounds + //~^ ERROR the parameter type `T` may not live long enough +} + +fn bar2<'a, T : Sized + 'a>(d: T, p: &mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here... +//~^ HELP consider adding an explicit lifetime bound + (d, p) + //~^ ERROR the parameter type `T` may not live long enough + //~| NOTE ...so that the type `T` will meet its required lifetime bounds +} + +fn main() {} diff --git a/tests/ui/suggestions/lifetimes/issue-105544.stderr b/tests/ui/suggestions/lifetimes/issue-105544.stderr new file mode 100644 index 000000000..08fe21b11 --- /dev/null +++ b/tests/ui/suggestions/lifetimes/issue-105544.stderr @@ -0,0 +1,110 @@ +error[E0311]: the parameter type `impl Sized` may not live long enough + --> $DIR/issue-105544.rs:7:5 + | +LL | (d, p) + | ^^^^^^ + | +note: the parameter type `impl Sized` must be valid for the anonymous lifetime defined here... + --> $DIR/issue-105544.rs:5:26 + | +LL | fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ { + | ^^^^^^^ +note: ...so that the type `impl Sized` will meet its required lifetime bounds + --> $DIR/issue-105544.rs:7:5 + | +LL | (d, p) + | ^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + '_ { + | ++++ ++++ ++ + +error[E0309]: the parameter type `impl Sized` may not live long enough + --> $DIR/issue-105544.rs:14:5 + | +LL | (d, p) + | ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ { + | ++++ + +error[E0311]: the parameter type `impl Sized + 'a` may not live long enough + --> $DIR/issue-105544.rs:20:5 + | +LL | (d, p) + | ^^^^^^ + | +note: the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here... + --> $DIR/issue-105544.rs:18:36 + | +LL | fn foo2<'a>(d: impl Sized + 'a, p: &mut ()) -> impl Sized + '_ { + | ^^^^^^^ +note: ...so that the type `impl Sized + 'a` will meet its required lifetime bounds + --> $DIR/issue-105544.rs:20:5 + | +LL | (d, p) + | ^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + '_ { + | +++ ++++ ++ + +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/issue-105544.rs:27:5 + | +LL | (d, p) + | ^^^^^^ + | +note: the parameter type `T` must be valid for the anonymous lifetime defined here... + --> $DIR/issue-105544.rs:25:28 + | +LL | fn bar<T : Sized>(d: T, p: & mut ()) -> impl Sized + '_ { + | ^^^^^^^^ +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/issue-105544.rs:27:5 + | +LL | (d, p) + | ^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + '_ { + | +++ ++++ ++ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/issue-105544.rs:34:5 + | +LL | (d, p) + | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ { + | ++++ + +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/issue-105544.rs:40:5 + | +LL | (d, p) + | ^^^^^^ + | +note: the parameter type `T` must be valid for the anonymous lifetime defined here... + --> $DIR/issue-105544.rs:38:38 + | +LL | fn bar2<'a, T : Sized + 'a>(d: T, p: &mut ()) -> impl Sized + '_ { + | ^^^^^^^ +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/issue-105544.rs:40:5 + | +LL | (d, p) + | ^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ { + | +++ ++++ ++ + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0309, E0311. +For more information about an error, try `rustc --explain E0309`. diff --git a/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.fixed b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.fixed new file mode 100644 index 000000000..4013d98c3 --- /dev/null +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.fixed @@ -0,0 +1,29 @@ +// Regression test for #81650 +// run-rustfix + +#![allow(warnings)] + +struct Foo<'a> { + x: &'a mut &'a i32, +} + +impl<'a> Foo<'a> { + fn bar<F, T>(&self, f: F) + where + F: FnOnce(&Foo<'a>) -> T, + F: 'a, + {} +} + +trait Test { + fn test(&self); +} + +fn func<'a, T: Test + 'a>(foo: &'a Foo<'a>, t: T) { + foo.bar(move |_| { + //~^ ERROR the parameter type `T` may not live long enough + t.test(); + }); +} + +fn main() {} diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs index c6802ac6c..4096d95e5 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs @@ -1,4 +1,7 @@ // Regression test for #81650 +// run-rustfix + +#![allow(warnings)] struct Foo<'a> { x: &'a mut &'a i32, diff --git a/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr new file mode 100644 index 000000000..936d87f79 --- /dev/null +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr @@ -0,0 +1,30 @@ +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/missing-lifetimes-in-signature-2.rs:23:5 + | +LL | / foo.bar(move |_| { +LL | | +LL | | t.test(); +LL | | }); + | |______^ + | +note: the parameter type `T` must be valid for the anonymous lifetime defined here... + --> $DIR/missing-lifetimes-in-signature-2.rs:22:24 + | +LL | fn func<T: Test>(foo: &Foo, t: T) { + | ^^^ +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/missing-lifetimes-in-signature-2.rs:23:5 + | +LL | / foo.bar(move |_| { +LL | | +LL | | t.test(); +LL | | }); + | |______^ +help: consider adding an explicit lifetime bound... + | +LL | fn func<'a, T: Test + 'a>(foo: &'a Foo<'a>, t: T) { + | +++ ++++ ++ ++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0311`. diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.fixed b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.fixed index 3c06f4f88..3c06f4f88 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.fixed +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.fixed diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.rs b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.rs index 110468cbb..110468cbb 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.rs +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.rs diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.stderr b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.stderr index 7b126c90e..7b126c90e 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.stderr +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-before-const.stderr diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs index b641f5941..b641f5941 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr index fa758bf05..c5c3f7b46 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr +++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr @@ -47,7 +47,7 @@ LL | | } | |_____^ help: consider adding an explicit lifetime bound... | -LL ~ fn bar<'a, G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ +LL ~ fn bar<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + '_ LL | where LL ~ G: Get<T> + 'a, | @@ -76,8 +76,8 @@ LL | | } | |_____^ help: consider adding an explicit lifetime bound... | -LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ - | +++ ++++ +LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + '_ + | +++ ++++ ++ error[E0311]: the parameter type `G` may not live long enough --> $DIR/missing-lifetimes-in-signature.rs:61:9 @@ -103,8 +103,8 @@ LL | | } | |_________^ help: consider adding an explicit lifetime bound... | -LL | fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { - | +++ ++++ +LL | fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + '_ { + | +++ ++++ ++ error[E0311]: the parameter type `G` may not live long enough --> $DIR/missing-lifetimes-in-signature.rs:73:5 @@ -132,8 +132,8 @@ LL | | } | |_____^ help: consider adding an explicit lifetime bound... | -LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a - | +++ ++++ +LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + '_ + 'a + | +++ ++++ ++ error[E0621]: explicit lifetime required in the type of `dest` --> $DIR/missing-lifetimes-in-signature.rs:73:5 diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs b/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs index ff27011f8..ff27011f8 100644 --- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs +++ b/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr b/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr index c77ef79e7..c77ef79e7 100644 --- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr +++ b/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr diff --git a/src/test/ui/suggestions/many-type-ascription.rs b/tests/ui/suggestions/many-type-ascription.rs index 31ac556b9..31ac556b9 100644 --- a/src/test/ui/suggestions/many-type-ascription.rs +++ b/tests/ui/suggestions/many-type-ascription.rs diff --git a/src/test/ui/suggestions/many-type-ascription.stderr b/tests/ui/suggestions/many-type-ascription.stderr index 3706bbae9..3706bbae9 100644 --- a/src/test/ui/suggestions/many-type-ascription.stderr +++ b/tests/ui/suggestions/many-type-ascription.stderr diff --git a/src/test/ui/suggestions/match-ergonomics.rs b/tests/ui/suggestions/match-ergonomics.rs index c4fc01469..c4fc01469 100644 --- a/src/test/ui/suggestions/match-ergonomics.rs +++ b/tests/ui/suggestions/match-ergonomics.rs diff --git a/src/test/ui/suggestions/match-ergonomics.stderr b/tests/ui/suggestions/match-ergonomics.stderr index aa2b407bf..aa2b407bf 100644 --- a/src/test/ui/suggestions/match-ergonomics.stderr +++ b/tests/ui/suggestions/match-ergonomics.stderr diff --git a/src/test/ui/suggestions/match-needing-semi.rs b/tests/ui/suggestions/match-needing-semi.rs index 833555d0e..833555d0e 100644 --- a/src/test/ui/suggestions/match-needing-semi.rs +++ b/tests/ui/suggestions/match-needing-semi.rs diff --git a/src/test/ui/suggestions/match-needing-semi.stderr b/tests/ui/suggestions/match-needing-semi.stderr index b5f01d703..b5f01d703 100644 --- a/src/test/ui/suggestions/match-needing-semi.stderr +++ b/tests/ui/suggestions/match-needing-semi.stderr diff --git a/src/test/ui/suggestions/match-prev-arm-needing-semi.rs b/tests/ui/suggestions/match-prev-arm-needing-semi.rs index 8c8abe047..8c8abe047 100644 --- a/src/test/ui/suggestions/match-prev-arm-needing-semi.rs +++ b/tests/ui/suggestions/match-prev-arm-needing-semi.rs diff --git a/src/test/ui/suggestions/match-prev-arm-needing-semi.stderr b/tests/ui/suggestions/match-prev-arm-needing-semi.stderr index 8d735b71f..8d735b71f 100644 --- a/src/test/ui/suggestions/match-prev-arm-needing-semi.stderr +++ b/tests/ui/suggestions/match-prev-arm-needing-semi.stderr diff --git a/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.rs b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.rs index 0360ce6e6..0360ce6e6 100644 --- a/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.rs +++ b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.rs diff --git a/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr index 00aa7d18a..00aa7d18a 100644 --- a/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr +++ b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr diff --git a/tests/ui/suggestions/method-access-to-range-literal-typo.fixed b/tests/ui/suggestions/method-access-to-range-literal-typo.fixed new file mode 100644 index 000000000..13601eef6 --- /dev/null +++ b/tests/ui/suggestions/method-access-to-range-literal-typo.fixed @@ -0,0 +1,34 @@ +// run-rustfix + +#![allow(unused)] + +fn as_ref() -> Option<Vec<u8>> { + None +} +struct Type { + option: Option<Vec<u8>> +} +trait Trait { + fn foo(&self) -> &Vec<u8>; +} +impl Trait for Option<Vec<u8>> { + fn foo(&self) -> &Vec<u8> { + self.as_ref().unwrap() + } +} + +impl Type { + fn method(&self) -> Option<&Vec<u8>> { + self.option.as_ref().map(|x| x) + //~^ ERROR E0308 + } + fn method2(&self) -> Option<&u8> { + self.option.foo().get(0) + //~^ ERROR E0425 + //~| ERROR E0308 + } +} + +fn main() { + let _ = Type { option: None }.method(); +} diff --git a/tests/ui/suggestions/method-access-to-range-literal-typo.rs b/tests/ui/suggestions/method-access-to-range-literal-typo.rs new file mode 100644 index 000000000..fdcd6425d --- /dev/null +++ b/tests/ui/suggestions/method-access-to-range-literal-typo.rs @@ -0,0 +1,34 @@ +// run-rustfix + +#![allow(unused)] + +fn as_ref() -> Option<Vec<u8>> { + None +} +struct Type { + option: Option<Vec<u8>> +} +trait Trait { + fn foo(&self) -> &Vec<u8>; +} +impl Trait for Option<Vec<u8>> { + fn foo(&self) -> &Vec<u8> { + self.as_ref().unwrap() + } +} + +impl Type { + fn method(&self) -> Option<&Vec<u8>> { + self.option..as_ref().map(|x| x) + //~^ ERROR E0308 + } + fn method2(&self) -> Option<&u8> { + self.option..foo().get(0) + //~^ ERROR E0425 + //~| ERROR E0308 + } +} + +fn main() { + let _ = Type { option: None }.method(); +} diff --git a/tests/ui/suggestions/method-access-to-range-literal-typo.stderr b/tests/ui/suggestions/method-access-to-range-literal-typo.stderr new file mode 100644 index 000000000..f42140894 --- /dev/null +++ b/tests/ui/suggestions/method-access-to-range-literal-typo.stderr @@ -0,0 +1,48 @@ +error[E0425]: cannot find function `foo` in this scope + --> $DIR/method-access-to-range-literal-typo.rs:26:22 + | +LL | self.option..foo().get(0) + | ^^^ not found in this scope + | +help: you might have meant to write `.` instead of `..` + | +LL - self.option..foo().get(0) +LL + self.option.foo().get(0) + | + +error[E0308]: mismatched types + --> $DIR/method-access-to-range-literal-typo.rs:22:9 + | +LL | fn method(&self) -> Option<&Vec<u8>> { + | ---------------- expected `Option<&Vec<u8>>` because of return type +LL | self.option..as_ref().map(|x| x) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found struct `Range` + | + = note: expected enum `Option<&Vec<u8>>` + found struct `std::ops::Range<Option<Vec<u8>>>` +help: you likely meant to write a method call instead of a range + | +LL - self.option..as_ref().map(|x| x) +LL + self.option.as_ref().map(|x| x) + | + +error[E0308]: mismatched types + --> $DIR/method-access-to-range-literal-typo.rs:26:9 + | +LL | fn method2(&self) -> Option<&u8> { + | ----------- expected `Option<&u8>` because of return type +LL | self.option..foo().get(0) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found struct `Range` + | + = note: expected enum `Option<&u8>` + found struct `std::ops::Range<Option<Vec<u8>>>` +help: you likely meant to write a method call instead of a range + | +LL - self.option..foo().get(0) +LL + self.option.foo().get(0) + | + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0308, E0425. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/method-missing-parentheses.rs b/tests/ui/suggestions/method-missing-parentheses.rs index f10bfb56d..f10bfb56d 100644 --- a/src/test/ui/suggestions/method-missing-parentheses.rs +++ b/tests/ui/suggestions/method-missing-parentheses.rs diff --git a/src/test/ui/suggestions/method-missing-parentheses.stderr b/tests/ui/suggestions/method-missing-parentheses.stderr index 1bfff56a6..1bfff56a6 100644 --- a/src/test/ui/suggestions/method-missing-parentheses.stderr +++ b/tests/ui/suggestions/method-missing-parentheses.stderr diff --git a/src/test/ui/suggestions/mismatched-types-numeric-from.rs b/tests/ui/suggestions/mismatched-types-numeric-from.rs index 56549da9c..56549da9c 100644 --- a/src/test/ui/suggestions/mismatched-types-numeric-from.rs +++ b/tests/ui/suggestions/mismatched-types-numeric-from.rs diff --git a/src/test/ui/suggestions/mismatched-types-numeric-from.stderr b/tests/ui/suggestions/mismatched-types-numeric-from.stderr index 4d44d893a..4d44d893a 100644 --- a/src/test/ui/suggestions/mismatched-types-numeric-from.stderr +++ b/tests/ui/suggestions/mismatched-types-numeric-from.stderr diff --git a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed index a0cb39a3f..a0cb39a3f 100644 --- a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed +++ b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed diff --git a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs index c80ede1b2..c80ede1b2 100644 --- a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs +++ b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs diff --git a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr index 4c75fbe4c..4c75fbe4c 100644 --- a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr +++ b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr diff --git a/src/test/ui/suggestions/missing-assoc-fn.rs b/tests/ui/suggestions/missing-assoc-fn.rs index 9af8e5a93..9af8e5a93 100644 --- a/src/test/ui/suggestions/missing-assoc-fn.rs +++ b/tests/ui/suggestions/missing-assoc-fn.rs diff --git a/src/test/ui/suggestions/missing-assoc-fn.stderr b/tests/ui/suggestions/missing-assoc-fn.stderr index 136ec2152..136ec2152 100644 --- a/src/test/ui/suggestions/missing-assoc-fn.stderr +++ b/tests/ui/suggestions/missing-assoc-fn.stderr diff --git a/src/test/ui/suggestions/missing-assoc-type-bound-restriction.rs b/tests/ui/suggestions/missing-assoc-type-bound-restriction.rs index 4954a8a69..4954a8a69 100644 --- a/src/test/ui/suggestions/missing-assoc-type-bound-restriction.rs +++ b/tests/ui/suggestions/missing-assoc-type-bound-restriction.rs diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed index ac0b14fba..ac0b14fba 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.rs b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.rs index 31f8cd6fc..31f8cd6fc 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.rs +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.rs diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr index 03082be69..03082be69 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed index 304360d48..304360d48 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs index 14e1fbb33..14e1fbb33 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr index faf730a5c..faf730a5c 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.rs b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs index 52163bddd..52163bddd 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.rs +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs diff --git a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr index 11bc54099..11bc54099 100644 --- a/src/test/ui/suggestions/missing-bound-in-derive-copy-impl.stderr +++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed index 691e7553a..691e7553a 100644 --- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed +++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs index e3185e7ef..e3185e7ef 100644 --- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs +++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr index 9e6f0d9eb..9e6f0d9eb 100644 --- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr +++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.fixed b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed index 32a7215c5..32a7215c5 100644 --- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.fixed +++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.rs b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs index c688f4d41..c688f4d41 100644 --- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.rs +++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr index fe2d133c8..fe2d133c8 100644 --- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr +++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr diff --git a/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.rs b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs index 38332627f..38332627f 100644 --- a/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.rs +++ b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs diff --git a/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr index 233f1bc5a..233f1bc5a 100644 --- a/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr +++ b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr diff --git a/src/test/ui/suggestions/missing-lifetime-specifier.rs b/tests/ui/suggestions/missing-lifetime-specifier.rs index 24f5f782f..24f5f782f 100644 --- a/src/test/ui/suggestions/missing-lifetime-specifier.rs +++ b/tests/ui/suggestions/missing-lifetime-specifier.rs diff --git a/src/test/ui/suggestions/missing-lifetime-specifier.stderr b/tests/ui/suggestions/missing-lifetime-specifier.stderr index 997bbb5e9..997bbb5e9 100644 --- a/src/test/ui/suggestions/missing-lifetime-specifier.stderr +++ b/tests/ui/suggestions/missing-lifetime-specifier.stderr diff --git a/src/test/ui/suggestions/missing-lt-for-hrtb.rs b/tests/ui/suggestions/missing-lt-for-hrtb.rs index 04ea3d831..04ea3d831 100644 --- a/src/test/ui/suggestions/missing-lt-for-hrtb.rs +++ b/tests/ui/suggestions/missing-lt-for-hrtb.rs diff --git a/src/test/ui/suggestions/missing-lt-for-hrtb.stderr b/tests/ui/suggestions/missing-lt-for-hrtb.stderr index fa5156444..fa5156444 100644 --- a/src/test/ui/suggestions/missing-lt-for-hrtb.stderr +++ b/tests/ui/suggestions/missing-lt-for-hrtb.stderr diff --git a/src/test/ui/suggestions/missing-trait-item.fixed b/tests/ui/suggestions/missing-trait-item.fixed index a1cf359ec..a1cf359ec 100644 --- a/src/test/ui/suggestions/missing-trait-item.fixed +++ b/tests/ui/suggestions/missing-trait-item.fixed diff --git a/src/test/ui/suggestions/missing-trait-item.rs b/tests/ui/suggestions/missing-trait-item.rs index b4fca25ba..b4fca25ba 100644 --- a/src/test/ui/suggestions/missing-trait-item.rs +++ b/tests/ui/suggestions/missing-trait-item.rs diff --git a/src/test/ui/suggestions/missing-trait-item.stderr b/tests/ui/suggestions/missing-trait-item.stderr index 4a9d7b472..4a9d7b472 100644 --- a/src/test/ui/suggestions/missing-trait-item.stderr +++ b/tests/ui/suggestions/missing-trait-item.stderr diff --git a/tests/ui/suggestions/missing-type-param-used-in-param.fixed b/tests/ui/suggestions/missing-type-param-used-in-param.fixed new file mode 100644 index 000000000..be4394031 --- /dev/null +++ b/tests/ui/suggestions/missing-type-param-used-in-param.fixed @@ -0,0 +1,8 @@ +// run-rustfix + +fn two_type_params<A, B>(_: B) {} + +fn main() { + two_type_params::<String, _>(100); //~ ERROR function takes 2 generic arguments + two_type_params::<String, _>(100); +} diff --git a/tests/ui/suggestions/missing-type-param-used-in-param.rs b/tests/ui/suggestions/missing-type-param-used-in-param.rs new file mode 100644 index 000000000..d444998d3 --- /dev/null +++ b/tests/ui/suggestions/missing-type-param-used-in-param.rs @@ -0,0 +1,8 @@ +// run-rustfix + +fn two_type_params<A, B>(_: B) {} + +fn main() { + two_type_params::<String>(100); //~ ERROR function takes 2 generic arguments + two_type_params::<String, _>(100); +} diff --git a/src/test/ui/suggestions/missing-type-param-used-in-param.stderr b/tests/ui/suggestions/missing-type-param-used-in-param.stderr index 4f7058a64..4f7058a64 100644 --- a/src/test/ui/suggestions/missing-type-param-used-in-param.stderr +++ b/tests/ui/suggestions/missing-type-param-used-in-param.stderr diff --git a/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.rs index 2f540060a..2f540060a 100644 --- a/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs +++ b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.rs diff --git a/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr index 9557220f6..9557220f6 100644 --- a/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr +++ b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr diff --git a/src/test/ui/suggestions/multibyte-escapes.rs b/tests/ui/suggestions/multibyte-escapes.rs index c41051862..c41051862 100644 --- a/src/test/ui/suggestions/multibyte-escapes.rs +++ b/tests/ui/suggestions/multibyte-escapes.rs diff --git a/src/test/ui/suggestions/multibyte-escapes.stderr b/tests/ui/suggestions/multibyte-escapes.stderr index 1e7c43e65..1e7c43e65 100644 --- a/src/test/ui/suggestions/multibyte-escapes.stderr +++ b/tests/ui/suggestions/multibyte-escapes.stderr diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.rs b/tests/ui/suggestions/mut-borrow-needed-by-trait.rs index 66e1e77c9..66e1e77c9 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.rs +++ b/tests/ui/suggestions/mut-borrow-needed-by-trait.rs diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr index d121932c8..6910b77d9 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr +++ b/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr @@ -9,9 +9,6 @@ LL | let fp = BufWriter::new(fp); = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write` note: required by a bound in `BufWriter::<W>::new` --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL - | -LL | impl<W: Write> BufWriter<W> { - | ^^^^^ required by this bound in `BufWriter::<W>::new` error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied --> $DIR/mut-borrow-needed-by-trait.rs:17:14 @@ -22,20 +19,15 @@ LL | let fp = BufWriter::new(fp); = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write` note: required by a bound in `BufWriter` --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL - | -LL | pub struct BufWriter<W: Write> { - | ^^^^^ required by this bound in `BufWriter` -error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn std::io::Write>`, but its trait bounds were not satisfied +error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn Write>`, but its trait bounds were not satisfied --> $DIR/mut-borrow-needed-by-trait.rs:21:5 | LL | writeln!(fp, "hello world").unwrap(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn std::io::Write>` due to unsatisfied trait bounds - | - ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds + --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL | -LL | pub struct BufWriter<W: Write> { - | ------------------------------ doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write` + = note: doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write` | = note: the following trait bounds were not satisfied: `&dyn std::io::Write: std::io::Write` diff --git a/src/test/ui/suggestions/mut-ref-reassignment.rs b/tests/ui/suggestions/mut-ref-reassignment.rs index 142832493..142832493 100644 --- a/src/test/ui/suggestions/mut-ref-reassignment.rs +++ b/tests/ui/suggestions/mut-ref-reassignment.rs diff --git a/src/test/ui/suggestions/mut-ref-reassignment.stderr b/tests/ui/suggestions/mut-ref-reassignment.stderr index b3cb6dd06..b3cb6dd06 100644 --- a/src/test/ui/suggestions/mut-ref-reassignment.stderr +++ b/tests/ui/suggestions/mut-ref-reassignment.stderr diff --git a/src/test/ui/suggestions/negative-literal-index.fixed b/tests/ui/suggestions/negative-literal-index.fixed index e52714cf9..e52714cf9 100644 --- a/src/test/ui/suggestions/negative-literal-index.fixed +++ b/tests/ui/suggestions/negative-literal-index.fixed diff --git a/src/test/ui/suggestions/negative-literal-index.rs b/tests/ui/suggestions/negative-literal-index.rs index d88b66e67..d88b66e67 100644 --- a/src/test/ui/suggestions/negative-literal-index.rs +++ b/tests/ui/suggestions/negative-literal-index.rs diff --git a/src/test/ui/suggestions/negative-literal-index.stderr b/tests/ui/suggestions/negative-literal-index.stderr index 2b51bf7b7..2b51bf7b7 100644 --- a/src/test/ui/suggestions/negative-literal-index.stderr +++ b/tests/ui/suggestions/negative-literal-index.stderr diff --git a/src/test/ui/suggestions/nested-non-tuple-tuple-struct.rs b/tests/ui/suggestions/nested-non-tuple-tuple-struct.rs index 308adcf01..308adcf01 100644 --- a/src/test/ui/suggestions/nested-non-tuple-tuple-struct.rs +++ b/tests/ui/suggestions/nested-non-tuple-tuple-struct.rs diff --git a/src/test/ui/suggestions/nested-non-tuple-tuple-struct.stderr b/tests/ui/suggestions/nested-non-tuple-tuple-struct.stderr index 948f09fc3..948f09fc3 100644 --- a/src/test/ui/suggestions/nested-non-tuple-tuple-struct.stderr +++ b/tests/ui/suggestions/nested-non-tuple-tuple-struct.stderr diff --git a/src/test/ui/suggestions/no-extern-crate-in-type.rs b/tests/ui/suggestions/no-extern-crate-in-type.rs index bb93ef454..bb93ef454 100644 --- a/src/test/ui/suggestions/no-extern-crate-in-type.rs +++ b/tests/ui/suggestions/no-extern-crate-in-type.rs diff --git a/src/test/ui/suggestions/no-extern-crate-in-type.stderr b/tests/ui/suggestions/no-extern-crate-in-type.stderr index 876eef2b6..876eef2b6 100644 --- a/src/test/ui/suggestions/no-extern-crate-in-type.stderr +++ b/tests/ui/suggestions/no-extern-crate-in-type.stderr diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs b/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs index a7a3f9818..a7a3f9818 100644 --- a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs +++ b/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr b/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr index b294f4da7..b294f4da7 100644 --- a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr +++ b/tests/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.stderr diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield.fixed b/tests/ui/suggestions/non-existent-field-present-in-subfield.fixed index e58b4e6ca..e58b4e6ca 100644 --- a/src/test/ui/suggestions/non-existent-field-present-in-subfield.fixed +++ b/tests/ui/suggestions/non-existent-field-present-in-subfield.fixed diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield.rs b/tests/ui/suggestions/non-existent-field-present-in-subfield.rs index 7e273ac23..7e273ac23 100644 --- a/src/test/ui/suggestions/non-existent-field-present-in-subfield.rs +++ b/tests/ui/suggestions/non-existent-field-present-in-subfield.rs diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield.stderr b/tests/ui/suggestions/non-existent-field-present-in-subfield.stderr index cc991b915..cc991b915 100644 --- a/src/test/ui/suggestions/non-existent-field-present-in-subfield.stderr +++ b/tests/ui/suggestions/non-existent-field-present-in-subfield.stderr diff --git a/src/test/ui/suggestions/object-unsafe-trait-references-self.rs b/tests/ui/suggestions/object-unsafe-trait-references-self.rs index 07bf053e9..07bf053e9 100644 --- a/src/test/ui/suggestions/object-unsafe-trait-references-self.rs +++ b/tests/ui/suggestions/object-unsafe-trait-references-self.rs diff --git a/src/test/ui/suggestions/object-unsafe-trait-references-self.stderr b/tests/ui/suggestions/object-unsafe-trait-references-self.stderr index 54f19fe9d..54f19fe9d 100644 --- a/src/test/ui/suggestions/object-unsafe-trait-references-self.stderr +++ b/tests/ui/suggestions/object-unsafe-trait-references-self.stderr diff --git a/src/test/ui/suggestions/object-unsafe-trait-should-use-self.rs b/tests/ui/suggestions/object-unsafe-trait-should-use-self.rs index 75f99075e..75f99075e 100644 --- a/src/test/ui/suggestions/object-unsafe-trait-should-use-self.rs +++ b/tests/ui/suggestions/object-unsafe-trait-should-use-self.rs diff --git a/src/test/ui/suggestions/object-unsafe-trait-should-use-self.stderr b/tests/ui/suggestions/object-unsafe-trait-should-use-self.stderr index 55047b426..55047b426 100644 --- a/src/test/ui/suggestions/object-unsafe-trait-should-use-self.stderr +++ b/tests/ui/suggestions/object-unsafe-trait-should-use-self.stderr diff --git a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.fixed b/tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.fixed index 69487c565..69487c565 100644 --- a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.fixed +++ b/tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.fixed diff --git a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.rs b/tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.rs index 38d9aea16..38d9aea16 100644 --- a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.rs +++ b/tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.rs diff --git a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr b/tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr index c0dc71df0..c0dc71df0 100644 --- a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr +++ b/tests/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr diff --git a/src/test/ui/suggestions/opaque-type-error.rs b/tests/ui/suggestions/opaque-type-error.rs index 5e1147403..5e1147403 100644 --- a/src/test/ui/suggestions/opaque-type-error.rs +++ b/tests/ui/suggestions/opaque-type-error.rs diff --git a/src/test/ui/suggestions/opaque-type-error.stderr b/tests/ui/suggestions/opaque-type-error.stderr index 133ffb058..133ffb058 100644 --- a/src/test/ui/suggestions/opaque-type-error.stderr +++ b/tests/ui/suggestions/opaque-type-error.stderr diff --git a/src/test/ui/suggestions/option-content-move-from-tuple-match.rs b/tests/ui/suggestions/option-content-move-from-tuple-match.rs index 7f22d8136..7f22d8136 100644 --- a/src/test/ui/suggestions/option-content-move-from-tuple-match.rs +++ b/tests/ui/suggestions/option-content-move-from-tuple-match.rs diff --git a/src/test/ui/suggestions/option-content-move-from-tuple-match.stderr b/tests/ui/suggestions/option-content-move-from-tuple-match.stderr index debb8caba..97d05d9dc 100644 --- a/src/test/ui/suggestions/option-content-move-from-tuple-match.stderr +++ b/tests/ui/suggestions/option-content-move-from-tuple-match.stderr @@ -9,6 +9,11 @@ LL | (None, &c) => &c.unwrap(), | | | data moved here | move occurs because `c` has type `Option<String>`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | (None, &ref c) => &c.unwrap(), + | +++ error: aborting due to previous error diff --git a/src/test/ui/suggestions/option-content-move.rs b/tests/ui/suggestions/option-content-move.rs index 46c895b95..46c895b95 100644 --- a/src/test/ui/suggestions/option-content-move.rs +++ b/tests/ui/suggestions/option-content-move.rs diff --git a/tests/ui/suggestions/option-content-move.stderr b/tests/ui/suggestions/option-content-move.stderr new file mode 100644 index 000000000..474a72093 --- /dev/null +++ b/tests/ui/suggestions/option-content-move.stderr @@ -0,0 +1,35 @@ +error[E0507]: cannot move out of `selection.1` which is behind a shared reference + --> $DIR/option-content-move.rs:9:20 + | +LL | if selection.1.unwrap().contains(selection.0) { + | ^^^^^^^^^^^ -------- `selection.1` moved due to this method call + | | + | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents + | move occurs because `selection.1` has type `Option<String>`, which does not implement the `Copy` trait + | +note: `Option::<T>::unwrap` takes ownership of the receiver `self`, which moves `selection.1` + --> $SRC_DIR/core/src/option.rs:LL:COL +help: you can `clone` the value and consume it, but this might not be your desired behavior + | +LL | if selection.1.clone().unwrap().contains(selection.0) { + | ++++++++ + +error[E0507]: cannot move out of `selection.1` which is behind a shared reference + --> $DIR/option-content-move.rs:27:20 + | +LL | if selection.1.unwrap().contains(selection.0) { + | ^^^^^^^^^^^ -------- `selection.1` moved due to this method call + | | + | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents + | move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait + | +note: `Result::<T, E>::unwrap` takes ownership of the receiver `self`, which moves `selection.1` + --> $SRC_DIR/core/src/result.rs:LL:COL +help: you can `clone` the value and consume it, but this might not be your desired behavior + | +LL | if selection.1.clone().unwrap().contains(selection.0) { + | ++++++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/suggestions/option-content-move2.rs b/tests/ui/suggestions/option-content-move2.rs index 88e8a5b7a..88e8a5b7a 100644 --- a/src/test/ui/suggestions/option-content-move2.rs +++ b/tests/ui/suggestions/option-content-move2.rs diff --git a/src/test/ui/suggestions/option-content-move2.stderr b/tests/ui/suggestions/option-content-move2.stderr index 1d3dff3be..1d3dff3be 100644 --- a/src/test/ui/suggestions/option-content-move2.stderr +++ b/tests/ui/suggestions/option-content-move2.stderr diff --git a/src/test/ui/suggestions/option-to-bool.rs b/tests/ui/suggestions/option-to-bool.rs index 2a1823b15..2a1823b15 100644 --- a/src/test/ui/suggestions/option-to-bool.rs +++ b/tests/ui/suggestions/option-to-bool.rs diff --git a/src/test/ui/suggestions/option-to-bool.stderr b/tests/ui/suggestions/option-to-bool.stderr index 57a934b83..4050c7be8 100644 --- a/src/test/ui/suggestions/option-to-bool.stderr +++ b/tests/ui/suggestions/option-to-bool.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/option-to-bool.rs:4:16 | LL | if true && x {} - | ^ expected `bool`, found enum `Option` + | ---- ^ expected `bool`, found enum `Option` + | | + | expected because this is `bool` | = note: expected type `bool` found enum `Option<i32>` diff --git a/src/test/ui/suggestions/parenthesized-deref-suggestion.rs b/tests/ui/suggestions/parenthesized-deref-suggestion.rs index 0b4ccdd5a..0b4ccdd5a 100644 --- a/src/test/ui/suggestions/parenthesized-deref-suggestion.rs +++ b/tests/ui/suggestions/parenthesized-deref-suggestion.rs diff --git a/src/test/ui/suggestions/parenthesized-deref-suggestion.stderr b/tests/ui/suggestions/parenthesized-deref-suggestion.stderr index cafddbe26..cafddbe26 100644 --- a/src/test/ui/suggestions/parenthesized-deref-suggestion.stderr +++ b/tests/ui/suggestions/parenthesized-deref-suggestion.stderr diff --git a/src/test/ui/suggestions/path-by-value.rs b/tests/ui/suggestions/path-by-value.rs index c875ca674..c875ca674 100644 --- a/src/test/ui/suggestions/path-by-value.rs +++ b/tests/ui/suggestions/path-by-value.rs diff --git a/src/test/ui/suggestions/path-by-value.stderr b/tests/ui/suggestions/path-by-value.stderr index bbeaa26a9..bbeaa26a9 100644 --- a/src/test/ui/suggestions/path-by-value.stderr +++ b/tests/ui/suggestions/path-by-value.stderr diff --git a/src/test/ui/suggestions/path-display.rs b/tests/ui/suggestions/path-display.rs index 3a022e6b0..3a022e6b0 100644 --- a/src/test/ui/suggestions/path-display.rs +++ b/tests/ui/suggestions/path-display.rs diff --git a/src/test/ui/suggestions/path-display.stderr b/tests/ui/suggestions/path-display.stderr index 8359b3658..8359b3658 100644 --- a/src/test/ui/suggestions/path-display.stderr +++ b/tests/ui/suggestions/path-display.stderr diff --git a/src/test/ui/suggestions/pattern-slice-vec.fixed b/tests/ui/suggestions/pattern-slice-vec.fixed index f8144641f..f8144641f 100644 --- a/src/test/ui/suggestions/pattern-slice-vec.fixed +++ b/tests/ui/suggestions/pattern-slice-vec.fixed diff --git a/src/test/ui/suggestions/pattern-slice-vec.rs b/tests/ui/suggestions/pattern-slice-vec.rs index 444687c85..444687c85 100644 --- a/src/test/ui/suggestions/pattern-slice-vec.rs +++ b/tests/ui/suggestions/pattern-slice-vec.rs diff --git a/src/test/ui/suggestions/pattern-slice-vec.stderr b/tests/ui/suggestions/pattern-slice-vec.stderr index f69e7de97..f69e7de97 100644 --- a/src/test/ui/suggestions/pattern-slice-vec.stderr +++ b/tests/ui/suggestions/pattern-slice-vec.stderr diff --git a/src/test/ui/suggestions/pattern-struct-with-slice-vec-field.rs b/tests/ui/suggestions/pattern-struct-with-slice-vec-field.rs index 5b223a91f..5b223a91f 100644 --- a/src/test/ui/suggestions/pattern-struct-with-slice-vec-field.rs +++ b/tests/ui/suggestions/pattern-struct-with-slice-vec-field.rs diff --git a/src/test/ui/suggestions/pattern-struct-with-slice-vec-field.stderr b/tests/ui/suggestions/pattern-struct-with-slice-vec-field.stderr index 5b48a8b18..5b48a8b18 100644 --- a/src/test/ui/suggestions/pattern-struct-with-slice-vec-field.stderr +++ b/tests/ui/suggestions/pattern-struct-with-slice-vec-field.stderr diff --git a/src/test/ui/suggestions/private-field.rs b/tests/ui/suggestions/private-field.rs index 1cc4d2a4d..1cc4d2a4d 100644 --- a/src/test/ui/suggestions/private-field.rs +++ b/tests/ui/suggestions/private-field.rs diff --git a/src/test/ui/suggestions/private-field.stderr b/tests/ui/suggestions/private-field.stderr index c38c795e0..c38c795e0 100644 --- a/src/test/ui/suggestions/private-field.stderr +++ b/tests/ui/suggestions/private-field.stderr diff --git a/src/test/ui/suggestions/raw-byte-string-prefix.rs b/tests/ui/suggestions/raw-byte-string-prefix.rs index 576561c31..576561c31 100644 --- a/src/test/ui/suggestions/raw-byte-string-prefix.rs +++ b/tests/ui/suggestions/raw-byte-string-prefix.rs diff --git a/src/test/ui/suggestions/raw-byte-string-prefix.stderr b/tests/ui/suggestions/raw-byte-string-prefix.stderr index 4f5106849..4f5106849 100644 --- a/src/test/ui/suggestions/raw-byte-string-prefix.stderr +++ b/tests/ui/suggestions/raw-byte-string-prefix.stderr diff --git a/src/test/ui/suggestions/raw-name-use-suggestion.rs b/tests/ui/suggestions/raw-name-use-suggestion.rs index 0a8073c0b..0a8073c0b 100644 --- a/src/test/ui/suggestions/raw-name-use-suggestion.rs +++ b/tests/ui/suggestions/raw-name-use-suggestion.rs diff --git a/src/test/ui/suggestions/raw-name-use-suggestion.stderr b/tests/ui/suggestions/raw-name-use-suggestion.stderr index 95c26b9ad..95c26b9ad 100644 --- a/src/test/ui/suggestions/raw-name-use-suggestion.stderr +++ b/tests/ui/suggestions/raw-name-use-suggestion.stderr diff --git a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.rs b/tests/ui/suggestions/recover-from-semicolon-trailing-item.rs index 82935af0a..82935af0a 100644 --- a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.rs +++ b/tests/ui/suggestions/recover-from-semicolon-trailing-item.rs diff --git a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr b/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr index 9588eedc9..9588eedc9 100644 --- a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr +++ b/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr diff --git a/src/test/ui/suggestions/recover-invalid-float.fixed b/tests/ui/suggestions/recover-invalid-float.fixed index 62389ba61..62389ba61 100644 --- a/src/test/ui/suggestions/recover-invalid-float.fixed +++ b/tests/ui/suggestions/recover-invalid-float.fixed diff --git a/src/test/ui/suggestions/recover-invalid-float.rs b/tests/ui/suggestions/recover-invalid-float.rs index a5a7efe5e..a5a7efe5e 100644 --- a/src/test/ui/suggestions/recover-invalid-float.rs +++ b/tests/ui/suggestions/recover-invalid-float.rs diff --git a/src/test/ui/suggestions/recover-invalid-float.stderr b/tests/ui/suggestions/recover-invalid-float.stderr index dd24746ea..dd24746ea 100644 --- a/src/test/ui/suggestions/recover-invalid-float.stderr +++ b/tests/ui/suggestions/recover-invalid-float.stderr diff --git a/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.rs b/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.rs index 333dce390..333dce390 100644 --- a/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.rs +++ b/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.rs diff --git a/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr b/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr index 618ccba0d..618ccba0d 100644 --- a/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr +++ b/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr diff --git a/src/test/ui/suggestions/ref-pattern-binding.fixed b/tests/ui/suggestions/ref-pattern-binding.fixed index c36040eec..c36040eec 100644 --- a/src/test/ui/suggestions/ref-pattern-binding.fixed +++ b/tests/ui/suggestions/ref-pattern-binding.fixed diff --git a/src/test/ui/suggestions/ref-pattern-binding.rs b/tests/ui/suggestions/ref-pattern-binding.rs index c0d4feb03..c0d4feb03 100644 --- a/src/test/ui/suggestions/ref-pattern-binding.rs +++ b/tests/ui/suggestions/ref-pattern-binding.rs diff --git a/src/test/ui/suggestions/ref-pattern-binding.stderr b/tests/ui/suggestions/ref-pattern-binding.stderr index 10447ba70..10447ba70 100644 --- a/src/test/ui/suggestions/ref-pattern-binding.stderr +++ b/tests/ui/suggestions/ref-pattern-binding.stderr diff --git a/src/test/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.rs b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.rs index 56aed77c1..56aed77c1 100644 --- a/src/test/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.rs +++ b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.rs diff --git a/src/test/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr index 6071b10d3..6071b10d3 100644 --- a/src/test/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr +++ b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr diff --git a/src/test/ui/suggestions/remove-as_str.rs b/tests/ui/suggestions/remove-as_str.rs index 289a784ba..289a784ba 100644 --- a/src/test/ui/suggestions/remove-as_str.rs +++ b/tests/ui/suggestions/remove-as_str.rs diff --git a/src/test/ui/suggestions/remove-as_str.stderr b/tests/ui/suggestions/remove-as_str.stderr index 534c49778..534c49778 100644 --- a/src/test/ui/suggestions/remove-as_str.stderr +++ b/tests/ui/suggestions/remove-as_str.stderr diff --git a/src/test/ui/suggestions/restrict-type-argument.rs b/tests/ui/suggestions/restrict-type-argument.rs index c4ebfbe92..c4ebfbe92 100644 --- a/src/test/ui/suggestions/restrict-type-argument.rs +++ b/tests/ui/suggestions/restrict-type-argument.rs diff --git a/src/test/ui/suggestions/restrict-type-argument.stderr b/tests/ui/suggestions/restrict-type-argument.stderr index 01c2de798..01c2de798 100644 --- a/src/test/ui/suggestions/restrict-type-argument.stderr +++ b/tests/ui/suggestions/restrict-type-argument.stderr diff --git a/src/test/ui/suggestions/restrict-type-not-param.rs b/tests/ui/suggestions/restrict-type-not-param.rs index 60f5ba45c..60f5ba45c 100644 --- a/src/test/ui/suggestions/restrict-type-not-param.rs +++ b/tests/ui/suggestions/restrict-type-not-param.rs diff --git a/src/test/ui/suggestions/restrict-type-not-param.stderr b/tests/ui/suggestions/restrict-type-not-param.stderr index e7d9c5ecb..5434472ce 100644 --- a/src/test/ui/suggestions/restrict-type-not-param.stderr +++ b/tests/ui/suggestions/restrict-type-not-param.stderr @@ -11,11 +11,8 @@ note: an implementation of `Add<_>` might be missing for `Wrapper<T>` | LL | struct Wrapper<T>(T); | ^^^^^^^^^^^^^^^^^ must implement `Add<_>` -note: the following trait must be implemented +note: the trait `Add` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Add<Rhs = Self> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | LL | fn qux<T>(a: Wrapper<T>, b: T) -> T where Wrapper<T>: Add<T, Output = T> { diff --git a/src/test/ui/suggestions/return-bindings-multi.rs b/tests/ui/suggestions/return-bindings-multi.rs index 8c3bd641e..8c3bd641e 100644 --- a/src/test/ui/suggestions/return-bindings-multi.rs +++ b/tests/ui/suggestions/return-bindings-multi.rs diff --git a/src/test/ui/suggestions/return-bindings-multi.stderr b/tests/ui/suggestions/return-bindings-multi.stderr index 738e3f2f4..738e3f2f4 100644 --- a/src/test/ui/suggestions/return-bindings-multi.stderr +++ b/tests/ui/suggestions/return-bindings-multi.stderr diff --git a/src/test/ui/suggestions/return-bindings.rs b/tests/ui/suggestions/return-bindings.rs index fa1bad376..fa1bad376 100644 --- a/src/test/ui/suggestions/return-bindings.rs +++ b/tests/ui/suggestions/return-bindings.rs diff --git a/src/test/ui/suggestions/return-bindings.stderr b/tests/ui/suggestions/return-bindings.stderr index c14fb3367..c14fb3367 100644 --- a/src/test/ui/suggestions/return-bindings.stderr +++ b/tests/ui/suggestions/return-bindings.stderr diff --git a/src/test/ui/suggestions/return-closures.rs b/tests/ui/suggestions/return-closures.rs index 86c7c1537..86c7c1537 100644 --- a/src/test/ui/suggestions/return-closures.rs +++ b/tests/ui/suggestions/return-closures.rs diff --git a/src/test/ui/suggestions/return-closures.stderr b/tests/ui/suggestions/return-closures.stderr index 8b856d8de..8b856d8de 100644 --- a/src/test/ui/suggestions/return-closures.stderr +++ b/tests/ui/suggestions/return-closures.stderr diff --git a/src/test/ui/suggestions/return-cycle-2.rs b/tests/ui/suggestions/return-cycle-2.rs index d6d24be1b..d6d24be1b 100644 --- a/src/test/ui/suggestions/return-cycle-2.rs +++ b/tests/ui/suggestions/return-cycle-2.rs diff --git a/src/test/ui/suggestions/return-cycle-2.stderr b/tests/ui/suggestions/return-cycle-2.stderr index 3a1a0f7f4..3a1a0f7f4 100644 --- a/src/test/ui/suggestions/return-cycle-2.stderr +++ b/tests/ui/suggestions/return-cycle-2.stderr diff --git a/src/test/ui/suggestions/return-cycle.rs b/tests/ui/suggestions/return-cycle.rs index 60b80e35a..60b80e35a 100644 --- a/src/test/ui/suggestions/return-cycle.rs +++ b/tests/ui/suggestions/return-cycle.rs diff --git a/src/test/ui/suggestions/return-cycle.stderr b/tests/ui/suggestions/return-cycle.stderr index 63fa9e040..63fa9e040 100644 --- a/src/test/ui/suggestions/return-cycle.stderr +++ b/tests/ui/suggestions/return-cycle.stderr diff --git a/src/test/ui/suggestions/return-elided-lifetime.rs b/tests/ui/suggestions/return-elided-lifetime.rs index 012d5492a..012d5492a 100644 --- a/src/test/ui/suggestions/return-elided-lifetime.rs +++ b/tests/ui/suggestions/return-elided-lifetime.rs diff --git a/src/test/ui/suggestions/return-elided-lifetime.stderr b/tests/ui/suggestions/return-elided-lifetime.stderr index 273d95bc7..273d95bc7 100644 --- a/src/test/ui/suggestions/return-elided-lifetime.stderr +++ b/tests/ui/suggestions/return-elided-lifetime.stderr diff --git a/src/test/ui/suggestions/return-without-lifetime.rs b/tests/ui/suggestions/return-without-lifetime.rs index 9bfce11be..9bfce11be 100644 --- a/src/test/ui/suggestions/return-without-lifetime.rs +++ b/tests/ui/suggestions/return-without-lifetime.rs diff --git a/src/test/ui/suggestions/return-without-lifetime.stderr b/tests/ui/suggestions/return-without-lifetime.stderr index 5028e8d62..5028e8d62 100644 --- a/src/test/ui/suggestions/return-without-lifetime.stderr +++ b/tests/ui/suggestions/return-without-lifetime.stderr diff --git a/tests/ui/suggestions/shadowed-lplace-method-2.rs b/tests/ui/suggestions/shadowed-lplace-method-2.rs new file mode 100644 index 000000000..dab99fbac --- /dev/null +++ b/tests/ui/suggestions/shadowed-lplace-method-2.rs @@ -0,0 +1,23 @@ +#![allow(unused)] + +struct X { + x: (), +} +pub trait A { + fn foo(&mut self, _: usize) -> &mut (); +} +impl A for X { + fn foo(&mut self, _: usize) -> &mut () { + &mut self.x + } +} +impl X { + fn foo(&mut self, _: usize) -> &mut Self { + self + } +} + +fn main() { + let mut x = X { x: () }; + *x.foo(0) = (); //~ ERROR E0308 +} diff --git a/tests/ui/suggestions/shadowed-lplace-method-2.stderr b/tests/ui/suggestions/shadowed-lplace-method-2.stderr new file mode 100644 index 000000000..94eef15f3 --- /dev/null +++ b/tests/ui/suggestions/shadowed-lplace-method-2.stderr @@ -0,0 +1,25 @@ +error[E0308]: mismatched types + --> $DIR/shadowed-lplace-method-2.rs:22:17 + | +LL | *x.foo(0) = (); + | --------- ^^ expected struct `X`, found `()` + | | + | expected due to the type of this binding + | +note: the `foo` call is resolved to the method in `X`, shadowing the method of the same name on trait `A` + --> $DIR/shadowed-lplace-method-2.rs:22:8 + | +LL | *x.foo(0) = (); + | ^^^ refers to `X::foo` +help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly + | +LL | *<_ as A>::foo(&mut x, 0) = (); + | ++++++++++++++++++ ~ +help: try wrapping the expression in `X` + | +LL | *x.foo(0) = X { x: () }; + | ++++++ + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/suggestions/shadowed-lplace-method.fixed b/tests/ui/suggestions/shadowed-lplace-method.fixed new file mode 100644 index 000000000..740ac77ee --- /dev/null +++ b/tests/ui/suggestions/shadowed-lplace-method.fixed @@ -0,0 +1,10 @@ +// run-rustfix +#![allow(unused_imports)] +use std::borrow::BorrowMut; +use std::cell::RefCell; +use std::rc::Rc; + +fn main() { + let rc = Rc::new(RefCell::new(true)); + *std::cell::RefCell::<_>::borrow_mut(&rc) = false; //~ ERROR E0308 +} diff --git a/tests/ui/suggestions/shadowed-lplace-method.rs b/tests/ui/suggestions/shadowed-lplace-method.rs new file mode 100644 index 000000000..6bf12879e --- /dev/null +++ b/tests/ui/suggestions/shadowed-lplace-method.rs @@ -0,0 +1,10 @@ +// run-rustfix +#![allow(unused_imports)] +use std::borrow::BorrowMut; +use std::cell::RefCell; +use std::rc::Rc; + +fn main() { + let rc = Rc::new(RefCell::new(true)); + *rc.borrow_mut() = false; //~ ERROR E0308 +} diff --git a/tests/ui/suggestions/shadowed-lplace-method.stderr b/tests/ui/suggestions/shadowed-lplace-method.stderr new file mode 100644 index 000000000..91d0d1200 --- /dev/null +++ b/tests/ui/suggestions/shadowed-lplace-method.stderr @@ -0,0 +1,26 @@ +error[E0308]: mismatched types + --> $DIR/shadowed-lplace-method.rs:9:24 + | +LL | *rc.borrow_mut() = false; + | ---------------- ^^^^^ expected struct `Rc`, found `bool` + | | + | expected due to the type of this binding + | + = note: expected struct `Rc<RefCell<bool>>` + found type `bool` +note: the `borrow_mut` call is resolved to the method in `std::borrow::BorrowMut`, shadowing the method of the same name on the inherent impl for `std::cell::RefCell<T>` + --> $DIR/shadowed-lplace-method.rs:9:9 + | +LL | use std::borrow::BorrowMut; + | ---------------------- `std::borrow::BorrowMut` imported here +... +LL | *rc.borrow_mut() = false; + | ^^^^^^^^^^ refers to `std::borrow::BorrowMut::borrow_mut` +help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly + | +LL | *std::cell::RefCell::<_>::borrow_mut(&rc) = false; + | +++++++++++++++++++++++++++++++++++++ ~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/slice-issue-87994.rs b/tests/ui/suggestions/slice-issue-87994.rs index ecb7f54ea..ecb7f54ea 100644 --- a/src/test/ui/suggestions/slice-issue-87994.rs +++ b/tests/ui/suggestions/slice-issue-87994.rs diff --git a/src/test/ui/suggestions/slice-issue-87994.stderr b/tests/ui/suggestions/slice-issue-87994.stderr index 84ecd749b..84ecd749b 100644 --- a/src/test/ui/suggestions/slice-issue-87994.stderr +++ b/tests/ui/suggestions/slice-issue-87994.stderr diff --git a/src/test/ui/suggestions/struct-field-type-including-single-colon.rs b/tests/ui/suggestions/struct-field-type-including-single-colon.rs index b7ad6d996..b7ad6d996 100644 --- a/src/test/ui/suggestions/struct-field-type-including-single-colon.rs +++ b/tests/ui/suggestions/struct-field-type-including-single-colon.rs diff --git a/src/test/ui/suggestions/struct-field-type-including-single-colon.stderr b/tests/ui/suggestions/struct-field-type-including-single-colon.stderr index 4dd514480..4dd514480 100644 --- a/src/test/ui/suggestions/struct-field-type-including-single-colon.stderr +++ b/tests/ui/suggestions/struct-field-type-including-single-colon.stderr diff --git a/src/test/ui/suggestions/struct-initializer-comma.fixed b/tests/ui/suggestions/struct-initializer-comma.fixed index 6a4ee39b1..6a4ee39b1 100644 --- a/src/test/ui/suggestions/struct-initializer-comma.fixed +++ b/tests/ui/suggestions/struct-initializer-comma.fixed diff --git a/src/test/ui/suggestions/struct-initializer-comma.rs b/tests/ui/suggestions/struct-initializer-comma.rs index c137f0594..c137f0594 100644 --- a/src/test/ui/suggestions/struct-initializer-comma.rs +++ b/tests/ui/suggestions/struct-initializer-comma.rs diff --git a/src/test/ui/suggestions/struct-initializer-comma.stderr b/tests/ui/suggestions/struct-initializer-comma.stderr index 5eff43f32..5eff43f32 100644 --- a/src/test/ui/suggestions/struct-initializer-comma.stderr +++ b/tests/ui/suggestions/struct-initializer-comma.stderr diff --git a/src/test/ui/suggestions/sugg-else-for-closure.fixed b/tests/ui/suggestions/sugg-else-for-closure.fixed index cf381d9da..cf381d9da 100644 --- a/src/test/ui/suggestions/sugg-else-for-closure.fixed +++ b/tests/ui/suggestions/sugg-else-for-closure.fixed diff --git a/src/test/ui/suggestions/sugg-else-for-closure.rs b/tests/ui/suggestions/sugg-else-for-closure.rs index 540ced91f..540ced91f 100644 --- a/src/test/ui/suggestions/sugg-else-for-closure.rs +++ b/tests/ui/suggestions/sugg-else-for-closure.rs diff --git a/tests/ui/suggestions/sugg-else-for-closure.stderr b/tests/ui/suggestions/sugg-else-for-closure.stderr new file mode 100644 index 000000000..7f05832bc --- /dev/null +++ b/tests/ui/suggestions/sugg-else-for-closure.stderr @@ -0,0 +1,27 @@ +error[E0308]: mismatched types + --> $DIR/sugg-else-for-closure.rs:6:26 + | +LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); + | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure + | | + | arguments to this method are incorrect + | + = note: expected reference `&str` + found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]` +help: the return type of this call is `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]` due to the type of the argument passed + --> $DIR/sugg-else-for-closure.rs:6:14 + | +LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); + | ^^^^^^^^^^^^-------------------------------^ + | | + | this argument influences the return type of `unwrap_or` +note: associated function defined here + --> $SRC_DIR/core/src/option.rs:LL:COL +help: try calling `unwrap_or_else` instead + | +LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap()); + | +++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs b/tests/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs index 21ab6830b..21ab6830b 100644 --- a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs +++ b/tests/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs diff --git a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr b/tests/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr index 850f69f2d..850f69f2d 100644 --- a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr +++ b/tests/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr diff --git a/src/test/ui/suggestions/suggest-add-self.rs b/tests/ui/suggestions/suggest-add-self.rs index 40692c8df..40692c8df 100644 --- a/src/test/ui/suggestions/suggest-add-self.rs +++ b/tests/ui/suggestions/suggest-add-self.rs diff --git a/src/test/ui/suggestions/suggest-add-self.stderr b/tests/ui/suggestions/suggest-add-self.stderr index a5e8f93de..a5e8f93de 100644 --- a/src/test/ui/suggestions/suggest-add-self.stderr +++ b/tests/ui/suggestions/suggest-add-self.stderr diff --git a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed b/tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed index e9b8a9caa..e9b8a9caa 100644 --- a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed +++ b/tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed diff --git a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs b/tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs index 5fae21ccc..5fae21ccc 100644 --- a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs +++ b/tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs diff --git a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr b/tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr index 125a8b44f..125a8b44f 100644 --- a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr +++ b/tests/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-deref.fixed b/tests/ui/suggestions/suggest-assoc-fn-call-deref.fixed index 8d96cf590..8d96cf590 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-deref.fixed +++ b/tests/ui/suggestions/suggest-assoc-fn-call-deref.fixed diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-deref.rs b/tests/ui/suggestions/suggest-assoc-fn-call-deref.rs index 186901f75..186901f75 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-deref.rs +++ b/tests/ui/suggestions/suggest-assoc-fn-call-deref.rs diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-deref.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-deref.stderr index 00fb96f03..00fb96f03 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-deref.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-deref.stderr diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.rs b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.rs index a39b8711d..a39b8711d 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.rs +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.rs diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr index c247e73b3..c247e73b3 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.rs b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.rs index f738a1f21..f738a1f21 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.rs +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.rs diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr index 7c9f0b6c2..7c9f0b6c2 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.fixed b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.fixed index 02dd0715c..02dd0715c 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.fixed +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.fixed diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.rs b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.rs index 1d0ca8e78..1d0ca8e78 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.rs +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.rs diff --git a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr index 92b03fc77..92b03fc77 100644 --- a/src/test/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr diff --git a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs b/tests/ui/suggestions/suggest-blanket-impl-local-trait.rs index 14fef1b52..14fef1b52 100644 --- a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs +++ b/tests/ui/suggestions/suggest-blanket-impl-local-trait.rs diff --git a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr b/tests/ui/suggestions/suggest-blanket-impl-local-trait.stderr index 398caa98b..398caa98b 100644 --- a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr +++ b/tests/ui/suggestions/suggest-blanket-impl-local-trait.stderr diff --git a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.rs b/tests/ui/suggestions/suggest-borrow-to-dyn-object.rs index 120fc5383..120fc5383 100644 --- a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.rs +++ b/tests/ui/suggestions/suggest-borrow-to-dyn-object.rs diff --git a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr b/tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr index 6ce9bfd9d..6ce9bfd9d 100644 --- a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr +++ b/tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr diff --git a/src/test/ui/suggestions/suggest-box.fixed b/tests/ui/suggestions/suggest-box.fixed index 3de02cd0b..3de02cd0b 100644 --- a/src/test/ui/suggestions/suggest-box.fixed +++ b/tests/ui/suggestions/suggest-box.fixed diff --git a/src/test/ui/suggestions/suggest-box.rs b/tests/ui/suggestions/suggest-box.rs index e680a61db..e680a61db 100644 --- a/src/test/ui/suggestions/suggest-box.rs +++ b/tests/ui/suggestions/suggest-box.rs diff --git a/src/test/ui/suggestions/suggest-box.stderr b/tests/ui/suggestions/suggest-box.stderr index 2bdaa4e97..2bdaa4e97 100644 --- a/src/test/ui/suggestions/suggest-box.stderr +++ b/tests/ui/suggestions/suggest-box.stderr diff --git a/src/test/ui/suggestions/suggest-change-mut.rs b/tests/ui/suggestions/suggest-change-mut.rs index 47dc7c343..47dc7c343 100644 --- a/src/test/ui/suggestions/suggest-change-mut.rs +++ b/tests/ui/suggestions/suggest-change-mut.rs diff --git a/src/test/ui/suggestions/suggest-change-mut.stderr b/tests/ui/suggestions/suggest-change-mut.stderr index 889b11a74..d194afeaf 100644 --- a/src/test/ui/suggestions/suggest-change-mut.stderr +++ b/tests/ui/suggestions/suggest-change-mut.stderr @@ -8,9 +8,6 @@ LL | let mut stream_reader = BufReader::new(&stream); | note: required by a bound in `BufReader::<R>::new` --> $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL - | -LL | impl<R: Read> BufReader<R> { - | ^^^^ required by this bound in `BufReader::<R>::new` help: consider removing the leading `&`-reference | LL - let mut stream_reader = BufReader::new(&stream); @@ -30,11 +27,9 @@ error[E0599]: the method `read_until` exists for struct `BufReader<&T>`, but its | LL | stream_reader.read_until(b'\n', &mut buffer).expect("Reading into buffer failed"); | ^^^^^^^^^^ method cannot be called on `BufReader<&T>` due to unsatisfied trait bounds + --> $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL | - ::: $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL - | -LL | pub struct BufReader<R> { - | ----------------------- doesn't satisfy `BufReader<&T>: BufRead` + = note: doesn't satisfy `BufReader<&T>: BufRead` | = note: the following trait bounds were not satisfied: `&T: std::io::Read` diff --git a/src/test/ui/suggestions/suggest-closure-return-type-1.rs b/tests/ui/suggestions/suggest-closure-return-type-1.rs index 8bb421903..8bb421903 100644 --- a/src/test/ui/suggestions/suggest-closure-return-type-1.rs +++ b/tests/ui/suggestions/suggest-closure-return-type-1.rs diff --git a/src/test/ui/suggestions/suggest-closure-return-type-1.stderr b/tests/ui/suggestions/suggest-closure-return-type-1.stderr index f4c2eb7ff..f4c2eb7ff 100644 --- a/src/test/ui/suggestions/suggest-closure-return-type-1.stderr +++ b/tests/ui/suggestions/suggest-closure-return-type-1.stderr diff --git a/src/test/ui/suggestions/suggest-closure-return-type-2.rs b/tests/ui/suggestions/suggest-closure-return-type-2.rs index 25ed1882e..25ed1882e 100644 --- a/src/test/ui/suggestions/suggest-closure-return-type-2.rs +++ b/tests/ui/suggestions/suggest-closure-return-type-2.rs diff --git a/src/test/ui/suggestions/suggest-closure-return-type-2.stderr b/tests/ui/suggestions/suggest-closure-return-type-2.stderr index 88bf26304..88bf26304 100644 --- a/src/test/ui/suggestions/suggest-closure-return-type-2.stderr +++ b/tests/ui/suggestions/suggest-closure-return-type-2.stderr diff --git a/src/test/ui/suggestions/suggest-closure-return-type-3.rs b/tests/ui/suggestions/suggest-closure-return-type-3.rs index 3de6c55cf..3de6c55cf 100644 --- a/src/test/ui/suggestions/suggest-closure-return-type-3.rs +++ b/tests/ui/suggestions/suggest-closure-return-type-3.rs diff --git a/src/test/ui/suggestions/suggest-closure-return-type-3.stderr b/tests/ui/suggestions/suggest-closure-return-type-3.stderr index bc4107528..bc4107528 100644 --- a/src/test/ui/suggestions/suggest-closure-return-type-3.stderr +++ b/tests/ui/suggestions/suggest-closure-return-type-3.stderr diff --git a/src/test/ui/suggestions/suggest-dereferencing-index.fixed b/tests/ui/suggestions/suggest-dereferencing-index.fixed index dd4ae4eb1..dd4ae4eb1 100644 --- a/src/test/ui/suggestions/suggest-dereferencing-index.fixed +++ b/tests/ui/suggestions/suggest-dereferencing-index.fixed diff --git a/src/test/ui/suggestions/suggest-dereferencing-index.rs b/tests/ui/suggestions/suggest-dereferencing-index.rs index 82ebacc49..82ebacc49 100644 --- a/src/test/ui/suggestions/suggest-dereferencing-index.rs +++ b/tests/ui/suggestions/suggest-dereferencing-index.rs diff --git a/src/test/ui/suggestions/suggest-dereferencing-index.stderr b/tests/ui/suggestions/suggest-dereferencing-index.stderr index 147dc9234..147dc9234 100644 --- a/src/test/ui/suggestions/suggest-dereferencing-index.stderr +++ b/tests/ui/suggestions/suggest-dereferencing-index.stderr diff --git a/src/test/ui/suggestions/suggest-full-enum-variant-for-local-module.rs b/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.rs index 1dfc07866..1dfc07866 100644 --- a/src/test/ui/suggestions/suggest-full-enum-variant-for-local-module.rs +++ b/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.rs diff --git a/src/test/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr b/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr index 9b6dba7e9..9b6dba7e9 100644 --- a/src/test/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr +++ b/tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr diff --git a/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.rs b/tests/ui/suggestions/suggest-imm-mut-trait-implementations.rs index a62669d5b..a62669d5b 100644 --- a/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.rs +++ b/tests/ui/suggestions/suggest-imm-mut-trait-implementations.rs diff --git a/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr b/tests/ui/suggestions/suggest-imm-mut-trait-implementations.stderr index f2eb651ea..f2eb651ea 100644 --- a/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr +++ b/tests/ui/suggestions/suggest-imm-mut-trait-implementations.stderr diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed b/tests/ui/suggestions/suggest-impl-trait-lifetime.fixed index 589ee1a47..589ee1a47 100644 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed +++ b/tests/ui/suggestions/suggest-impl-trait-lifetime.fixed diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs b/tests/ui/suggestions/suggest-impl-trait-lifetime.rs index 9a87129fb..9a87129fb 100644 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs +++ b/tests/ui/suggestions/suggest-impl-trait-lifetime.rs diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr b/tests/ui/suggestions/suggest-impl-trait-lifetime.stderr index cf912f4aa..cf912f4aa 100644 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr +++ b/tests/ui/suggestions/suggest-impl-trait-lifetime.stderr diff --git a/src/test/ui/suggestions/suggest-labels.rs b/tests/ui/suggestions/suggest-labels.rs index 159f45855..159f45855 100644 --- a/src/test/ui/suggestions/suggest-labels.rs +++ b/tests/ui/suggestions/suggest-labels.rs diff --git a/src/test/ui/suggestions/suggest-labels.stderr b/tests/ui/suggestions/suggest-labels.stderr index aac6515b5..aac6515b5 100644 --- a/src/test/ui/suggestions/suggest-labels.stderr +++ b/tests/ui/suggestions/suggest-labels.stderr diff --git a/src/test/ui/suggestions/suggest-let-for-assignment.fixed b/tests/ui/suggestions/suggest-let-for-assignment.fixed index 3a25e25ee..3a25e25ee 100644 --- a/src/test/ui/suggestions/suggest-let-for-assignment.fixed +++ b/tests/ui/suggestions/suggest-let-for-assignment.fixed diff --git a/src/test/ui/suggestions/suggest-let-for-assignment.rs b/tests/ui/suggestions/suggest-let-for-assignment.rs index 67705fe06..67705fe06 100644 --- a/src/test/ui/suggestions/suggest-let-for-assignment.rs +++ b/tests/ui/suggestions/suggest-let-for-assignment.rs diff --git a/src/test/ui/suggestions/suggest-let-for-assignment.stderr b/tests/ui/suggestions/suggest-let-for-assignment.stderr index 3f6a3da4b..3f6a3da4b 100644 --- a/src/test/ui/suggestions/suggest-let-for-assignment.stderr +++ b/tests/ui/suggestions/suggest-let-for-assignment.stderr diff --git a/src/test/ui/suggestions/suggest-methods.rs b/tests/ui/suggestions/suggest-methods.rs index f40b9ed99..f40b9ed99 100644 --- a/src/test/ui/suggestions/suggest-methods.rs +++ b/tests/ui/suggestions/suggest-methods.rs diff --git a/src/test/ui/suggestions/suggest-methods.stderr b/tests/ui/suggestions/suggest-methods.stderr index 03cb9c779..03cb9c779 100644 --- a/src/test/ui/suggestions/suggest-methods.stderr +++ b/tests/ui/suggestions/suggest-methods.stderr diff --git a/src/test/ui/suggestions/suggest-move-lifetimes.rs b/tests/ui/suggestions/suggest-move-lifetimes.rs index 6b26f1214..6b26f1214 100644 --- a/src/test/ui/suggestions/suggest-move-lifetimes.rs +++ b/tests/ui/suggestions/suggest-move-lifetimes.rs diff --git a/src/test/ui/suggestions/suggest-move-lifetimes.stderr b/tests/ui/suggestions/suggest-move-lifetimes.stderr index b1a49447d..b1a49447d 100644 --- a/src/test/ui/suggestions/suggest-move-lifetimes.stderr +++ b/tests/ui/suggestions/suggest-move-lifetimes.stderr diff --git a/src/test/ui/suggestions/suggest-move-types.rs b/tests/ui/suggestions/suggest-move-types.rs index 27930626a..27930626a 100644 --- a/src/test/ui/suggestions/suggest-move-types.rs +++ b/tests/ui/suggestions/suggest-move-types.rs diff --git a/src/test/ui/suggestions/suggest-move-types.stderr b/tests/ui/suggestions/suggest-move-types.stderr index b222e8142..b222e8142 100644 --- a/src/test/ui/suggestions/suggest-move-types.stderr +++ b/tests/ui/suggestions/suggest-move-types.stderr diff --git a/src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.fixed b/tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.fixed index b69bad988..b69bad988 100644 --- a/src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.fixed +++ b/tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.fixed diff --git a/src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.rs b/tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.rs index 9284410df..9284410df 100644 --- a/src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.rs +++ b/tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.rs diff --git a/src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.stderr b/tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.stderr index 74433daa6..74433daa6 100644 --- a/src/test/ui/suggestions/suggest-mut-method-for-loop-hashmap.stderr +++ b/tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.stderr diff --git a/src/test/ui/suggestions/suggest-mut-method-for-loop.rs b/tests/ui/suggestions/suggest-mut-method-for-loop.rs index 756768bce..756768bce 100644 --- a/src/test/ui/suggestions/suggest-mut-method-for-loop.rs +++ b/tests/ui/suggestions/suggest-mut-method-for-loop.rs diff --git a/src/test/ui/suggestions/suggest-mut-method-for-loop.stderr b/tests/ui/suggestions/suggest-mut-method-for-loop.stderr index 3eb9e1031..3eb9e1031 100644 --- a/src/test/ui/suggestions/suggest-mut-method-for-loop.stderr +++ b/tests/ui/suggestions/suggest-mut-method-for-loop.stderr diff --git a/src/test/ui/suggestions/suggest-on-bare-closure-call.rs b/tests/ui/suggestions/suggest-on-bare-closure-call.rs index 496c305bc..496c305bc 100644 --- a/src/test/ui/suggestions/suggest-on-bare-closure-call.rs +++ b/tests/ui/suggestions/suggest-on-bare-closure-call.rs diff --git a/src/test/ui/suggestions/suggest-on-bare-closure-call.stderr b/tests/ui/suggestions/suggest-on-bare-closure-call.stderr index e65a6eb49..e65a6eb49 100644 --- a/src/test/ui/suggestions/suggest-on-bare-closure-call.stderr +++ b/tests/ui/suggestions/suggest-on-bare-closure-call.stderr diff --git a/src/test/ui/suggestions/suggest-ref-macro.rs b/tests/ui/suggestions/suggest-ref-macro.rs index 6f780f32a..6f780f32a 100644 --- a/src/test/ui/suggestions/suggest-ref-macro.rs +++ b/tests/ui/suggestions/suggest-ref-macro.rs diff --git a/src/test/ui/suggestions/suggest-ref-macro.stderr b/tests/ui/suggestions/suggest-ref-macro.stderr index 17de49fbd..17de49fbd 100644 --- a/src/test/ui/suggestions/suggest-ref-macro.stderr +++ b/tests/ui/suggestions/suggest-ref-macro.stderr diff --git a/src/test/ui/suggestions/suggest-ref-mut.rs b/tests/ui/suggestions/suggest-ref-mut.rs index d04113ffc..d04113ffc 100644 --- a/src/test/ui/suggestions/suggest-ref-mut.rs +++ b/tests/ui/suggestions/suggest-ref-mut.rs diff --git a/tests/ui/suggestions/suggest-ref-mut.stderr b/tests/ui/suggestions/suggest-ref-mut.stderr new file mode 100644 index 000000000..7973759bf --- /dev/null +++ b/tests/ui/suggestions/suggest-ref-mut.stderr @@ -0,0 +1,47 @@ +error[E0594]: cannot assign to `self.0`, which is behind a `&` reference + --> $DIR/suggest-ref-mut.rs:7:9 + | +LL | self.0 = 32; + | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written + | +help: consider changing this to be a mutable reference + | +LL | fn zap(&mut self) { + | ~~~~~~~~~ + +error[E0594]: cannot assign to `*foo`, which is behind a `&` reference + --> $DIR/suggest-ref-mut.rs:16:5 + | +LL | *foo = 32; + | ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written + | +help: consider changing this to be a mutable reference + | +LL | let ref mut foo = 16; + | ~~~~~~~~~~~ + +error[E0594]: cannot assign to `*bar`, which is behind a `&` reference + --> $DIR/suggest-ref-mut.rs:21:9 + | +LL | *bar = 32; + | ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written + | +help: consider changing this to be a mutable reference + | +LL | if let Some(ref mut bar) = Some(16) { + | ~~~~~~~~~~~ + +error[E0594]: cannot assign to `*quo`, which is behind a `&` reference + --> $DIR/suggest-ref-mut.rs:25:22 + | +LL | ref quo => { *quo = 32; }, + | ^^^^^^^^^ `quo` is a `&` reference, so the data it refers to cannot be written + | +help: consider changing this to be a mutable reference + | +LL | ref mut quo => { *quo = 32; }, + | ~~~~~~~~~~~ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/suggestions/suggest-remove-refs-1.fixed b/tests/ui/suggestions/suggest-remove-refs-1.fixed index a39e0fbd1..a39e0fbd1 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-1.fixed +++ b/tests/ui/suggestions/suggest-remove-refs-1.fixed diff --git a/src/test/ui/suggestions/suggest-remove-refs-1.rs b/tests/ui/suggestions/suggest-remove-refs-1.rs index 6f767f2c1..6f767f2c1 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-1.rs +++ b/tests/ui/suggestions/suggest-remove-refs-1.rs diff --git a/tests/ui/suggestions/suggest-remove-refs-1.stderr b/tests/ui/suggestions/suggest-remove-refs-1.stderr new file mode 100644 index 000000000..387770535 --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-1.stderr @@ -0,0 +1,17 @@ +error[E0277]: `&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator + --> $DIR/suggest-remove-refs-1.rs:6:19 + | +LL | for (i, _) in &v.iter().enumerate() { + | ^^^^^^^^^^^^^^^^^^^^^ `&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator + | + = help: the trait `Iterator` is not implemented for `&Enumerate<std::slice::Iter<'_, {integer}>>` + = note: required for `&Enumerate<std::slice::Iter<'_, {integer}>>` to implement `IntoIterator` +help: consider removing the leading `&`-reference + | +LL - for (i, _) in &v.iter().enumerate() { +LL + for (i, _) in v.iter().enumerate() { + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/suggestions/suggest-remove-refs-2.fixed b/tests/ui/suggestions/suggest-remove-refs-2.fixed index 0f9c3abfe..0f9c3abfe 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-2.fixed +++ b/tests/ui/suggestions/suggest-remove-refs-2.fixed diff --git a/src/test/ui/suggestions/suggest-remove-refs-2.rs b/tests/ui/suggestions/suggest-remove-refs-2.rs index 6c94b12d2..6c94b12d2 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-2.rs +++ b/tests/ui/suggestions/suggest-remove-refs-2.rs diff --git a/tests/ui/suggestions/suggest-remove-refs-2.stderr b/tests/ui/suggestions/suggest-remove-refs-2.stderr new file mode 100644 index 000000000..1632b2abb --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-2.stderr @@ -0,0 +1,17 @@ +error[E0277]: `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator + --> $DIR/suggest-remove-refs-2.rs:6:19 + | +LL | for (i, _) in & & & & &v.iter().enumerate() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator + | + = help: the trait `Iterator` is not implemented for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` + = note: required for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` to implement `IntoIterator` +help: consider removing 5 leading `&`-references + | +LL - for (i, _) in & & & & &v.iter().enumerate() { +LL + for (i, _) in v.iter().enumerate() { + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/suggestions/suggest-remove-refs-3.fixed b/tests/ui/suggestions/suggest-remove-refs-3.fixed index 3148fcbe5..3148fcbe5 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-3.fixed +++ b/tests/ui/suggestions/suggest-remove-refs-3.fixed diff --git a/src/test/ui/suggestions/suggest-remove-refs-3.rs b/tests/ui/suggestions/suggest-remove-refs-3.rs index 0622adada..0622adada 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-3.rs +++ b/tests/ui/suggestions/suggest-remove-refs-3.rs diff --git a/tests/ui/suggestions/suggest-remove-refs-3.stderr b/tests/ui/suggestions/suggest-remove-refs-3.stderr new file mode 100644 index 000000000..7bf421a77 --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-3.stderr @@ -0,0 +1,21 @@ +error[E0277]: `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator + --> $DIR/suggest-remove-refs-3.rs:6:19 + | +LL | for (i, _) in & & & + | ___________________^ +LL | | & &v +LL | | .iter() +LL | | .enumerate() { + | |____________________^ `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator + | + = help: the trait `Iterator` is not implemented for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` + = note: required for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` to implement `IntoIterator` +help: consider removing 5 leading `&`-references + | +LL - for (i, _) in & & & +LL + for (i, _) in v + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/suggestions/suggest-remove-refs-4.fixed b/tests/ui/suggestions/suggest-remove-refs-4.fixed new file mode 100644 index 000000000..dd63d2159 --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-4.fixed @@ -0,0 +1,5 @@ +// run-rustfix +fn main() { + let foo = [1,2,3].iter(); + for _i in foo {} //~ ERROR E0277 +} diff --git a/tests/ui/suggestions/suggest-remove-refs-4.rs b/tests/ui/suggestions/suggest-remove-refs-4.rs new file mode 100644 index 000000000..3c3d9b1b3 --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-4.rs @@ -0,0 +1,5 @@ +// run-rustfix +fn main() { + let foo = &[1,2,3].iter(); + for _i in &foo {} //~ ERROR E0277 +} diff --git a/tests/ui/suggestions/suggest-remove-refs-4.stderr b/tests/ui/suggestions/suggest-remove-refs-4.stderr new file mode 100644 index 000000000..e4ad17e06 --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-4.stderr @@ -0,0 +1,17 @@ +error[E0277]: `&&std::slice::Iter<'_, {integer}>` is not an iterator + --> $DIR/suggest-remove-refs-4.rs:4:15 + | +LL | for _i in &foo {} + | ^^^^ `&&std::slice::Iter<'_, {integer}>` is not an iterator + | + = help: the trait `Iterator` is not implemented for `&&std::slice::Iter<'_, {integer}>` + = note: required for `&&std::slice::Iter<'_, {integer}>` to implement `IntoIterator` +help: consider removing 2 leading `&`-references + | +LL ~ let foo = [1,2,3].iter(); +LL ~ for _i in foo {} + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/suggestions/suggest-remove-refs-5.fixed b/tests/ui/suggestions/suggest-remove-refs-5.fixed new file mode 100644 index 000000000..9f59f9c19 --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-5.fixed @@ -0,0 +1,8 @@ +// run-rustfix +fn main() { + let v = &mut Vec::<i32>::new(); + for _ in v {} //~ ERROR E0277 + + let v = &mut [1u8]; + for _ in v {} //~ ERROR E0277 +} diff --git a/tests/ui/suggestions/suggest-remove-refs-5.rs b/tests/ui/suggestions/suggest-remove-refs-5.rs new file mode 100644 index 000000000..d56aa0c9c --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-5.rs @@ -0,0 +1,8 @@ +// run-rustfix +fn main() { + let v = &mut &mut Vec::<i32>::new(); + for _ in &mut &mut v {} //~ ERROR E0277 + + let v = &mut &mut [1u8]; + for _ in &mut v {} //~ ERROR E0277 +} diff --git a/tests/ui/suggestions/suggest-remove-refs-5.stderr b/tests/ui/suggestions/suggest-remove-refs-5.stderr new file mode 100644 index 000000000..7de84d612 --- /dev/null +++ b/tests/ui/suggestions/suggest-remove-refs-5.stderr @@ -0,0 +1,37 @@ +error[E0277]: `Vec<i32>` is not an iterator + --> $DIR/suggest-remove-refs-5.rs:4:14 + | +LL | for _ in &mut &mut v {} + | ^^^^^^^^^^^ `Vec<i32>` is not an iterator; try calling `.into_iter()` or `.iter()` + | + = help: the trait `Iterator` is not implemented for `Vec<i32>` + = note: required for `&mut Vec<i32>` to implement `Iterator` + = note: 3 redundant requirements hidden + = note: required for `&mut &mut &mut &mut Vec<i32>` to implement `Iterator` + = note: required for `&mut &mut &mut &mut Vec<i32>` to implement `IntoIterator` +help: consider removing 3 leading `&`-references + | +LL ~ let v = &mut Vec::<i32>::new(); +LL ~ for _ in v {} + | + +error[E0277]: `[u8; 1]` is not an iterator + --> $DIR/suggest-remove-refs-5.rs:7:14 + | +LL | for _ in &mut v {} + | ^^^^^^ `[u8; 1]` is not an iterator; try calling `.into_iter()` or `.iter()` + | + = help: the trait `Iterator` is not implemented for `[u8; 1]` + = note: required for `&mut [u8; 1]` to implement `Iterator` + = note: 2 redundant requirements hidden + = note: required for `&mut &mut &mut [u8; 1]` to implement `Iterator` + = note: required for `&mut &mut &mut [u8; 1]` to implement `IntoIterator` +help: consider removing 2 leading `&`-references + | +LL ~ let v = &mut [1u8]; +LL ~ for _ in v {} + | + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed index 5c55566ff..5c55566ff 100644 --- a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed +++ b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed diff --git a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs index 91971cba3..91971cba3 100644 --- a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs +++ b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs diff --git a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr index c5df72c4a..c5df72c4a 100644 --- a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr +++ b/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr diff --git a/src/test/ui/suggestions/suggest-split-at-mut.rs b/tests/ui/suggestions/suggest-split-at-mut.rs index d294c20b8..d294c20b8 100644 --- a/src/test/ui/suggestions/suggest-split-at-mut.rs +++ b/tests/ui/suggestions/suggest-split-at-mut.rs diff --git a/src/test/ui/suggestions/suggest-split-at-mut.stderr b/tests/ui/suggestions/suggest-split-at-mut.stderr index 330f012b2..330f012b2 100644 --- a/src/test/ui/suggestions/suggest-split-at-mut.stderr +++ b/tests/ui/suggestions/suggest-split-at-mut.stderr diff --git a/src/test/ui/suggestions/suggest-std-when-using-type.fixed b/tests/ui/suggestions/suggest-std-when-using-type.fixed index 102c5c186..102c5c186 100644 --- a/src/test/ui/suggestions/suggest-std-when-using-type.fixed +++ b/tests/ui/suggestions/suggest-std-when-using-type.fixed diff --git a/src/test/ui/suggestions/suggest-std-when-using-type.rs b/tests/ui/suggestions/suggest-std-when-using-type.rs index 5abc016de..5abc016de 100644 --- a/src/test/ui/suggestions/suggest-std-when-using-type.rs +++ b/tests/ui/suggestions/suggest-std-when-using-type.rs diff --git a/src/test/ui/suggestions/suggest-std-when-using-type.stderr b/tests/ui/suggestions/suggest-std-when-using-type.stderr index 6f890b87b..6f890b87b 100644 --- a/src/test/ui/suggestions/suggest-std-when-using-type.stderr +++ b/tests/ui/suggestions/suggest-std-when-using-type.stderr diff --git a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.rs b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.rs index 03c7ed347..03c7ed347 100644 --- a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.rs +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.rs diff --git a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr index 87e716436..87e716436 100644 --- a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr diff --git a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.rs b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.rs index 947bc2c79..947bc2c79 100644 --- a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.rs +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.rs diff --git a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr index ffd505fff..ffd505fff 100644 --- a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr diff --git a/src/test/ui/suggestions/suggest-trait-items.rs b/tests/ui/suggestions/suggest-trait-items.rs index 9d42a7342..9d42a7342 100644 --- a/src/test/ui/suggestions/suggest-trait-items.rs +++ b/tests/ui/suggestions/suggest-trait-items.rs diff --git a/src/test/ui/suggestions/suggest-trait-items.stderr b/tests/ui/suggestions/suggest-trait-items.stderr index 8bc3df7b8..8bc3df7b8 100644 --- a/src/test/ui/suggestions/suggest-trait-items.stderr +++ b/tests/ui/suggestions/suggest-trait-items.stderr diff --git a/src/test/ui/suggestions/suggest-tryinto-edition-change.rs b/tests/ui/suggestions/suggest-tryinto-edition-change.rs index 70c4b210d..70c4b210d 100644 --- a/src/test/ui/suggestions/suggest-tryinto-edition-change.rs +++ b/tests/ui/suggestions/suggest-tryinto-edition-change.rs diff --git a/src/test/ui/suggestions/suggest-tryinto-edition-change.stderr b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr index 3d1f24923..018083f9e 100644 --- a/src/test/ui/suggestions/suggest-tryinto-edition-change.stderr +++ b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr @@ -52,11 +52,9 @@ error[E0599]: no method named `try_into` found for type `i32` in the current sco | LL | let _i: i16 = 0_i32.try_into().unwrap(); | ^^^^^^^^ method not found in `i32` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn try_into(self) -> Result<T, Self::Error>; - | -------- the method is available for `i32` here + = note: the method is available for `i32` here | = help: items from traits can only be used if the trait is in scope = note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021 diff --git a/src/test/ui/suggestions/suggest-using-chars.rs b/tests/ui/suggestions/suggest-using-chars.rs index 95732881b..95732881b 100644 --- a/src/test/ui/suggestions/suggest-using-chars.rs +++ b/tests/ui/suggestions/suggest-using-chars.rs diff --git a/src/test/ui/suggestions/suggest-using-chars.stderr b/tests/ui/suggestions/suggest-using-chars.stderr index 99bcfb08a..99bcfb08a 100644 --- a/src/test/ui/suggestions/suggest-using-chars.stderr +++ b/tests/ui/suggestions/suggest-using-chars.stderr diff --git a/src/test/ui/suggestions/suggest-variants.rs b/tests/ui/suggestions/suggest-variants.rs index dd05d0f04..dd05d0f04 100644 --- a/src/test/ui/suggestions/suggest-variants.rs +++ b/tests/ui/suggestions/suggest-variants.rs diff --git a/src/test/ui/suggestions/suggest-variants.stderr b/tests/ui/suggestions/suggest-variants.stderr index a422bc656..a422bc656 100644 --- a/src/test/ui/suggestions/suggest-variants.stderr +++ b/tests/ui/suggestions/suggest-variants.stderr diff --git a/src/test/ui/suggestions/suggest_print_over_printf.rs b/tests/ui/suggestions/suggest_print_over_printf.rs index 124ddec50..124ddec50 100644 --- a/src/test/ui/suggestions/suggest_print_over_printf.rs +++ b/tests/ui/suggestions/suggest_print_over_printf.rs diff --git a/src/test/ui/suggestions/suggest_print_over_printf.stderr b/tests/ui/suggestions/suggest_print_over_printf.stderr index 1214bec16..1214bec16 100644 --- a/src/test/ui/suggestions/suggest_print_over_printf.stderr +++ b/tests/ui/suggestions/suggest_print_over_printf.stderr diff --git a/src/test/ui/suggestions/too-many-field-suggestions.rs b/tests/ui/suggestions/too-many-field-suggestions.rs index 905f9502c..905f9502c 100644 --- a/src/test/ui/suggestions/too-many-field-suggestions.rs +++ b/tests/ui/suggestions/too-many-field-suggestions.rs diff --git a/src/test/ui/suggestions/too-many-field-suggestions.stderr b/tests/ui/suggestions/too-many-field-suggestions.stderr index 63ad6fdb1..63ad6fdb1 100644 --- a/src/test/ui/suggestions/too-many-field-suggestions.stderr +++ b/tests/ui/suggestions/too-many-field-suggestions.stderr diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.fixed b/tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.fixed index 8ef7e34ab..8ef7e34ab 100644 --- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.fixed +++ b/tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.fixed diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.rs b/tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.rs index 7bd38d0d4..7bd38d0d4 100644 --- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.rs +++ b/tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.rs diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr b/tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr index ac839ff7e..ac839ff7e 100644 --- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr +++ b/tests/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.rs b/tests/ui/suggestions/trait-with-missing-associated-type-restriction.rs index 0d90e4495..0d90e4495 100644 --- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.rs +++ b/tests/ui/suggestions/trait-with-missing-associated-type-restriction.rs diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr b/tests/ui/suggestions/trait-with-missing-associated-type-restriction.stderr index 7583c875a..f520d88c6 100644 --- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr +++ b/tests/ui/suggestions/trait-with-missing-associated-type-restriction.stderr @@ -78,7 +78,7 @@ error[E0308]: mismatched types LL | x.funk(3); | ---- ^ expected associated type, found integer | | - | arguments to this function are incorrect + | arguments to this method are incorrect | = note: expected associated type `<T as Trait<i32>>::A` found type `{integer}` diff --git a/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.rs b/tests/ui/suggestions/try-operator-dont-suggest-semicolon.rs index f882a159f..f882a159f 100644 --- a/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.rs +++ b/tests/ui/suggestions/try-operator-dont-suggest-semicolon.rs diff --git a/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr b/tests/ui/suggestions/try-operator-dont-suggest-semicolon.stderr index 939285498..939285498 100644 --- a/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr +++ b/tests/ui/suggestions/try-operator-dont-suggest-semicolon.stderr diff --git a/src/test/ui/suggestions/try-removing-the-field.rs b/tests/ui/suggestions/try-removing-the-field.rs index 1b7289b22..1b7289b22 100644 --- a/src/test/ui/suggestions/try-removing-the-field.rs +++ b/tests/ui/suggestions/try-removing-the-field.rs diff --git a/src/test/ui/suggestions/try-removing-the-field.stderr b/tests/ui/suggestions/try-removing-the-field.stderr index 7a6013d4a..7a6013d4a 100644 --- a/src/test/ui/suggestions/try-removing-the-field.stderr +++ b/tests/ui/suggestions/try-removing-the-field.stderr diff --git a/src/test/ui/suggestions/type-ascription-and-other-error.rs b/tests/ui/suggestions/type-ascription-and-other-error.rs index 99ab2f3c8..99ab2f3c8 100644 --- a/src/test/ui/suggestions/type-ascription-and-other-error.rs +++ b/tests/ui/suggestions/type-ascription-and-other-error.rs diff --git a/src/test/ui/suggestions/type-ascription-and-other-error.stderr b/tests/ui/suggestions/type-ascription-and-other-error.stderr index eadf634bb..eadf634bb 100644 --- a/src/test/ui/suggestions/type-ascription-and-other-error.stderr +++ b/tests/ui/suggestions/type-ascription-and-other-error.stderr diff --git a/src/test/ui/suggestions/type-ascription-instead-of-let.rs b/tests/ui/suggestions/type-ascription-instead-of-let.rs index 0e1c30750..0e1c30750 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-let.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-let.rs diff --git a/src/test/ui/suggestions/type-ascription-instead-of-let.stderr b/tests/ui/suggestions/type-ascription-instead-of-let.stderr index 92e4b5798..92e4b5798 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-let.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-let.stderr diff --git a/src/test/ui/suggestions/type-ascription-instead-of-method.fixed b/tests/ui/suggestions/type-ascription-instead-of-method.fixed index 56b740b0d..56b740b0d 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-method.fixed +++ b/tests/ui/suggestions/type-ascription-instead-of-method.fixed diff --git a/src/test/ui/suggestions/type-ascription-instead-of-method.rs b/tests/ui/suggestions/type-ascription-instead-of-method.rs index a603e09e7..a603e09e7 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-method.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-method.rs diff --git a/src/test/ui/suggestions/type-ascription-instead-of-method.stderr b/tests/ui/suggestions/type-ascription-instead-of-method.stderr index 83bc33f41..83bc33f41 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-method.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-method.stderr diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-2.fixed b/tests/ui/suggestions/type-ascription-instead-of-path-2.fixed index 787fcc120..787fcc120 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path-2.fixed +++ b/tests/ui/suggestions/type-ascription-instead-of-path-2.fixed diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-2.rs b/tests/ui/suggestions/type-ascription-instead-of-path-2.rs index 934016b3b..934016b3b 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path-2.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-path-2.rs diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-2.stderr b/tests/ui/suggestions/type-ascription-instead-of-path-2.stderr index 970b220b7..970b220b7 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path-2.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-path-2.stderr diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.rs b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs index 48d19f6dd..48d19f6dd 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr index 951ff23d6..fcff02e09 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr @@ -24,11 +24,6 @@ error[E0107]: this struct takes at least 1 generic argument but 0 generic argume LL | let _: Vec<A:B> = A::B; | ^^^ expected at least 1 generic argument | -note: struct defined here, with at least 1 generic parameter: `T` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> { - | ^^^ - help: add missing generic argument | LL | let _: Vec<T, A:B> = A::B; diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path.rs b/tests/ui/suggestions/type-ascription-instead-of-path.rs index ce40b55f1..ce40b55f1 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-path.rs diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path.stderr b/tests/ui/suggestions/type-ascription-instead-of-path.stderr index 518660cfa..518660cfa 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-path.stderr diff --git a/src/test/ui/suggestions/type-ascription-instead-of-variant.fixed b/tests/ui/suggestions/type-ascription-instead-of-variant.fixed index b3247e128..b3247e128 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-variant.fixed +++ b/tests/ui/suggestions/type-ascription-instead-of-variant.fixed diff --git a/src/test/ui/suggestions/type-ascription-instead-of-variant.rs b/tests/ui/suggestions/type-ascription-instead-of-variant.rs index 6fd2c1954..6fd2c1954 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-variant.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-variant.rs diff --git a/src/test/ui/suggestions/type-ascription-instead-of-variant.stderr b/tests/ui/suggestions/type-ascription-instead-of-variant.stderr index f59ba78d4..f59ba78d4 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-variant.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-variant.stderr diff --git a/tests/ui/suggestions/type-mismatch-byte-literal.rs b/tests/ui/suggestions/type-mismatch-byte-literal.rs new file mode 100644 index 000000000..34199f8c3 --- /dev/null +++ b/tests/ui/suggestions/type-mismatch-byte-literal.rs @@ -0,0 +1,18 @@ +// Tests that a suggestion is issued for type mismatch errors when a +// u8 is expected and a char literal which is ASCII is supplied. + +fn foo(_t: u8) {} + +fn main() { + let _x: u8 = 'X'; + //~^ ERROR: mismatched types [E0308] + //~| HELP: if you meant to write a byte literal, prefix with `b` + + foo('#'); + //~^ ERROR: mismatched types [E0308] + //~| HELP: if you meant to write a byte literal, prefix with `b` + + // Do not issue the suggestion if the char literal isn't ASCII + let _t: u8 = '€'; + //~^ ERROR: mismatched types [E0308] +} diff --git a/tests/ui/suggestions/type-mismatch-byte-literal.stderr b/tests/ui/suggestions/type-mismatch-byte-literal.stderr new file mode 100644 index 000000000..c9c2e7498 --- /dev/null +++ b/tests/ui/suggestions/type-mismatch-byte-literal.stderr @@ -0,0 +1,42 @@ +error[E0308]: mismatched types + --> $DIR/type-mismatch-byte-literal.rs:7:18 + | +LL | let _x: u8 = 'X'; + | -- ^^^ expected `u8`, found `char` + | | + | expected due to this + | +help: if you meant to write a byte literal, prefix with `b` + | +LL | let _x: u8 = b'X'; + | ~~~~ + +error[E0308]: mismatched types + --> $DIR/type-mismatch-byte-literal.rs:11:9 + | +LL | foo('#'); + | --- ^^^ expected `u8`, found `char` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/type-mismatch-byte-literal.rs:4:4 + | +LL | fn foo(_t: u8) {} + | ^^^ ------ +help: if you meant to write a byte literal, prefix with `b` + | +LL | foo(b'#'); + | ~~~~ + +error[E0308]: mismatched types + --> $DIR/type-mismatch-byte-literal.rs:16:18 + | +LL | let _t: u8 = '€'; + | -- ^^^ expected `u8`, found `char` + | | + | expected due to this + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.rs b/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.rs index 2ce122207..2ce122207 100644 --- a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.rs +++ b/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.rs diff --git a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr b/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr index 12466868f..12466868f 100644 --- a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr +++ b/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr diff --git a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.fixed b/tests/ui/suggestions/type-mismatch-struct-field-shorthand.fixed index 91758c0b2..91758c0b2 100644 --- a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.fixed +++ b/tests/ui/suggestions/type-mismatch-struct-field-shorthand.fixed diff --git a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.rs b/tests/ui/suggestions/type-mismatch-struct-field-shorthand.rs index 9d3a17a72..9d3a17a72 100644 --- a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.rs +++ b/tests/ui/suggestions/type-mismatch-struct-field-shorthand.rs diff --git a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr b/tests/ui/suggestions/type-mismatch-struct-field-shorthand.stderr index 72c84d167..72c84d167 100644 --- a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr +++ b/tests/ui/suggestions/type-mismatch-struct-field-shorthand.stderr diff --git a/src/test/ui/suggestions/type-not-found-in-adt-field.rs b/tests/ui/suggestions/type-not-found-in-adt-field.rs index 4cbfe58d3..4cbfe58d3 100644 --- a/src/test/ui/suggestions/type-not-found-in-adt-field.rs +++ b/tests/ui/suggestions/type-not-found-in-adt-field.rs diff --git a/src/test/ui/suggestions/type-not-found-in-adt-field.stderr b/tests/ui/suggestions/type-not-found-in-adt-field.stderr index e990fb5ba..934ba87bb 100644 --- a/src/test/ui/suggestions/type-not-found-in-adt-field.stderr +++ b/tests/ui/suggestions/type-not-found-in-adt-field.stderr @@ -7,10 +7,13 @@ LL | m: Vec<Someunknownname<String, ()>>, error[E0412]: cannot find type `K` in this scope --> $DIR/type-not-found-in-adt-field.rs:6:8 | -LL | struct OtherStruct { - | - help: you might be missing a type parameter: `<K>` LL | m: K, | ^ not found in this scope + | +help: you might be missing a type parameter + | +LL | struct OtherStruct<K> { + | +++ error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/undeclared-module-alloc.rs b/tests/ui/suggestions/undeclared-module-alloc.rs index 1defa1cef..1defa1cef 100644 --- a/src/test/ui/suggestions/undeclared-module-alloc.rs +++ b/tests/ui/suggestions/undeclared-module-alloc.rs diff --git a/src/test/ui/suggestions/undeclared-module-alloc.stderr b/tests/ui/suggestions/undeclared-module-alloc.stderr index 39169dfa9..39169dfa9 100644 --- a/src/test/ui/suggestions/undeclared-module-alloc.stderr +++ b/tests/ui/suggestions/undeclared-module-alloc.stderr diff --git a/src/test/ui/suggestions/unnamable-types.rs b/tests/ui/suggestions/unnamable-types.rs index f2485041d..f2485041d 100644 --- a/src/test/ui/suggestions/unnamable-types.rs +++ b/tests/ui/suggestions/unnamable-types.rs diff --git a/src/test/ui/suggestions/unnamable-types.stderr b/tests/ui/suggestions/unnamable-types.stderr index ede3ebfa7..24bedb529 100644 --- a/src/test/ui/suggestions/unnamable-types.stderr +++ b/tests/ui/suggestions/unnamable-types.stderr @@ -19,7 +19,7 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures LL | const C: _ = || 42; | ^ not allowed in type signatures | -note: however, the inferred type `[closure@$DIR/unnamable-types.rs:17:14: 17:16]` cannot be named +note: however, the inferred type `[closure@unnamable-types.rs:17:14]` cannot be named --> $DIR/unnamable-types.rs:17:14 | LL | const C: _ = || 42; @@ -31,7 +31,7 @@ error: missing type for `const` item LL | const D = S { t: { let i = 0; move || -> i32 { i } } }; | ^ | -note: however, the inferred type `S<[closure@$DIR/unnamable-types.rs:23:31: 23:45]>` cannot be named +note: however, the inferred type `S<[closure@unnamable-types.rs:23:31]>` cannot be named --> $DIR/unnamable-types.rs:23:11 | LL | const D = S { t: { let i = 0; move || -> i32 { i } } }; diff --git a/src/test/ui/suggestions/unnecessary_dot_for_floating_point_literal.rs b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.rs index c1a944562..c1a944562 100644 --- a/src/test/ui/suggestions/unnecessary_dot_for_floating_point_literal.rs +++ b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.rs diff --git a/src/test/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr index 773f1392a..34eaa8322 100644 --- a/src/test/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr +++ b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:2:18 | LL | let _: f64 = 0..10; - | --- ^^^^^ expected `f64`, found struct `std::ops::Range` + | --- ^^^^^ expected `f64`, found struct `Range` | | | expected due to this | @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:5:18 | LL | let _: f64 = std::ops::Range { start: 0, end: 1 }; - | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `std::ops::Range` + | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `Range` | | | expected due to this | diff --git a/src/test/ui/suggestions/unsized-function-parameter.fixed b/tests/ui/suggestions/unsized-function-parameter.fixed index 18e93cb96..18e93cb96 100644 --- a/src/test/ui/suggestions/unsized-function-parameter.fixed +++ b/tests/ui/suggestions/unsized-function-parameter.fixed diff --git a/src/test/ui/suggestions/unsized-function-parameter.rs b/tests/ui/suggestions/unsized-function-parameter.rs index 344ee71c1..344ee71c1 100644 --- a/src/test/ui/suggestions/unsized-function-parameter.rs +++ b/tests/ui/suggestions/unsized-function-parameter.rs diff --git a/src/test/ui/suggestions/unsized-function-parameter.stderr b/tests/ui/suggestions/unsized-function-parameter.stderr index 55d8d1ab1..55d8d1ab1 100644 --- a/src/test/ui/suggestions/unsized-function-parameter.stderr +++ b/tests/ui/suggestions/unsized-function-parameter.stderr diff --git a/src/test/ui/suggestions/unused-closure-argument.rs b/tests/ui/suggestions/unused-closure-argument.rs index 677003ebf..677003ebf 100644 --- a/src/test/ui/suggestions/unused-closure-argument.rs +++ b/tests/ui/suggestions/unused-closure-argument.rs diff --git a/src/test/ui/suggestions/unused-closure-argument.stderr b/tests/ui/suggestions/unused-closure-argument.stderr index 55195ce50..55195ce50 100644 --- a/src/test/ui/suggestions/unused-closure-argument.stderr +++ b/tests/ui/suggestions/unused-closure-argument.stderr diff --git a/src/test/ui/suggestions/use-placement-resolve.fixed b/tests/ui/suggestions/use-placement-resolve.fixed index afe74cff2..afe74cff2 100644 --- a/src/test/ui/suggestions/use-placement-resolve.fixed +++ b/tests/ui/suggestions/use-placement-resolve.fixed diff --git a/src/test/ui/suggestions/use-placement-resolve.rs b/tests/ui/suggestions/use-placement-resolve.rs index b30ddb3af..b30ddb3af 100644 --- a/src/test/ui/suggestions/use-placement-resolve.rs +++ b/tests/ui/suggestions/use-placement-resolve.rs diff --git a/src/test/ui/suggestions/use-placement-resolve.stderr b/tests/ui/suggestions/use-placement-resolve.stderr index 9da9e8e27..9da9e8e27 100644 --- a/src/test/ui/suggestions/use-placement-resolve.stderr +++ b/tests/ui/suggestions/use-placement-resolve.stderr diff --git a/src/test/ui/suggestions/use-placement-typeck.fixed b/tests/ui/suggestions/use-placement-typeck.fixed index 37335da06..37335da06 100644 --- a/src/test/ui/suggestions/use-placement-typeck.fixed +++ b/tests/ui/suggestions/use-placement-typeck.fixed diff --git a/src/test/ui/suggestions/use-placement-typeck.rs b/tests/ui/suggestions/use-placement-typeck.rs index aab20d2e9..aab20d2e9 100644 --- a/src/test/ui/suggestions/use-placement-typeck.rs +++ b/tests/ui/suggestions/use-placement-typeck.rs diff --git a/src/test/ui/suggestions/use-placement-typeck.stderr b/tests/ui/suggestions/use-placement-typeck.stderr index 3b2749773..3b2749773 100644 --- a/src/test/ui/suggestions/use-placement-typeck.stderr +++ b/tests/ui/suggestions/use-placement-typeck.stderr diff --git a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.rs b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.rs index 8b6e8cfd7..8b6e8cfd7 100644 --- a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.rs +++ b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.rs diff --git a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr index 75b919232..75b919232 100644 --- a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr +++ b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr diff --git a/src/test/ui/suggestions/while-let-typo.rs b/tests/ui/suggestions/while-let-typo.rs index dbbcdee3c..dbbcdee3c 100644 --- a/src/test/ui/suggestions/while-let-typo.rs +++ b/tests/ui/suggestions/while-let-typo.rs diff --git a/src/test/ui/suggestions/while-let-typo.stderr b/tests/ui/suggestions/while-let-typo.stderr index 7cc2ed314..7cc2ed314 100644 --- a/src/test/ui/suggestions/while-let-typo.stderr +++ b/tests/ui/suggestions/while-let-typo.stderr |