From 27418827d9a75b7847c3c1e67f6bfa21ca75b23c Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Fri, 5 Sep 2025 14:30:28 -0500 Subject: [PATCH 1/2] Gate 2015 UI tests --- tests/ui/asm/naked-invalid-attr.rs | 1 + tests/ui/asm/naked-invalid-attr.stderr | 16 +- .../associated-types-impl-redirect.rs | 1 + .../associated-types-issue-20346.rs | 1 + .../associated-types-issue-20346.stderr | 6 +- ...iated-types-where-clause-impl-ambiguity.rs | 1 + .../ui/associated-types/cache/chrono-scan.rs | 1 + .../projection-dyn-associated-type.rs | 1 + .../projection-dyn-associated-type.stderr | 10 +- .../field-attributes-vis-unresolved.rs | 1 + .../field-attributes-vis-unresolved.stderr | 4 +- tests/ui/binding/pat-ranges.rs | 1 + tests/ui/block-result/issue-13624.rs | 1 + tests/ui/block-result/issue-13624.stderr | 4 +- .../trait-impl-argument-difference-ice.rs | 1 + .../trait-impl-argument-difference-ice.stderr | 12 +- tests/ui/coherence/coherence_inherent.rs | 1 + tests/ui/coherence/coherence_inherent.stderr | 2 +- tests/ui/coherence/coherence_inherent_cc.rs | 1 + .../ui/coherence/coherence_inherent_cc.stderr | 2 +- .../conditional-compilation/cfg_accessible.rs | 1 + .../cfg_accessible.stderr | 8 +- .../assoc_const_eq_diagnostic.rs | 1 + .../assoc_const_eq_diagnostic.stderr | 16 +- tests/ui/const-generics/invalid-enum.rs | 1 + tests/ui/const-generics/invalid-enum.stderr | 14 +- tests/ui/const-generics/issues/issue-82956.rs | 1 + .../const-generics/issues/issue-82956.stderr | 2 +- .../consts/const_refs_to_static-ice-121413.rs | 1 + .../const_refs_to_static-ice-121413.stderr | 6 +- tests/ui/coroutine/async_gen_fn.e2015.stderr | 18 + tests/ui/coroutine/async_gen_fn.e2018.stderr | 8 + tests/ui/coroutine/async_gen_fn.e2021.stderr | 8 + tests/ui/coroutine/async_gen_fn.e2024.stderr | 2 +- tests/ui/coroutine/async_gen_fn.mid.stderr | 8 + tests/ui/coroutine/async_gen_fn.rs | 11 +- tests/ui/delegation/explicit-paths.rs | 1 + tests/ui/delegation/explicit-paths.stderr | 32 +- ...ssue-38054-do-not-show-unresolved-names.rs | 1 + ...-38054-do-not-show-unresolved-names.stderr | 4 +- .../issue-56028-there-is-an-enum-variant.rs | 1 + ...ssue-56028-there-is-an-enum-variant.stderr | 4 +- .../sugg-stable-import-first-issue-140240.rs | 1 + ...gg-stable-import-first-issue-140240.stderr | 2 +- .../spurious-dyn-compat-errors-58734.rs | 1 + .../spurious-dyn-compat-errors-58734.stderr | 6 +- tests/ui/enum/assoc-fn-call-on-variant.rs | 1 + tests/ui/enum/assoc-fn-call-on-variant.stderr | 2 +- tests/ui/enum/enum-variant-type-2.rs | 1 + tests/ui/enum/enum-variant-type-2.stderr | 2 +- .../env-macro/error-recovery-issue-55897.rs | 1 + .../error-recovery-issue-55897.stderr | 8 +- tests/ui/error-codes/E0432.rs | 1 + tests/ui/error-codes/E0432.stderr | 2 +- tests/ui/error-codes/E0642.fixed | 1 + tests/ui/error-codes/E0642.rs | 1 + tests/ui/error-codes/E0642.stderr | 6 +- ...sue-89280-emitter-overflow-splice-lines.rs | 1 + ...89280-emitter-overflow-splice-lines.stderr | 2 +- tests/ui/extern/extern-crate-visibility.rs | 1 + .../ui/extern/extern-crate-visibility.stderr | 8 +- .../feature-gate-extern_absolute_paths.rs | 1 + .../feature-gate-extern_absolute_paths.stderr | 4 +- .../feature-gate-gen_blocks.e2015.stderr | 21 ++ .../feature-gate-gen_blocks.e2024.stderr | 12 +- .../feature-gate-gen_blocks.mid.stderr | 21 ++ .../feature-gate-gen_blocks.middle.stderr | 21 ++ .../feature-gate-gen_blocks.pre2024.stderr | 21 ++ .../feature-gates/feature-gate-gen_blocks.rs | 19 +- .../feature-gate-offset-of-enum.rs | 1 + .../feature-gate-offset-of-enum.stderr | 8 +- tests/ui/fn/error-recovery-mismatch.rs | 1 + tests/ui/fn/error-recovery-mismatch.stderr | 10 +- tests/ui/hashmap/hashmap-memory.rs | 1 + tests/ui/hygiene/auxiliary/xcrate.rs | 2 + tests/ui/hygiene/globs.rs | 1 + tests/ui/hygiene/globs.stderr | 8 +- tests/ui/hygiene/issue-47311.rs | 1 + tests/ui/hygiene/issue-47312.rs | 1 + tests/ui/hygiene/legacy_interaction.rs | 1 + tests/ui/hygiene/no_implicit_prelude.rs | 1 + tests/ui/hygiene/no_implicit_prelude.stderr | 4 +- tests/ui/hygiene/privacy.rs | 1 + tests/ui/hygiene/privacy.stderr | 4 +- tests/ui/hygiene/trait_items.rs | 1 + tests/ui/hygiene/trait_items.stderr | 2 +- tests/ui/hygiene/xcrate.rs | 1 + .../impl-trait/no-method-suggested-traits.rs | 1 + .../no-method-suggested-traits.stderr | 60 ++-- tests/ui/imports/ambiguous-14.rs | 1 + tests/ui/imports/ambiguous-14.stderr | 12 +- tests/ui/imports/ambiguous-17.rs | 1 + tests/ui/imports/ambiguous-17.stderr | 14 +- tests/ui/imports/ambiguous-4-extern.rs | 1 + tests/ui/imports/ambiguous-4-extern.stderr | 18 +- tests/ui/imports/ambiguous-4.rs | 1 + tests/ui/imports/append-import-suggestion.rs | 1 + .../imports/append-import-suggestion.stderr | 6 +- tests/ui/imports/auxiliary/glob-conflict.rs | 2 + tests/ui/imports/bad-import-with-rename.rs | 1 + .../ui/imports/bad-import-with-rename.stderr | 4 +- ...elude-extern-crate-restricted-shadowing.rs | 1 + ...e-extern-crate-restricted-shadowing.stderr | 6 +- .../ui/imports/glob-conflict-cross-crate-1.rs | 1 + .../glob-conflict-cross-crate-1.stderr | 4 +- tests/ui/imports/glob-resolve1.rs | 1 + tests/ui/imports/glob-resolve1.stderr | 32 +- .../ui/imports/import-from-missing-star-3.rs | 1 + .../imports/import-from-missing-star-3.stderr | 4 +- tests/ui/imports/import-from-missing-star.rs | 1 + .../imports/import-from-missing-star.stderr | 2 +- tests/ui/imports/import.rs | 1 + tests/ui/imports/import.stderr | 8 +- tests/ui/imports/import3.rs | 1 + tests/ui/imports/import3.stderr | 2 +- tests/ui/imports/import7.rs | 1 + tests/ui/imports/inaccessible_type_aliases.rs | 1 + .../imports/inaccessible_type_aliases.stderr | 8 +- tests/ui/imports/issue-109343.rs | 1 + tests/ui/imports/issue-109343.stderr | 2 +- tests/ui/imports/issue-1697.rs | 1 + tests/ui/imports/issue-1697.stderr | 2 +- tests/ui/imports/issue-28388-1.rs | 1 + tests/ui/imports/issue-28388-1.stderr | 2 +- tests/ui/imports/issue-32833.rs | 1 + tests/ui/imports/issue-32833.stderr | 2 +- tests/ui/imports/issue-33464.rs | 1 + tests/ui/imports/issue-33464.stderr | 6 +- tests/ui/imports/issue-36881.rs | 1 + tests/ui/imports/issue-36881.stderr | 2 +- tests/ui/imports/issue-37887.rs | 1 + tests/ui/imports/issue-37887.stderr | 4 +- tests/ui/imports/issue-38293.rs | 1 + tests/ui/imports/issue-38293.stderr | 4 +- tests/ui/imports/issue-4366-2.rs | 1 + tests/ui/imports/issue-4366-2.stderr | 8 +- tests/ui/imports/issue-4366.rs | 1 + tests/ui/imports/issue-4366.stderr | 4 +- ...n-crate-rename-suggestion-formatting.fixed | 1 + ...tern-crate-rename-suggestion-formatting.rs | 1 + ...-crate-rename-suggestion-formatting.stderr | 2 +- tests/ui/imports/issue-53269.rs | 1 + tests/ui/imports/issue-53269.stderr | 8 +- tests/ui/imports/issue-55457.rs | 1 + tests/ui/imports/issue-55457.stderr | 4 +- tests/ui/imports/issue-55884-2.rs | 1 + tests/ui/imports/issue-55884-2.stderr | 10 +- tests/ui/imports/issue-57015.rs | 1 + tests/ui/imports/issue-57015.stderr | 2 +- tests/ui/imports/issue-81413.rs | 1 + tests/ui/imports/issue-81413.stderr | 2 +- tests/ui/imports/local-modularized.rs | 1 + tests/ui/imports/no-std-inject.rs | 1 + tests/ui/imports/no-std-inject.stderr | 2 +- tests/ui/imports/overlapping_pub_trait.rs | 1 + tests/ui/imports/overlapping_pub_trait.stderr | 2 +- .../private-std-reexport-suggest-public.fixed | 1 + .../private-std-reexport-suggest-public.rs | 1 + ...private-std-reexport-suggest-public.stderr | 4 +- tests/ui/imports/resolve_self_super_hint.rs | 1 + .../ui/imports/resolve_self_super_hint.stderr | 8 +- tests/ui/imports/rfc-1560-warning-cycle.rs | 1 + .../ui/imports/rfc-1560-warning-cycle.stderr | 6 +- .../shadow-glob-module-resolution-2.rs | 1 + .../shadow-glob-module-resolution-2.stderr | 6 +- .../show-private-items-issue-138626.rs | 1 + .../show-private-items-issue-138626.stderr | 4 +- ...est-import-issue-120074.edition2015.stderr | 2 +- ...est-import-issue-120074.edition2021.stderr | 2 +- ...uggest-import-issue-120074.post2015.stderr | 23 ++ .../ui/imports/suggest-import-issue-120074.rs | 4 +- tests/ui/imports/tool-mod-child.rs | 1 + tests/ui/imports/tool-mod-child.stderr | 8 +- tests/ui/imports/unnamed_pub_trait.rs | 1 + tests/ui/imports/unnamed_pub_trait.stderr | 2 +- tests/ui/imports/unresolved-imports-used.rs | 1 + .../ui/imports/unresolved-imports-used.stderr | 20 +- .../inference-variable-behind-raw-pointer.rs | 1 + ...ference-variable-behind-raw-pointer.stderr | 2 +- tests/ui/issues/issue-17546.rs | 1 + tests/ui/issues/issue-17546.stderr | 8 +- tests/ui/issues/issue-28344.rs | 1 + tests/ui/issues/issue-28344.stderr | 8 +- tests/ui/issues/issue-35976.rs | 1 + tests/ui/issues/issue-35976.unimported.stderr | 2 +- .../keyword-extern-as-identifier-use.rs | 1 + .../keyword-extern-as-identifier-use.stderr | 4 +- .../continue-pointing-to-block-ice-113379.rs | 1 + ...ntinue-pointing-to-block-ice-113379.stderr | 8 +- tests/ui/lang-items/issue-83471.rs | 1 + tests/ui/lang-items/issue-83471.stderr | 16 +- .../allowed-group-warn-by-default-lint.rs | 1 + .../allowed-group-warn-by-default-lint.stderr | 2 +- tests/ui/lint/force-warn/cap-lints-allow.rs | 1 + .../ui/lint/force-warn/cap-lints-allow.stderr | 2 +- ...lints-warn-allowed-warn-by-default-lint.rs | 1 + ...s-warn-allowed-warn-by-default-lint.stderr | 2 +- ...-group-allowed-cli-warn-by-default-lint.rs | 1 + ...up-allowed-cli-warn-by-default-lint.stderr | 2 +- .../lint-group-allowed-lint-group.rs | 1 + .../lint-group-allowed-lint-group.stderr | 2 +- ...lint-group-allowed-warn-by-default-lint.rs | 1 + ...-group-allowed-warn-by-default-lint.stderr | 2 +- .../ui/lint/future-incompatible-lint-group.rs | 1 + .../future-incompatible-lint-group.stderr | 10 +- .../lint/inclusive-range-pattern-syntax.fixed | 1 + .../ui/lint/inclusive-range-pattern-syntax.rs | 1 + .../inclusive-range-pattern-syntax.stderr | 6 +- tests/ui/lint/issue-35075.rs | 1 + tests/ui/lint/issue-35075.stderr | 4 +- tests/ui/lint/issue-87274-paren-parent.rs | 1 + tests/ui/lint/issue-87274-paren-parent.stderr | 2 +- tests/ui/lint/lint-attr-everywhere-early.rs | 1 + .../ui/lint/lint-attr-everywhere-early.stderr | 148 ++++---- tests/ui/lint/use_suggestion_json.rs | 1 + tests/ui/lint/use_suggestion_json.stderr | 114 +++---- tests/ui/macros/auxiliary/issue-100199.rs | 1 + tests/ui/macros/issue-100199.rs | 1 + tests/ui/macros/issue-100199.stderr | 2 +- tests/ui/macros/macro-comma-support-rpass.rs | 1 + .../macro-or-patterns-back-compat.fixed | 1 + .../macros/macro-or-patterns-back-compat.rs | 1 + .../macro-or-patterns-back-compat.stderr | 10 +- tests/ui/macros/macro-outer-attributes.rs | 1 + tests/ui/macros/macro-outer-attributes.stderr | 4 +- .../ui/macros/macro-path-prelude-shadowing.rs | 1 + .../macro-path-prelude-shadowing.stderr | 4 +- tests/ui/macros/macro-rules-attr.rs | 1 + tests/ui/macros/macro-rules-attr.stderr | 6 +- tests/ui/macros/meta-item-absolute-path.rs | 1 + .../ui/macros/meta-item-absolute-path.stderr | 4 +- tests/ui/macros/no-std-macros.rs | 1 + .../rigid-alias-bound-is-not-inherent-2.rs | 1 + ...rigid-alias-bound-is-not-inherent-2.stderr | 2 +- tests/ui/mir/var_debug_ref.rs | 2 +- tests/ui/namespace/auxiliary/namespace-mix.rs | 2 + tests/ui/namespace/namespace-mix.rs | 1 + tests/ui/namespace/namespace-mix.stderr | 316 +++++++++--------- tests/ui/offset-of/offset-of-enum.rs | 1 + tests/ui/offset-of/offset-of-enum.stderr | 12 +- tests/ui/offset-of/offset-of-self.rs | 1 + tests/ui/offset-of/offset-of-self.stderr | 14 +- tests/ui/panic-handler/weak-lang-item.rs | 1 + tests/ui/panic-handler/weak-lang-item.stderr | 2 +- .../unexpected-type-issue-120601.rs | 1 + .../unexpected-type-issue-120601.stderr | 7 +- tests/ui/parser/recover/recover-pat-ranges.rs | 1 + .../parser/recover/recover-pat-ranges.stderr | 28 +- .../recover/recover-quantified-closure.rs | 1 + .../recover/recover-quantified-closure.stderr | 8 +- tests/ui/parser/recover/recover-range-pats.rs | 1 + .../parser/recover/recover-range-pats.stderr | 140 ++++---- tests/ui/parser/trait-object-trait-parens.rs | 1 + .../parser/trait-object-trait-parens.stderr | 18 +- tests/ui/parser/triple-colon.fixed | 1 + tests/ui/parser/triple-colon.rs | 1 + tests/ui/parser/triple-colon.stderr | 24 +- tests/ui/parser/where_with_bound.rs | 1 + tests/ui/parser/where_with_bound.stderr | 4 +- tests/ui/pattern/no-patterns-in-args-2.rs | 1 + tests/ui/pattern/no-patterns-in-args-2.stderr | 6 +- tests/ui/privacy/privacy-in-paths.rs | 1 + tests/ui/privacy/privacy-in-paths.stderr | 12 +- tests/ui/privacy/privacy-ns1.rs | 1 + tests/ui/privacy/privacy-ns1.stderr | 14 +- tests/ui/privacy/privacy-ns2.rs | 1 + tests/ui/privacy/privacy-ns2.stderr | 28 +- tests/ui/privacy/privacy1.rs | 1 + tests/ui/privacy/privacy1.stderr | 62 ++-- tests/ui/privacy/private-variant-reexport.rs | 1 + .../privacy/private-variant-reexport.stderr | 18 +- .../restricted/struct-literal-field.rs | 1 + .../restricted/struct-literal-field.stderr | 2 +- tests/ui/privacy/restricted/test.rs | 1 + tests/ui/privacy/restricted/test.stderr | 28 +- .../sealed-traits/re-exported-trait.fixed | 1 + .../sealed-traits/re-exported-trait.rs | 1 + .../sealed-traits/re-exported-trait.stderr | 4 +- tests/ui/proc-macro/attributes-included.rs | 1 + .../ui/proc-macro/attributes-included.stderr | 4 +- .../proc-macro/attributes-on-modules-fail.rs | 1 + .../attributes-on-modules-fail.stderr | 14 +- .../auxiliary/derive-helper-shadowing.rs | 3 + tests/ui/proc-macro/auxiliary/duplicate.rs | 2 + tests/ui/proc-macro/auxiliary/generate-mod.rs | 1 + .../proc-macro/auxiliary/mixed-site-span.rs | 1 + .../proc-macro/auxiliary/token-site-span.rs | 1 + ...derive-helper-shadowing.edition2015.stderr | 78 +++++ ...erive-helper-shadowing.edition2018.stderr} | 20 +- .../ui/proc-macro/derive-helper-shadowing.rs | 6 +- tests/ui/proc-macro/generate-mod.rs | 1 + tests/ui/proc-macro/generate-mod.stderr | 28 +- .../proc-macro/macro-crate-multi-decorator.rs | 1 + tests/ui/proc-macro/mixed-site-span.rs | 1 + tests/ui/proc-macro/mixed-site-span.stderr | 140 ++++---- .../range-inclusive-pattern-precedence.fixed | 1 + .../range-inclusive-pattern-precedence.rs | 1 + .../range-inclusive-pattern-precedence.stderr | 6 +- .../range-inclusive-pattern-precedence2.rs | 1 + ...range-inclusive-pattern-precedence2.stderr | 6 +- tests/ui/resolve/112590-2.fixed | 1 + tests/ui/resolve/112590-2.rs | 1 + tests/ui/resolve/112590-2.stderr | 10 +- tests/ui/resolve/crate-called-as-function.rs | 1 + .../resolve/crate-called-as-function.stderr | 2 +- .../enum-expected-value-suggest-variants.rs | 1 + ...num-expected-value-suggest-variants.stderr | 38 +-- tests/ui/resolve/global-scope-resolution.rs | 1 + .../issue-107563-ambiguous-glob-reexports.rs | 1 + ...sue-107563-ambiguous-glob-reexports.stderr | 12 +- tests/ui/resolve/issue-116164.rs | 1 + tests/ui/resolve/issue-116164.stderr | 2 +- tests/ui/resolve/issue-16058.rs | 1 + tests/ui/resolve/issue-16058.stderr | 2 +- tests/ui/resolve/issue-17518.rs | 1 + tests/ui/resolve/issue-17518.stderr | 2 +- tests/ui/resolve/issue-21221-1.rs | 1 + tests/ui/resolve/issue-21221-1.stderr | 10 +- tests/ui/resolve/issue-21221-2.rs | 1 + tests/ui/resolve/issue-21221-2.stderr | 2 +- tests/ui/resolve/issue-26545.rs | 1 + tests/ui/resolve/issue-26545.stderr | 2 +- tests/ui/resolve/issue-30535.rs | 1 + tests/ui/resolve/issue-30535.stderr | 2 +- tests/ui/resolve/issue-35675.rs | 1 + tests/ui/resolve/issue-35675.stderr | 14 +- tests/ui/resolve/issue-42944.rs | 1 + tests/ui/resolve/issue-42944.stderr | 8 +- tests/ui/resolve/issue-82865.rs | 1 + tests/ui/resolve/issue-82865.stderr | 4 +- tests/ui/resolve/issue-88472.rs | 1 + tests/ui/resolve/issue-88472.stderr | 12 +- tests/ui/resolve/issue-90113.rs | 1 + tests/ui/resolve/issue-90113.stderr | 2 +- tests/ui/resolve/privacy-enum-ctor.rs | 1 + tests/ui/resolve/privacy-enum-ctor.stderr | 72 ++-- tests/ui/resolve/privacy-struct-ctor.rs | 1 + tests/ui/resolve/privacy-struct-ctor.stderr | 30 +- tests/ui/resolve/resolve-bad-import-prefix.rs | 1 + .../resolve/resolve-bad-import-prefix.stderr | 2 +- ...e-conflict-extern-crate-vs-extern-crate.rs | 1 + ...nflict-extern-crate-vs-extern-crate.stderr | 5 +- ...resolve-conflict-import-vs-extern-crate.rs | 1 + ...lve-conflict-import-vs-extern-crate.stderr | 2 +- .../resolve-conflict-item-vs-extern-crate.rs | 1 + ...solve-conflict-item-vs-extern-crate.stderr | 2 +- .../ui/resolve/resolve-inconsistent-names.rs | 1 + .../resolve/resolve-inconsistent-names.stderr | 20 +- .../ui/resolve/resolve-primitive-fallback.rs | 1 + .../resolve/resolve-primitive-fallback.stderr | 6 +- .../ui/resolve/resolve-variant-assoc-item.rs | 1 + .../resolve/resolve-variant-assoc-item.stderr | 4 +- ...gest-import-without-clobbering-attrs.fixed | 1 + ...suggest-import-without-clobbering-attrs.rs | 1 + ...est-import-without-clobbering-attrs.stderr | 2 +- .../underscore-bindings-disambiguators.rs | 1 + .../underscore-bindings-disambiguators.stderr | 16 +- tests/ui/resolve/use-shadowing-14082.rs | 1 + .../ui/resolve/use_suggestion_placement.fixed | 1 + tests/ui/resolve/use_suggestion_placement.rs | 1 + .../resolve/use_suggestion_placement.stderr | 6 +- .../crate-path-non-absolute.rs | 1 + .../crate-path-non-absolute.stderr | 4 +- .../attr-without-param.rs | 1 + .../attr-without-param.stderr | 6 +- .../param-attrs-pretty.rs | 1 + .../proc-macro-cannot-be-used.rs | 1 + .../proc-macro-cannot-be-used.stderr | 58 ++-- .../suggestions-not-always-applicable.rs | 1 + .../ui/rust-2021/generic-type-collision.fixed | 1 + tests/ui/rust-2021/generic-type-collision.rs | 1 + .../rust-2021/generic-type-collision.stderr | 4 +- tests/ui/rust-2024/gen-kw.e2015.stderr | 18 +- tests/ui/rust-2024/gen-kw.e2018.stderr | 18 +- tests/ui/rust-2024/gen-kw.rs | 1 + .../in_2024_compatibility.rs | 1 + .../in_2024_compatibility.stderr | 4 +- .../unsafe-attributes-fix.fixed | 1 + .../unsafe-attributes-fix.rs | 1 + .../unsafe-attributes-fix.stderr | 16 +- .../ui/rust-2024/unsafe-env-suggestion.fixed | 1 + tests/ui/rust-2024/unsafe-env-suggestion.rs | 1 + .../ui/rust-2024/unsafe-env-suggestion.stderr | 6 +- .../unsafe-extern-suggestion.fixed | 1 + .../unsafe-extern-suggestion.rs | 1 + .../unsafe-extern-suggestion.stderr | 4 +- tests/ui/self/self_type_keyword.rs | 1 + tests/ui/self/self_type_keyword.stderr | 28 +- tests/ui/shadowed/shadowed-trait-methods.rs | 1 + .../ui/shadowed/shadowed-trait-methods.stderr | 2 +- .../simd/portable-intrinsics-arent-exposed.rs | 1 + .../portable-intrinsics-arent-exposed.stderr | 4 +- tests/ui/stats/input-stats.rs | 1 + ...empt-to-add-suggestions-with-no-changes.rs | 1 + ...-to-add-suggestions-with-no-changes.stderr | 4 +- .../dont-suggest-foreign-doc-hidden.rs | 1 + .../dont-suggest-foreign-doc-hidden.stderr | 12 +- .../dont-wrap-ambiguous-receivers.rs | 1 + .../dont-wrap-ambiguous-receivers.stderr | 2 +- .../ui/suggestions/raw-name-use-suggestion.rs | 1 + .../raw-name-use-suggestion.stderr | 6 +- .../suggest-swapping-self-ty-and-trait.rs | 1 + .../suggest-swapping-self-ty-and-trait.stderr | 18 +- .../ui/suggestions/use-placement-typeck.fixed | 1 + tests/ui/suggestions/use-placement-typeck.rs | 1 + .../suggestions/use-placement-typeck.stderr | 2 +- .../test-attrs/inaccessible-test-modules.rs | 1 + .../inaccessible-test-modules.stderr | 4 +- tests/ui/traits/bound/not-on-bare-trait.rs | 1 + .../ui/traits/bound/not-on-bare-trait.stderr | 6 +- tests/ui/traits/const-traits/issue-102156.rs | 1 + .../traits/const-traits/issue-102156.stderr | 4 +- tests/ui/traits/item-privacy.rs | 1 + tests/ui/traits/item-privacy.stderr | 40 +-- tests/ui/traits/method-private.rs | 1 + tests/ui/traits/method-private.stderr | 2 +- .../missing-for-type-in-impl.e2015.stderr | 12 +- .../missing-for-type-in-impl.e2021.stderr | 6 +- tests/ui/traits/missing-for-type-in-impl.rs | 1 + ...sted-mod-trait-method-lookup-leak-10465.rs | 1 + ...-mod-trait-method-lookup-leak-10465.stderr | 2 +- .../traits/unspecified-self-in-trait-ref.rs | 1 + .../unspecified-self-in-trait-ref.stderr | 20 +- tests/ui/typeck/issue-43189.rs | 1 + tests/ui/typeck/issue-43189.stderr | 2 +- .../unresolved/unresolved-asterisk-imports.rs | 1 + .../unresolved-asterisk-imports.stderr | 2 +- tests/ui/unresolved/unresolved-candidates.rs | 1 + .../unresolved/unresolved-candidates.stderr | 4 +- tests/ui/unresolved/unresolved-import.rs | 1 + tests/ui/unresolved/unresolved-import.stderr | 14 +- tests/ui/variants/variant-used-as-type.rs | 1 + tests/ui/variants/variant-used-as-type.stderr | 4 +- ...ce-hir-wf-check-anon-const-issue-122989.rs | 1 + ...ir-wf-check-anon-const-issue-122989.stderr | 16 +- 435 files changed, 1753 insertions(+), 1281 deletions(-) create mode 100644 tests/ui/coroutine/async_gen_fn.e2015.stderr create mode 100644 tests/ui/coroutine/async_gen_fn.e2018.stderr create mode 100644 tests/ui/coroutine/async_gen_fn.e2021.stderr create mode 100644 tests/ui/coroutine/async_gen_fn.mid.stderr create mode 100644 tests/ui/feature-gates/feature-gate-gen_blocks.e2015.stderr create mode 100644 tests/ui/feature-gates/feature-gate-gen_blocks.mid.stderr create mode 100644 tests/ui/feature-gates/feature-gate-gen_blocks.middle.stderr create mode 100644 tests/ui/feature-gates/feature-gate-gen_blocks.pre2024.stderr create mode 100644 tests/ui/imports/suggest-import-issue-120074.post2015.stderr create mode 100644 tests/ui/proc-macro/derive-helper-shadowing.edition2015.stderr rename tests/ui/proc-macro/{derive-helper-shadowing.stderr => derive-helper-shadowing.edition2018.stderr} (87%) diff --git a/tests/ui/asm/naked-invalid-attr.rs b/tests/ui/asm/naked-invalid-attr.rs index c9e0949abfb1e..eba7cf01b7b29 100644 --- a/tests/ui/asm/naked-invalid-attr.rs +++ b/tests/ui/asm/naked-invalid-attr.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Checks that the #[unsafe(naked)] attribute can be placed on function definitions only. // //@ needs-asm-support diff --git a/tests/ui/asm/naked-invalid-attr.stderr b/tests/ui/asm/naked-invalid-attr.stderr index 923d2de1f323d..a6348923277dd 100644 --- a/tests/ui/asm/naked-invalid-attr.stderr +++ b/tests/ui/asm/naked-invalid-attr.stderr @@ -1,11 +1,11 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a` - --> $DIR/naked-invalid-attr.rs:56:5 + --> $DIR/naked-invalid-attr.rs:57:5 | LL | #[::a] | ^ use of unresolved module or unlinked crate `a` error: `#[naked]` attribute cannot be used on crates - --> $DIR/naked-invalid-attr.rs:4:1 + --> $DIR/naked-invalid-attr.rs:5:1 | LL | #![unsafe(naked)] | ^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | #![unsafe(naked)] = help: `#[naked]` can only be applied to functions error: `#[naked]` attribute cannot be used on foreign functions - --> $DIR/naked-invalid-attr.rs:9:5 + --> $DIR/naked-invalid-attr.rs:10:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can be applied to functions and methods error: `#[naked]` attribute cannot be used on structs - --> $DIR/naked-invalid-attr.rs:13:1 + --> $DIR/naked-invalid-attr.rs:14:1 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can only be applied to functions error: `#[naked]` attribute cannot be used on struct fields - --> $DIR/naked-invalid-attr.rs:16:5 + --> $DIR/naked-invalid-attr.rs:17:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -37,7 +37,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can only be applied to functions error: `#[naked]` attribute cannot be used on required trait methods - --> $DIR/naked-invalid-attr.rs:22:5 + --> $DIR/naked-invalid-attr.rs:23:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can be applied to functions, inherent methods, provided trait methods, and trait methods in impl blocks error: `#[naked]` attribute cannot be used on closures - --> $DIR/naked-invalid-attr.rs:51:5 + --> $DIR/naked-invalid-attr.rs:52:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -53,7 +53,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can be applied to functions and methods error[E0736]: attribute incompatible with `#[unsafe(naked)]` - --> $DIR/naked-invalid-attr.rs:56:3 + --> $DIR/naked-invalid-attr.rs:57:3 | LL | #[::a] | ^^^ the `::a` attribute is incompatible with `#[unsafe(naked)]` diff --git a/tests/ui/associated-types/associated-types-impl-redirect.rs b/tests/ui/associated-types/associated-types-impl-redirect.rs index 2cbe0d7254026..64cae31e5693b 100644 --- a/tests/ui/associated-types/associated-types-impl-redirect.rs +++ b/tests/ui/associated-types/associated-types-impl-redirect.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass #![allow(dead_code)] #![allow(unused_mut)] diff --git a/tests/ui/associated-types/associated-types-issue-20346.rs b/tests/ui/associated-types/associated-types-issue-20346.rs index 0cce847e1be54..c011132619dd8 100644 --- a/tests/ui/associated-types/associated-types-issue-20346.rs +++ b/tests/ui/associated-types/associated-types-issue-20346.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Test that we reliably check the value of the associated type. #![crate_type = "lib"] diff --git a/tests/ui/associated-types/associated-types-issue-20346.stderr b/tests/ui/associated-types/associated-types-issue-20346.stderr index 8e6b847b3aac9..d95aeb9afb742 100644 --- a/tests/ui/associated-types/associated-types-issue-20346.stderr +++ b/tests/ui/associated-types/associated-types-issue-20346.stderr @@ -1,5 +1,5 @@ error[E0271]: type mismatch resolving ` as Iterator>::Item == Option` - --> $DIR/associated-types-issue-20346.rs:34:36 + --> $DIR/associated-types-issue-20346.rs:35:36 | LL | fn test_adapter>>(it: I) { | - found this type parameter @@ -10,14 +10,14 @@ LL | is_iterator_of::, _>(&adapter); | required by a bound introduced by this call | note: expected this to be `Option` - --> $DIR/associated-types-issue-20346.rs:23:17 + --> $DIR/associated-types-issue-20346.rs:24:17 | LL | type Item = T; | ^ = note: expected enum `Option` found type parameter `T` note: required by a bound in `is_iterator_of` - --> $DIR/associated-types-issue-20346.rs:15:34 + --> $DIR/associated-types-issue-20346.rs:16:34 | LL | fn is_iterator_of>(_: &I) {} | ^^^^^^ required by this bound in `is_iterator_of` diff --git a/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs b/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs index 34c269d4d903f..0de7617943c65 100644 --- a/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs +++ b/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass #![allow(dead_code)] #![allow(unused_imports)] diff --git a/tests/ui/associated-types/cache/chrono-scan.rs b/tests/ui/associated-types/cache/chrono-scan.rs index 83fdfa60d0d70..f63620a0c3800 100644 --- a/tests/ui/associated-types/cache/chrono-scan.rs +++ b/tests/ui/associated-types/cache/chrono-scan.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass #![allow(deprecated)] diff --git a/tests/ui/associated-types/projection-dyn-associated-type.rs b/tests/ui/associated-types/projection-dyn-associated-type.rs index 3b981e7987e0e..32328f8793c71 100644 --- a/tests/ui/associated-types/projection-dyn-associated-type.rs +++ b/tests/ui/associated-types/projection-dyn-associated-type.rs @@ -1,5 +1,6 @@ // Regression test for the projection bug in // +//@ edition: 2015 //@ compile-flags: -Zincremental-verify-ich=yes //@ incremental diff --git a/tests/ui/associated-types/projection-dyn-associated-type.stderr b/tests/ui/associated-types/projection-dyn-associated-type.stderr index 1ac2beb0414e2..76c4405cfb349 100644 --- a/tests/ui/associated-types/projection-dyn-associated-type.stderr +++ b/tests/ui/associated-types/projection-dyn-associated-type.stderr @@ -1,11 +1,11 @@ error: expected identifier, found `}` - --> $DIR/projection-dyn-associated-type.rs:26:1 + --> $DIR/projection-dyn-associated-type.rs:27:1 | LL | } | ^ expected identifier warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/projection-dyn-associated-type.rs:13:28 + --> $DIR/projection-dyn-associated-type.rs:14:28 | LL | impl Mirror for A { | ^ @@ -24,13 +24,13 @@ LL + impl Mirror for U { | error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates - --> $DIR/projection-dyn-associated-type.rs:13:6 + --> $DIR/projection-dyn-associated-type.rs:14:6 | LL | impl Mirror for A { | ^ unconstrained type parameter error[E0277]: the trait bound `(dyn B + 'static): Mirror` is not satisfied - --> $DIR/projection-dyn-associated-type.rs:22:6 + --> $DIR/projection-dyn-associated-type.rs:23:6 | LL | ) -> &'a ::Assoc { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `(dyn B + 'static)` @@ -38,7 +38,7 @@ LL | ) -> &'a ::Assoc { = help: the trait `Mirror` is implemented for `dyn A` error[E0277]: the trait bound `(dyn B + 'static): Mirror` is not satisfied - --> $DIR/projection-dyn-associated-type.rs:22:6 + --> $DIR/projection-dyn-associated-type.rs:23:6 | LL | ) -> &'a ::Assoc { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `(dyn B + 'static)` diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.rs b/tests/ui/attributes/field-attributes-vis-unresolved.rs index d1bd2a1e72724..be710a3cd744c 100644 --- a/tests/ui/attributes/field-attributes-vis-unresolved.rs +++ b/tests/ui/attributes/field-attributes-vis-unresolved.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Non-builtin attributes do not mess with field visibility resolution (issue #67006). mod internal { diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.stderr b/tests/ui/attributes/field-attributes-vis-unresolved.stderr index d689b76eaf8b0..1ebfde4cd67e3 100644 --- a/tests/ui/attributes/field-attributes-vis-unresolved.stderr +++ b/tests/ui/attributes/field-attributes-vis-unresolved.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` - --> $DIR/field-attributes-vis-unresolved.rs:17:12 + --> $DIR/field-attributes-vis-unresolved.rs:18:12 | LL | pub(in nonexistent) field: u8 | ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent` @@ -10,7 +10,7 @@ LL + extern crate nonexistent; | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` - --> $DIR/field-attributes-vis-unresolved.rs:22:12 + --> $DIR/field-attributes-vis-unresolved.rs:23:12 | LL | pub(in nonexistent) u8 | ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent` diff --git a/tests/ui/binding/pat-ranges.rs b/tests/ui/binding/pat-ranges.rs index 7d43b8b5cfba7..4c0ae4c6d8dc6 100644 --- a/tests/ui/binding/pat-ranges.rs +++ b/tests/ui/binding/pat-ranges.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass // Parsing of range patterns diff --git a/tests/ui/block-result/issue-13624.rs b/tests/ui/block-result/issue-13624.rs index f9f7c33e4119a..a0297d5b0382b 100644 --- a/tests/ui/block-result/issue-13624.rs +++ b/tests/ui/block-result/issue-13624.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ dont-require-annotations: NOTE mod a { diff --git a/tests/ui/block-result/issue-13624.stderr b/tests/ui/block-result/issue-13624.stderr index 16f5233a0410b..383466a592dc8 100644 --- a/tests/ui/block-result/issue-13624.stderr +++ b/tests/ui/block-result/issue-13624.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-13624.rs:9:5 + --> $DIR/issue-13624.rs:10:5 | LL | pub fn get_enum_struct_variant() -> () { | -- expected `()` because of return type @@ -7,7 +7,7 @@ LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum` error[E0308]: mismatched types - --> $DIR/issue-13624.rs:22:9 + --> $DIR/issue-13624.rs:23:9 | LL | match enum_struct_variant { | ------------------- this expression has type `()` diff --git a/tests/ui/borrowck/trait-impl-argument-difference-ice.rs b/tests/ui/borrowck/trait-impl-argument-difference-ice.rs index 872507cc4de6a..92f8f24335a7b 100644 --- a/tests/ui/borrowck/trait-impl-argument-difference-ice.rs +++ b/tests/ui/borrowck/trait-impl-argument-difference-ice.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Issue https://github.com/rust-lang/rust/issues/123414 trait MemoryUnit { extern "C" fn read_word(&mut self) -> u8; diff --git a/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr b/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr index 3d54d5269ae2b..795fb4b4350c2 100644 --- a/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr +++ b/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr @@ -1,5 +1,5 @@ warning: anonymous parameters are deprecated and will be removed in the next edition - --> $DIR/trait-impl-argument-difference-ice.rs:4:30 + --> $DIR/trait-impl-argument-difference-ice.rs:5:30 | LL | extern "C" fn read_dword(Self::Assoc<'_>) -> u16; | ^^^^^^^^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: Self::Assoc<'_>` @@ -9,7 +9,7 @@ LL | extern "C" fn read_dword(Self::Assoc<'_>) -> u16; = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default error[E0185]: method `read_dword` has a `&self` declaration in the impl, but not in the trait - --> $DIR/trait-impl-argument-difference-ice.rs:14:5 + --> $DIR/trait-impl-argument-difference-ice.rs:15:5 | LL | extern "C" fn read_dword(Self::Assoc<'_>) -> u16; | ------------------------------------------------- trait method declared without `&self` @@ -18,7 +18,7 @@ LL | extern "C" fn read_dword(&'_ self) -> u16 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl error[E0046]: not all trait items implemented, missing: `read_word` - --> $DIR/trait-impl-argument-difference-ice.rs:12:1 + --> $DIR/trait-impl-argument-difference-ice.rs:13:1 | LL | extern "C" fn read_word(&mut self) -> u8; | ----------------------------------------- `read_word` from trait @@ -27,13 +27,13 @@ LL | impl MemoryUnit for ROM { | ^^^^^^^^^^^^^^^^^^^^^^^ missing `read_word` in implementation error[E0220]: associated type `Assoc` not found for `Self` - --> $DIR/trait-impl-argument-difference-ice.rs:4:36 + --> $DIR/trait-impl-argument-difference-ice.rs:5:36 | LL | extern "C" fn read_dword(Self::Assoc<'_>) -> u16; | ^^^^^ associated type `Assoc` not found error[E0596]: cannot borrow `*self` as mutable, as it is behind a `&` reference - --> $DIR/trait-impl-argument-difference-ice.rs:16:19 + --> $DIR/trait-impl-argument-difference-ice.rs:17:19 | LL | let a16 = self.read_word() as u16; | ^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable @@ -44,7 +44,7 @@ LL | extern "C" fn read_dword(&'_ mut self) -> u16 { | +++ error[E0596]: cannot borrow `*self` as mutable, as it is behind a `&` reference - --> $DIR/trait-impl-argument-difference-ice.rs:18:19 + --> $DIR/trait-impl-argument-difference-ice.rs:19:19 | LL | let b16 = self.read_word() as u16; | ^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable diff --git a/tests/ui/coherence/coherence_inherent.rs b/tests/ui/coherence/coherence_inherent.rs index b2007e3437d6b..e053c51fd03db 100644 --- a/tests/ui/coherence/coherence_inherent.rs +++ b/tests/ui/coherence/coherence_inherent.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Tests that methods that implement a trait cannot be invoked // unless the trait is imported. diff --git a/tests/ui/coherence/coherence_inherent.stderr b/tests/ui/coherence/coherence_inherent.stderr index 17b49279de7b6..df184526c03f0 100644 --- a/tests/ui/coherence/coherence_inherent.stderr +++ b/tests/ui/coherence/coherence_inherent.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `the_fn` found for reference `&TheStruct` in the current scope - --> $DIR/coherence_inherent.rs:31:11 + --> $DIR/coherence_inherent.rs:32:11 | LL | s.the_fn(); | ^^^^^^ method not found in `&TheStruct` diff --git a/tests/ui/coherence/coherence_inherent_cc.rs b/tests/ui/coherence/coherence_inherent_cc.rs index 662f186340bdb..1f9613c62f114 100644 --- a/tests/ui/coherence/coherence_inherent_cc.rs +++ b/tests/ui/coherence/coherence_inherent_cc.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:coherence_inherent_cc_lib.rs // Tests that methods that implement a trait cannot be invoked diff --git a/tests/ui/coherence/coherence_inherent_cc.stderr b/tests/ui/coherence/coherence_inherent_cc.stderr index b3c1125d63e38..ad8b630f16b76 100644 --- a/tests/ui/coherence/coherence_inherent_cc.stderr +++ b/tests/ui/coherence/coherence_inherent_cc.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `the_fn` found for reference `&TheStruct` in the current scope - --> $DIR/coherence_inherent_cc.rs:23:11 + --> $DIR/coherence_inherent_cc.rs:24:11 | LL | s.the_fn(); | ^^^^^^ method not found in `&TheStruct` diff --git a/tests/ui/conditional-compilation/cfg_accessible.rs b/tests/ui/conditional-compilation/cfg_accessible.rs index df380d0d16f14..ac39db3bd722a 100644 --- a/tests/ui/conditional-compilation/cfg_accessible.rs +++ b/tests/ui/conditional-compilation/cfg_accessible.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(cfg_accessible)] mod m { diff --git a/tests/ui/conditional-compilation/cfg_accessible.stderr b/tests/ui/conditional-compilation/cfg_accessible.stderr index e3731a1ad7128..d2dbe8c1628a1 100644 --- a/tests/ui/conditional-compilation/cfg_accessible.stderr +++ b/tests/ui/conditional-compilation/cfg_accessible.stderr @@ -1,23 +1,23 @@ error[E0425]: cannot find value `ExistingPrivate` in this scope - --> $DIR/cfg_accessible.rs:52:5 + --> $DIR/cfg_accessible.rs:53:5 | LL | ExistingPrivate; | ^^^^^^^^^^^^^^^ not found in this scope | note: unit struct `m::ExistingPrivate` exists but is inaccessible - --> $DIR/cfg_accessible.rs:5:5 + --> $DIR/cfg_accessible.rs:6:5 | LL | struct ExistingPrivate; | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0425]: cannot find value `NonExistingPrivate` in this scope - --> $DIR/cfg_accessible.rs:53:5 + --> $DIR/cfg_accessible.rs:54:5 | LL | NonExistingPrivate; | ^^^^^^^^^^^^^^^^^^ not found in this scope error[E0425]: cannot find value `NonExistingTraitAlias` in this scope - --> $DIR/cfg_accessible.rs:54:5 + --> $DIR/cfg_accessible.rs:55:5 | LL | NonExistingTraitAlias; | ^^^^^^^^^^^^^^^^^^^^^ not found in this scope diff --git a/tests/ui/const-generics/assoc_const_eq_diagnostic.rs b/tests/ui/const-generics/assoc_const_eq_diagnostic.rs index 573d8055a79cd..6ab82f45e6846 100644 --- a/tests/ui/const-generics/assoc_const_eq_diagnostic.rs +++ b/tests/ui/const-generics/assoc_const_eq_diagnostic.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(associated_const_equality)] pub enum Mode { diff --git a/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr b/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr index 13f081940f39e..bcfad9d1538ce 100644 --- a/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr +++ b/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `Mode::Cool` - --> $DIR/assoc_const_eq_diagnostic.rs:11:35 + --> $DIR/assoc_const_eq_diagnostic.rs:12:35 | LL | pub trait CoolStuff: Parse {} | ^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | pub trait CoolStuff: Parse {} | help: try using the variant's enum: `Mode` error[E0573]: expected type, found variant `Mode::Cool` - --> $DIR/assoc_const_eq_diagnostic.rs:17:17 + --> $DIR/assoc_const_eq_diagnostic.rs:18:17 | LL | fn no_help() -> Mode::Cool {} | ^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | fn no_help() -> Mode::Cool {} | help: try using the variant's enum: `Mode` error: expected constant, found type - --> $DIR/assoc_const_eq_diagnostic.rs:11:35 + --> $DIR/assoc_const_eq_diagnostic.rs:12:35 | LL | pub trait CoolStuff: Parse {} | ---- ^^^^^^^^^^ unexpected type @@ -25,7 +25,7 @@ LL | pub trait CoolStuff: Parse {} | expected a constant because of this associated constant | note: the associated constant is defined here - --> $DIR/assoc_const_eq_diagnostic.rs:8:5 + --> $DIR/assoc_const_eq_diagnostic.rs:9:5 | LL | const MODE: Mode; | ^^^^^^^^^^^^^^^^ @@ -35,7 +35,7 @@ LL | pub trait CoolStuff: Parse {} | + + error: expected constant, found type - --> $DIR/assoc_const_eq_diagnostic.rs:11:35 + --> $DIR/assoc_const_eq_diagnostic.rs:12:35 | LL | pub trait CoolStuff: Parse {} | ---- ^^^^^^^^^^ unexpected type @@ -43,7 +43,7 @@ LL | pub trait CoolStuff: Parse {} | expected a constant because of this associated constant | note: the associated constant is defined here - --> $DIR/assoc_const_eq_diagnostic.rs:8:5 + --> $DIR/assoc_const_eq_diagnostic.rs:9:5 | LL | const MODE: Mode; | ^^^^^^^^^^^^^^^^ @@ -54,7 +54,7 @@ LL | pub trait CoolStuff: Parse {} | + + error: expected constant, found type - --> $DIR/assoc_const_eq_diagnostic.rs:11:35 + --> $DIR/assoc_const_eq_diagnostic.rs:12:35 | LL | pub trait CoolStuff: Parse {} | ---- ^^^^^^^^^^ unexpected type @@ -62,7 +62,7 @@ LL | pub trait CoolStuff: Parse {} | expected a constant because of this associated constant | note: the associated constant is defined here - --> $DIR/assoc_const_eq_diagnostic.rs:8:5 + --> $DIR/assoc_const_eq_diagnostic.rs:9:5 | LL | const MODE: Mode; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/const-generics/invalid-enum.rs b/tests/ui/const-generics/invalid-enum.rs index fcfad300c44e5..56fac3e2eb6c8 100644 --- a/tests/ui/const-generics/invalid-enum.rs +++ b/tests/ui/const-generics/invalid-enum.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(adt_const_params)] #![allow(incomplete_features)] diff --git a/tests/ui/const-generics/invalid-enum.stderr b/tests/ui/const-generics/invalid-enum.stderr index f588ff0bc8eb4..911052370f43c 100644 --- a/tests/ui/const-generics/invalid-enum.stderr +++ b/tests/ui/const-generics/invalid-enum.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `CompileFlag::A` - --> $DIR/invalid-enum.rs:23:12 + --> $DIR/invalid-enum.rs:24:12 | LL | test_1::(); | ^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | test_1::(); | help: try using the variant's enum: `CompileFlag` error[E0573]: expected type, found variant `CompileFlag::A` - --> $DIR/invalid-enum.rs:27:15 + --> $DIR/invalid-enum.rs:28:15 | LL | test_2::<_, CompileFlag::A>(0); | ^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | test_2::<_, CompileFlag::A>(0); | help: try using the variant's enum: `CompileFlag` error[E0573]: expected type, found variant `CompileFlag::A` - --> $DIR/invalid-enum.rs:31:18 + --> $DIR/invalid-enum.rs:32:18 | LL | let _: Example = Example { x: 0 }; | ^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | let _: Example = Example { x: 0 }; | help: try using the variant's enum: `CompileFlag` error[E0747]: unresolved item provided when a constant was expected - --> $DIR/invalid-enum.rs:23:12 + --> $DIR/invalid-enum.rs:24:12 | LL | test_1::(); | ^^^^^^^^^^^^^^ @@ -37,7 +37,7 @@ LL | test_1::<{ CompileFlag::A }>(); | + + error[E0747]: unresolved item provided when a constant was expected - --> $DIR/invalid-enum.rs:27:15 + --> $DIR/invalid-enum.rs:28:15 | LL | test_2::<_, CompileFlag::A>(0); | ^^^^^^^^^^^^^^ @@ -48,7 +48,7 @@ LL | test_2::<_, { CompileFlag::A }>(0); | + + error[E0747]: unresolved item provided when a constant was expected - --> $DIR/invalid-enum.rs:31:18 + --> $DIR/invalid-enum.rs:32:18 | LL | let _: Example = Example { x: 0 }; | ^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ LL | let _: Example<{ CompileFlag::A }, _> = Example { x: 0 }; | + + error[E0747]: type provided when a constant was expected - --> $DIR/invalid-enum.rs:35:18 + --> $DIR/invalid-enum.rs:36:18 | LL | let _: Example = Example { x: 0 }; | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/const-generics/issues/issue-82956.rs b/tests/ui/const-generics/issues/issue-82956.rs index 3539e9b966c86..983717170c342 100644 --- a/tests/ui/const-generics/issues/issue-82956.rs +++ b/tests/ui/const-generics/issues/issue-82956.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(generic_const_exprs)] #![allow(incomplete_features)] diff --git a/tests/ui/const-generics/issues/issue-82956.stderr b/tests/ui/const-generics/issues/issue-82956.stderr index fd93e5122a5ef..beb8014961153 100644 --- a/tests/ui/const-generics/issues/issue-82956.stderr +++ b/tests/ui/const-generics/issues/issue-82956.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared type `IntoIter` - --> $DIR/issue-82956.rs:25:24 + --> $DIR/issue-82956.rs:26:24 | LL | let mut iter = IntoIter::new(self); | ^^^^^^^^ use of undeclared type `IntoIter` diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.rs b/tests/ui/consts/const_refs_to_static-ice-121413.rs index 432ae1ad5e3be..cc368d971c055 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.rs +++ b/tests/ui/consts/const_refs_to_static-ice-121413.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // ICE: ImmTy { imm: Scalar(alloc1), ty: *const dyn Sync } input to a fat-to-thin cast (*const dyn Sync -> *const usize // or with -Zextra-const-ub-checks: expected wide pointer extra data (e.g. slice length or trait object vtable) // issue: rust-lang/rust#121413 diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.stderr b/tests/ui/consts/const_refs_to_static-ice-121413.stderr index ea3daca51eff4..89429d83b2052 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.stderr +++ b/tests/ui/consts/const_refs_to_static-ice-121413.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared type `AtomicUsize` - --> $DIR/const_refs_to_static-ice-121413.rs:8:24 + --> $DIR/const_refs_to_static-ice-121413.rs:9:24 | LL | static FOO: Sync = AtomicUsize::new(0); | ^^^^^^^^^^^ use of undeclared type `AtomicUsize` @@ -10,7 +10,7 @@ LL + use std::sync::atomic::AtomicUsize; | warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/const_refs_to_static-ice-121413.rs:8:17 + --> $DIR/const_refs_to_static-ice-121413.rs:9:17 | LL | static FOO: Sync = AtomicUsize::new(0); | ^^^^ @@ -24,7 +24,7 @@ LL | static FOO: dyn Sync = AtomicUsize::new(0); | +++ error[E0277]: the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time - --> $DIR/const_refs_to_static-ice-121413.rs:8:5 + --> $DIR/const_refs_to_static-ice-121413.rs:9:5 | LL | static FOO: Sync = AtomicUsize::new(0); | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/tests/ui/coroutine/async_gen_fn.e2015.stderr b/tests/ui/coroutine/async_gen_fn.e2015.stderr new file mode 100644 index 0000000000000..640b6b76e7e9a --- /dev/null +++ b/tests/ui/coroutine/async_gen_fn.e2015.stderr @@ -0,0 +1,18 @@ +error[E0670]: `async fn` is not permitted in Rust 2015 + --> $DIR/async_gen_fn.rs:6:1 + | +LL | async gen fn foo() {} + | ^^^^^ to use `async fn`, switch to Rust 2018 or later + | + = help: pass `--edition 2024` to `rustc` + = note: for more on editions, read https://doc.rust-lang.org/edition-guide + +error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` + --> $DIR/async_gen_fn.rs:6:7 + | +LL | async gen fn foo() {} + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0670`. diff --git a/tests/ui/coroutine/async_gen_fn.e2018.stderr b/tests/ui/coroutine/async_gen_fn.e2018.stderr new file mode 100644 index 0000000000000..34c55ac3f61f1 --- /dev/null +++ b/tests/ui/coroutine/async_gen_fn.e2018.stderr @@ -0,0 +1,8 @@ +error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` + --> $DIR/async_gen_fn.rs:7:7 + | +LL | async gen fn foo() {} + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + +error: aborting due to 1 previous error + diff --git a/tests/ui/coroutine/async_gen_fn.e2021.stderr b/tests/ui/coroutine/async_gen_fn.e2021.stderr new file mode 100644 index 0000000000000..34c55ac3f61f1 --- /dev/null +++ b/tests/ui/coroutine/async_gen_fn.e2021.stderr @@ -0,0 +1,8 @@ +error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` + --> $DIR/async_gen_fn.rs:7:7 + | +LL | async gen fn foo() {} + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + +error: aborting due to 1 previous error + diff --git a/tests/ui/coroutine/async_gen_fn.e2024.stderr b/tests/ui/coroutine/async_gen_fn.e2024.stderr index 37dc674a7e3a7..349e1923dd05c 100644 --- a/tests/ui/coroutine/async_gen_fn.e2024.stderr +++ b/tests/ui/coroutine/async_gen_fn.e2024.stderr @@ -1,5 +1,5 @@ error[E0658]: gen blocks are experimental - --> $DIR/async_gen_fn.rs:4:1 + --> $DIR/async_gen_fn.rs:6:1 | LL | async gen fn foo() {} | ^^^^^^^^^ diff --git a/tests/ui/coroutine/async_gen_fn.mid.stderr b/tests/ui/coroutine/async_gen_fn.mid.stderr new file mode 100644 index 0000000000000..baf2c4ede3f0c --- /dev/null +++ b/tests/ui/coroutine/async_gen_fn.mid.stderr @@ -0,0 +1,8 @@ +error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` + --> $DIR/async_gen_fn.rs:6:7 + | +LL | async gen fn foo() {} + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + +error: aborting due to 1 previous error + diff --git a/tests/ui/coroutine/async_gen_fn.rs b/tests/ui/coroutine/async_gen_fn.rs index b9adeec3f4027..8b7a7524c53ac 100644 --- a/tests/ui/coroutine/async_gen_fn.rs +++ b/tests/ui/coroutine/async_gen_fn.rs @@ -1,9 +1,12 @@ -//@ revisions: e2024 none +//@ revisions: e2015 mid e2024 +//@[e2015] edition: 2015 +//@[mid] edition: 2018..2024 //@[e2024] edition: 2024 async gen fn foo() {} -//[none]~^ ERROR: `async fn` is not permitted in Rust 2015 -//[none]~| ERROR: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` -//[e2024]~^^^ ERROR: gen blocks are experimental +//[e2015]~^ ERROR: `async fn` is not permitted in Rust 2015 +//[e2015]~| ERROR: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` +//[mid]~^^^ ERROR: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` +//[e2024]~^^^^ ERROR: gen blocks are experimental fn main() {} diff --git a/tests/ui/delegation/explicit-paths.rs b/tests/ui/delegation/explicit-paths.rs index 3b0454eb52400..018025041c0bc 100644 --- a/tests/ui/delegation/explicit-paths.rs +++ b/tests/ui/delegation/explicit-paths.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(fn_delegation)] #![allow(incomplete_features)] diff --git a/tests/ui/delegation/explicit-paths.stderr b/tests/ui/delegation/explicit-paths.stderr index 29f87cf1457b1..be84988ab23be 100644 --- a/tests/ui/delegation/explicit-paths.stderr +++ b/tests/ui/delegation/explicit-paths.stderr @@ -1,5 +1,5 @@ error[E0407]: method `foo3` is not a member of trait `Trait` - --> $DIR/explicit-paths.rs:49:9 + --> $DIR/explicit-paths.rs:50:9 | LL | reuse to_reuse::foo3; | ^^^^^^^^^^^^^^^^----^ @@ -8,7 +8,7 @@ LL | reuse to_reuse::foo3; | not a member of trait `Trait` error[E0407]: method `foo4` is not a member of trait `Trait` - --> $DIR/explicit-paths.rs:51:9 + --> $DIR/explicit-paths.rs:52:9 | LL | reuse F::foo4 { &self.0 } | ^^^^^^^^^----^^^^^^^^^^^^ @@ -17,49 +17,49 @@ LL | reuse F::foo4 { &self.0 } | not a member of trait `Trait` error[E0425]: cannot find function `foo4` in `S` - --> $DIR/explicit-paths.rs:27:14 + --> $DIR/explicit-paths.rs:28:14 | LL | reuse S::foo4; | ^^^^ not found in `S` error[E0425]: cannot find function `foo4` in `F` - --> $DIR/explicit-paths.rs:38:18 + --> $DIR/explicit-paths.rs:39:18 | LL | reuse F::foo4 { &self.0 } | ^^^^ not found in `F` | note: function `fn_to_other::foo4` exists but is inaccessible - --> $DIR/explicit-paths.rs:27:5 + --> $DIR/explicit-paths.rs:28:5 | LL | reuse S::foo4; | ^^^^^^^^^^^^^^ not accessible error[E0425]: cannot find function `foo4` in `F` - --> $DIR/explicit-paths.rs:51:18 + --> $DIR/explicit-paths.rs:52:18 | LL | reuse F::foo4 { &self.0 } | ^^^^ not found in `F` | note: function `fn_to_other::foo4` exists but is inaccessible - --> $DIR/explicit-paths.rs:27:5 + --> $DIR/explicit-paths.rs:28:5 | LL | reuse S::foo4; | ^^^^^^^^^^^^^^ not accessible error[E0425]: cannot find function `foo4` in `F` - --> $DIR/explicit-paths.rs:65:18 + --> $DIR/explicit-paths.rs:66:18 | LL | reuse F::foo4 { &F } | ^^^^ not found in `F` | note: function `fn_to_other::foo4` exists but is inaccessible - --> $DIR/explicit-paths.rs:27:5 + --> $DIR/explicit-paths.rs:28:5 | LL | reuse S::foo4; | ^^^^^^^^^^^^^^ not accessible error[E0119]: conflicting implementations of trait `Trait` for type `S` - --> $DIR/explicit-paths.rs:74:5 + --> $DIR/explicit-paths.rs:75:5 | LL | impl Trait for S { | ---------------- first implementation here @@ -68,7 +68,7 @@ LL | impl Trait for S { | ^^^^^^^^^^^^^^^^ conflicting implementation for `S` error[E0308]: mismatched types - --> $DIR/explicit-paths.rs:61:36 + --> $DIR/explicit-paths.rs:62:36 | LL | trait Trait2 : Trait { | -------------------- found this type parameter @@ -80,19 +80,19 @@ LL | reuse ::foo1 { self } = note: expected reference `&F` found reference `&Self` note: method defined here - --> $DIR/explicit-paths.rs:5:8 + --> $DIR/explicit-paths.rs:6:8 | LL | fn foo1(&self, x: i32) -> i32 { x } | ^^^^ ----- error[E0277]: the trait bound `S2: Trait` is not satisfied - --> $DIR/explicit-paths.rs:76:16 + --> $DIR/explicit-paths.rs:77:16 | LL | reuse ::foo1; | ^^ unsatisfied trait bound | help: the trait `Trait` is not implemented for `S2` - --> $DIR/explicit-paths.rs:73:5 + --> $DIR/explicit-paths.rs:74:5 | LL | struct S2; | ^^^^^^^^^ @@ -101,7 +101,7 @@ LL | struct S2; S error[E0308]: mismatched types - --> $DIR/explicit-paths.rs:76:30 + --> $DIR/explicit-paths.rs:77:30 | LL | reuse ::foo1; | ^^^^ @@ -112,7 +112,7 @@ LL | reuse ::foo1; = note: expected reference `&S2` found reference `&S` note: method defined here - --> $DIR/explicit-paths.rs:5:8 + --> $DIR/explicit-paths.rs:6:8 | LL | fn foo1(&self, x: i32) -> i32 { x } | ^^^^ ----- diff --git a/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs b/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs index a1ef68ecfe213..1701eb23d7da3 100644 --- a/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs +++ b/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use Foo; //~ ERROR unresolved use Foo1; //~ ERROR unresolved diff --git a/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr b/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr index 852abaed724dc..caab7fabb2017 100644 --- a/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr +++ b/tests/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr @@ -1,11 +1,11 @@ error[E0432]: unresolved import `Foo` - --> $DIR/issue-38054-do-not-show-unresolved-names.rs:1:5 + --> $DIR/issue-38054-do-not-show-unresolved-names.rs:2:5 | LL | use Foo; | ^^^ no `Foo` in the root error[E0432]: unresolved import `Foo1` - --> $DIR/issue-38054-do-not-show-unresolved-names.rs:3:5 + --> $DIR/issue-38054-do-not-show-unresolved-names.rs:4:5 | LL | use Foo1; | ^^^^ no `Foo1` in the root diff --git a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs index 264cfa449942c..4636d618e80c4 100644 --- a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs +++ b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs @@ -1,3 +1,4 @@ +//@ edition:2015 enum PutDown { Set } enum AffixHeart { Set } enum CauseToBe { Set } diff --git a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr index 12965800a027f..887fcf0b73c43 100644 --- a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr +++ b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Set` in this scope - --> $DIR/issue-56028-there-is-an-enum-variant.rs:9:15 + --> $DIR/issue-56028-there-is-an-enum-variant.rs:10:15 | LL | fn setup() -> Set { Set } | ^^^ not found in this scope @@ -21,7 +21,7 @@ LL + fn setup() -> PutDown { Set } = and 3 other candidates error[E0425]: cannot find value `Set` in this scope - --> $DIR/issue-56028-there-is-an-enum-variant.rs:9:21 + --> $DIR/issue-56028-there-is-an-enum-variant.rs:10:21 | LL | fn setup() -> Set { Set } | ^^^ not found in this scope diff --git a/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.rs b/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.rs index aa7178271a792..6ee541970c821 100644 --- a/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.rs +++ b/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn main() { const _: Range = 0..1; //~ ERROR cannot find type `Range` in this scope } diff --git a/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.stderr b/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.stderr index 9e4314a0699d8..ca8f8cc07afbf 100644 --- a/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.stderr +++ b/tests/ui/did_you_mean/sugg-stable-import-first-issue-140240.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Range` in this scope - --> $DIR/sugg-stable-import-first-issue-140240.rs:2:14 + --> $DIR/sugg-stable-import-first-issue-140240.rs:3:14 | LL | const _: Range = 0..1; | ^^^^^ not found in this scope diff --git a/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.rs b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.rs index 3e9ebb497a21b..9859dd90c49b0 100644 --- a/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.rs +++ b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // https://github.com/rust-lang/rust/issues/58734 trait Trait { fn exists(self) -> (); diff --git a/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.stderr b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.stderr index 140461283f368..5461579b911f5 100644 --- a/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.stderr +++ b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/spurious-dyn-compat-errors-58734.rs:21:5 + --> $DIR/spurious-dyn-compat-errors-58734.rs:22:5 | LL | Trait::nonexistent(()); | ^^^^^ @@ -13,14 +13,14 @@ LL | ::nonexistent(()); | ++++ + error[E0038]: the trait `Trait` is not dyn compatible - --> $DIR/spurious-dyn-compat-errors-58734.rs:21:5 + --> $DIR/spurious-dyn-compat-errors-58734.rs:22:5 | LL | Trait::nonexistent(()); | ^^^^^ `Trait` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/spurious-dyn-compat-errors-58734.rs:5:8 + --> $DIR/spurious-dyn-compat-errors-58734.rs:6:8 | LL | trait Trait { | ----- this trait is not dyn compatible... diff --git a/tests/ui/enum/assoc-fn-call-on-variant.rs b/tests/ui/enum/assoc-fn-call-on-variant.rs index 7fa8eb2da41ac..0886e7dcd8d82 100644 --- a/tests/ui/enum/assoc-fn-call-on-variant.rs +++ b/tests/ui/enum/assoc-fn-call-on-variant.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #[derive(Default)] enum E { A {}, diff --git a/tests/ui/enum/assoc-fn-call-on-variant.stderr b/tests/ui/enum/assoc-fn-call-on-variant.stderr index 5318025f55458..ee75870ad394c 100644 --- a/tests/ui/enum/assoc-fn-call-on-variant.stderr +++ b/tests/ui/enum/assoc-fn-call-on-variant.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: `A` is a variant, not a module - --> $DIR/assoc-fn-call-on-variant.rs:14:8 + --> $DIR/assoc-fn-call-on-variant.rs:15:8 | LL | E::A::f(); | ^ `A` is a variant, not a module diff --git a/tests/ui/enum/enum-variant-type-2.rs b/tests/ui/enum/enum-variant-type-2.rs index 27286a0a3ddda..a0bfd7834cd74 100644 --- a/tests/ui/enum/enum-variant-type-2.rs +++ b/tests/ui/enum/enum-variant-type-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Test that enum variants are not actually types. enum Foo { diff --git a/tests/ui/enum/enum-variant-type-2.stderr b/tests/ui/enum/enum-variant-type-2.stderr index 216dbda5dd7ad..a69e38b2df8bd 100644 --- a/tests/ui/enum/enum-variant-type-2.stderr +++ b/tests/ui/enum/enum-variant-type-2.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `Foo::Bar` - --> $DIR/enum-variant-type-2.rs:7:11 + --> $DIR/enum-variant-type-2.rs:8:11 | LL | fn foo(x: Foo::Bar) {} | ^^^^^^^^ diff --git a/tests/ui/env-macro/error-recovery-issue-55897.rs b/tests/ui/env-macro/error-recovery-issue-55897.rs index b6500e5405933..0c6ac9d7deec8 100644 --- a/tests/ui/env-macro/error-recovery-issue-55897.rs +++ b/tests/ui/env-macro/error-recovery-issue-55897.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use prelude::*; //~ ERROR unresolved import `prelude` mod unresolved_env { diff --git a/tests/ui/env-macro/error-recovery-issue-55897.stderr b/tests/ui/env-macro/error-recovery-issue-55897.stderr index 3d9ef56c50276..e839378bf2f82 100644 --- a/tests/ui/env-macro/error-recovery-issue-55897.stderr +++ b/tests/ui/env-macro/error-recovery-issue-55897.stderr @@ -1,5 +1,5 @@ error: environment variable `NON_EXISTENT` not defined at compile time - --> $DIR/error-recovery-issue-55897.rs:10:22 + --> $DIR/error-recovery-issue-55897.rs:11:22 | LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs")); | ^^^^^^^^^^^^^^^^^^^^ @@ -7,13 +7,13 @@ LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs")); = help: use `std::env::var("NON_EXISTENT")` to read the variable at run time error: suffixes on string literals are invalid - --> $DIR/error-recovery-issue-55897.rs:15:22 + --> $DIR/error-recovery-issue-55897.rs:16:22 | LL | include!(concat!("NON_EXISTENT"suffix, "/data.rs")); | ^^^^^^^^^^^^^^^^^^^^ invalid suffix `suffix` error[E0432]: unresolved import `prelude` - --> $DIR/error-recovery-issue-55897.rs:1:5 + --> $DIR/error-recovery-issue-55897.rs:2:5 | LL | use prelude::*; | ^^^^^^^ @@ -22,7 +22,7 @@ LL | use prelude::*; | help: a similar path exists: `std::prelude` error[E0432]: unresolved import `env` - --> $DIR/error-recovery-issue-55897.rs:4:9 + --> $DIR/error-recovery-issue-55897.rs:5:9 | LL | use env; | ^^^ no `env` in the root diff --git a/tests/ui/error-codes/E0432.rs b/tests/ui/error-codes/E0432.rs index 1fc95f945665c..990b600d34084 100644 --- a/tests/ui/error-codes/E0432.rs +++ b/tests/ui/error-codes/E0432.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use something::Foo; //~ ERROR E0432 fn main () { diff --git a/tests/ui/error-codes/E0432.stderr b/tests/ui/error-codes/E0432.stderr index 4ff8b40d1969d..d8516f80ee639 100644 --- a/tests/ui/error-codes/E0432.stderr +++ b/tests/ui/error-codes/E0432.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `something` - --> $DIR/E0432.rs:1:5 + --> $DIR/E0432.rs:2:5 | LL | use something::Foo; | ^^^^^^^^^ use of unresolved module or unlinked crate `something` diff --git a/tests/ui/error-codes/E0642.fixed b/tests/ui/error-codes/E0642.fixed index 1b7e0684254a3..499c9b2024137 100644 --- a/tests/ui/error-codes/E0642.fixed +++ b/tests/ui/error-codes/E0642.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(unused)] // for rustfix diff --git a/tests/ui/error-codes/E0642.rs b/tests/ui/error-codes/E0642.rs index ceac23574083c..2b7efbccd8844 100644 --- a/tests/ui/error-codes/E0642.rs +++ b/tests/ui/error-codes/E0642.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(unused)] // for rustfix diff --git a/tests/ui/error-codes/E0642.stderr b/tests/ui/error-codes/E0642.stderr index 97309e95b6b49..df0838567c4ce 100644 --- a/tests/ui/error-codes/E0642.stderr +++ b/tests/ui/error-codes/E0642.stderr @@ -1,5 +1,5 @@ error[E0642]: patterns aren't allowed in methods without bodies - --> $DIR/E0642.rs:9:12 + --> $DIR/E0642.rs:10:12 | LL | fn foo((x, y): (i32, i32)); | ^^^^^^ @@ -11,7 +11,7 @@ LL + fn foo(_: (i32, i32)); | error[E0642]: patterns aren't allowed in methods without bodies - --> $DIR/E0642.rs:11:12 + --> $DIR/E0642.rs:12:12 | LL | fn bar((x, y): (i32, i32)) {} | ^^^^^^ @@ -23,7 +23,7 @@ LL + fn bar(_: (i32, i32)) {} | error[E0642]: patterns aren't allowed in methods without bodies - --> $DIR/E0642.rs:13:15 + --> $DIR/E0642.rs:14:15 | LL | fn method(S { .. }: S) {} | ^^^^^^^^ diff --git a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.rs b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.rs index dff3d02248b11..7aa6787ab74f2 100644 --- a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.rs +++ b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass trait X { diff --git a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr index 462819c138f42..ed1ebe4466afd 100644 --- a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr +++ b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr @@ -1,5 +1,5 @@ warning: anonymous parameters are deprecated and will be removed in the next edition - --> $DIR/issue-89280-emitter-overflow-splice-lines.rs:4:21 + --> $DIR/issue-89280-emitter-overflow-splice-lines.rs:5:21 | LL | fn test(x: u32, ( | _____________________^ diff --git a/tests/ui/extern/extern-crate-visibility.rs b/tests/ui/extern/extern-crate-visibility.rs index cda1227cc8e92..2e857f038e5ce 100644 --- a/tests/ui/extern/extern-crate-visibility.rs +++ b/tests/ui/extern/extern-crate-visibility.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod foo { extern crate core; } diff --git a/tests/ui/extern/extern-crate-visibility.stderr b/tests/ui/extern/extern-crate-visibility.stderr index c037da41b5eae..bbb7a3bc0bd33 100644 --- a/tests/ui/extern/extern-crate-visibility.stderr +++ b/tests/ui/extern/extern-crate-visibility.stderr @@ -1,11 +1,11 @@ error[E0603]: crate import `core` is private - --> $DIR/extern-crate-visibility.rs:6:10 + --> $DIR/extern-crate-visibility.rs:7:10 | LL | use foo::core::cell; | ^^^^ private crate import | note: the crate import `core` is defined here - --> $DIR/extern-crate-visibility.rs:2:5 + --> $DIR/extern-crate-visibility.rs:3:5 | LL | extern crate core; | ^^^^^^^^^^^^^^^^^^ @@ -16,13 +16,13 @@ LL + use std::cell; | error[E0603]: crate import `core` is private - --> $DIR/extern-crate-visibility.rs:9:10 + --> $DIR/extern-crate-visibility.rs:10:10 | LL | foo::core::cell::Cell::new(0); | ^^^^ private crate import | note: the crate import `core` is defined here - --> $DIR/extern-crate-visibility.rs:2:5 + --> $DIR/extern-crate-visibility.rs:3:5 | LL | extern crate core; | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs index cff273ce2c55a..e52a2140e86d0 100644 --- a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs +++ b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use core::default; //~ ERROR unresolved import `core` fn main() { diff --git a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr index 2f5e3650734ec..dd78501de7185 100644 --- a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr +++ b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `core` - --> $DIR/feature-gate-extern_absolute_paths.rs:1:5 + --> $DIR/feature-gate-extern_absolute_paths.rs:2:5 | LL | use core::default; | ^^^^ @@ -8,7 +8,7 @@ LL | use core::default; | help: try using `std` instead of `core`: `std` error[E0433]: failed to resolve: you might be missing crate `core` - --> $DIR/feature-gate-extern_absolute_paths.rs:4:19 + --> $DIR/feature-gate-extern_absolute_paths.rs:5:19 | LL | let _: u8 = ::core::default::Default(); | ^^^^ you might be missing crate `core` diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.e2015.stderr b/tests/ui/feature-gates/feature-gate-gen_blocks.e2015.stderr new file mode 100644 index 0000000000000..0a0e466832ae7 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.e2015.stderr @@ -0,0 +1,21 @@ +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:15:11 + | +LL | async gen {}; + | ^^^ expected one of 8 possible tokens + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:29:11 + | +LL | async gen {}; + | ^^^ expected one of 8 possible tokens + +error[E0422]: cannot find struct, variant or union type `gen` in this scope + --> $DIR/feature-gate-gen_blocks.rs:7:5 + | +LL | gen {}; + | ^^^ not found in this scope + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0422`. diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.e2024.stderr b/tests/ui/feature-gates/feature-gate-gen_blocks.e2024.stderr index 7cdcaeaee5750..168d685a79017 100644 --- a/tests/ui/feature-gates/feature-gate-gen_blocks.e2024.stderr +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.e2024.stderr @@ -1,5 +1,5 @@ error[E0658]: gen blocks are experimental - --> $DIR/feature-gate-gen_blocks.rs:5:5 + --> $DIR/feature-gate-gen_blocks.rs:7:5 | LL | gen {}; | ^^^ @@ -9,7 +9,7 @@ LL | gen {}; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: gen blocks are experimental - --> $DIR/feature-gate-gen_blocks.rs:12:5 + --> $DIR/feature-gate-gen_blocks.rs:15:5 | LL | async gen {}; | ^^^^^^^^^ @@ -19,7 +19,7 @@ LL | async gen {}; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: gen blocks are experimental - --> $DIR/feature-gate-gen_blocks.rs:22:5 + --> $DIR/feature-gate-gen_blocks.rs:26:5 | LL | gen {}; | ^^^ @@ -29,7 +29,7 @@ LL | gen {}; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: gen blocks are experimental - --> $DIR/feature-gate-gen_blocks.rs:25:5 + --> $DIR/feature-gate-gen_blocks.rs:29:5 | LL | async gen {}; | ^^^^^^^^^ @@ -39,13 +39,13 @@ LL | async gen {}; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0282]: type annotations needed - --> $DIR/feature-gate-gen_blocks.rs:5:5 + --> $DIR/feature-gate-gen_blocks.rs:7:5 | LL | gen {}; | ^^^^^^ cannot infer type error[E0282]: type annotations needed - --> $DIR/feature-gate-gen_blocks.rs:12:5 + --> $DIR/feature-gate-gen_blocks.rs:15:5 | LL | async gen {}; | ^^^^^^^^^^^^ cannot infer type diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.mid.stderr b/tests/ui/feature-gates/feature-gate-gen_blocks.mid.stderr new file mode 100644 index 0000000000000..174321e518951 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.mid.stderr @@ -0,0 +1,21 @@ +error: expected one of `move`, `use`, `{`, `|`, or `||`, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:14:11 + | +LL | async gen {}; + | ^^^ expected one of `move`, `use`, `{`, `|`, or `||` + +error: expected one of `move`, `use`, `{`, `|`, or `||`, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:27:11 + | +LL | async gen {}; + | ^^^ expected one of `move`, `use`, `{`, `|`, or `||` + +error[E0422]: cannot find struct, variant or union type `gen` in this scope + --> $DIR/feature-gate-gen_blocks.rs:7:5 + | +LL | gen {}; + | ^^^ not found in this scope + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0422`. diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.middle.stderr b/tests/ui/feature-gates/feature-gate-gen_blocks.middle.stderr new file mode 100644 index 0000000000000..86f9e29264ef2 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.middle.stderr @@ -0,0 +1,21 @@ +error: expected one of `move`, `use`, `{`, `|`, or `||`, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:15:11 + | +LL | async gen {}; + | ^^^ expected one of `move`, `use`, `{`, `|`, or `||` + +error: expected one of `move`, `use`, `{`, `|`, or `||`, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:29:11 + | +LL | async gen {}; + | ^^^ expected one of `move`, `use`, `{`, `|`, or `||` + +error[E0422]: cannot find struct, variant or union type `gen` in this scope + --> $DIR/feature-gate-gen_blocks.rs:7:5 + | +LL | gen {}; + | ^^^ not found in this scope + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0422`. diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.pre2024.stderr b/tests/ui/feature-gates/feature-gate-gen_blocks.pre2024.stderr new file mode 100644 index 0000000000000..dbc856c398ba3 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.pre2024.stderr @@ -0,0 +1,21 @@ +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:13:11 + | +LL | async gen {}; + | ^^^ expected one of 8 possible tokens + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` + --> $DIR/feature-gate-gen_blocks.rs:26:11 + | +LL | async gen {}; + | ^^^ expected one of 8 possible tokens + +error[E0422]: cannot find struct, variant or union type `gen` in this scope + --> $DIR/feature-gate-gen_blocks.rs:6:5 + | +LL | gen {}; + | ^^^ not found in this scope + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0422`. diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.rs b/tests/ui/feature-gates/feature-gate-gen_blocks.rs index 989daf471bcb9..e81fce765ee3e 100644 --- a/tests/ui/feature-gates/feature-gate-gen_blocks.rs +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.rs @@ -1,17 +1,21 @@ -//@ revisions: e2024 none +//@ revisions: e2015 middle e2024 +//@[e2015] edition: 2015 +//@[middle] edition: 2018..2024 //@[e2024] edition: 2024 fn test_gen() { gen {}; - //[none]~^ ERROR: cannot find struct, variant or union type `gen` - //[e2024]~^^ ERROR: gen blocks are experimental + //[e2015]~^ ERROR: cannot find struct, variant or union type `gen` + //[middle]~^^ ERROR: cannot find struct, variant or union type `gen` in this scope + //[e2024]~^^^ ERROR: gen blocks are experimental //[e2024]~| ERROR: type annotations needed } fn test_async_gen() { async gen {}; - //[none]~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` - //[e2024]~^^ ERROR: gen blocks are experimental + //[e2015]~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` + //[middle]~^^ ERROR: expected one of `move`, `use`, `{`, `|`, or `||`, found `gen` + //[e2024]~^^^ ERROR: gen blocks are experimental //[e2024]~| ERROR: type annotations needed } @@ -23,6 +27,7 @@ fn foo() { //[e2024]~^ ERROR: gen blocks are experimental async gen {}; - //[e2024]~^ ERROR: gen blocks are experimental - //[none]~^^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` + //[e2015]~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` + //[middle]~^^ ERROR: expected one of `move`, `use`, `{`, `|`, or `||`, found `gen` + //[e2024]~^^^ ERROR: gen blocks are experimental } diff --git a/tests/ui/feature-gates/feature-gate-offset-of-enum.rs b/tests/ui/feature-gates/feature-gate-offset-of-enum.rs index cc9efeb67f31d..d3850ae8a9cd5 100644 --- a/tests/ui/feature-gates/feature-gate-offset-of-enum.rs +++ b/tests/ui/feature-gates/feature-gate-offset-of-enum.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use std::mem::offset_of; enum Alpha { diff --git a/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr b/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr index 8a73abc8cadbe..55f1a83cb37c7 100644 --- a/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr +++ b/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `Alpha::One` - --> $DIR/feature-gate-offset-of-enum.rs:9:16 + --> $DIR/feature-gate-offset-of-enum.rs:10:16 | LL | offset_of!(Alpha::One, 0); | ^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | offset_of!(Alpha::One, 0); | help: try using the variant's enum: `Alpha` error[E0658]: using enums in offset_of is experimental - --> $DIR/feature-gate-offset-of-enum.rs:10:23 + --> $DIR/feature-gate-offset-of-enum.rs:11:23 | LL | offset_of!(Alpha, One); | ^^^ @@ -18,13 +18,13 @@ LL | offset_of!(Alpha, One); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0795]: `One` is an enum variant; expected field at end of `offset_of` - --> $DIR/feature-gate-offset-of-enum.rs:10:23 + --> $DIR/feature-gate-offset-of-enum.rs:11:23 | LL | offset_of!(Alpha, One); | ^^^ enum variant error[E0658]: using enums in offset_of is experimental - --> $DIR/feature-gate-offset-of-enum.rs:12:23 + --> $DIR/feature-gate-offset-of-enum.rs:13:23 | LL | offset_of!(Alpha, Two.0); | ^^^ diff --git a/tests/ui/fn/error-recovery-mismatch.rs b/tests/ui/fn/error-recovery-mismatch.rs index a50a30c8c78a6..372cbd69edf06 100644 --- a/tests/ui/fn/error-recovery-mismatch.rs +++ b/tests/ui/fn/error-recovery-mismatch.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Used to ICE due to a size mismatch between the actual fake signature of `fold` and the // generated signature used reporting the parameter mismatch at the call site. // See issue #135124 diff --git a/tests/ui/fn/error-recovery-mismatch.stderr b/tests/ui/fn/error-recovery-mismatch.stderr index b4293500b3bc2..400af46e2a278 100644 --- a/tests/ui/fn/error-recovery-mismatch.stderr +++ b/tests/ui/fn/error-recovery-mismatch.stderr @@ -1,11 +1,11 @@ error: unexpected `self` parameter in function - --> $DIR/error-recovery-mismatch.rs:11:29 + --> $DIR/error-recovery-mismatch.rs:12:29 | LL | fn fold(&self, _: T, &self._) {} | ^^^^^ must be the first parameter of an associated function error: expected one of `)` or `,`, found `.` - --> $DIR/error-recovery-mismatch.rs:11:34 + --> $DIR/error-recovery-mismatch.rs:12:34 | LL | fn fold(&self, _: T, &self._) {} | ^ @@ -14,13 +14,13 @@ LL | fn fold(&self, _: T, &self._) {} | help: missing `,` error[E0415]: identifier `self` is bound more than once in this parameter list - --> $DIR/error-recovery-mismatch.rs:11:30 + --> $DIR/error-recovery-mismatch.rs:12:30 | LL | fn fold(&self, _: T, &self._) {} | ^^^^ used as parameter more than once warning: anonymous parameters are deprecated and will be removed in the next edition - --> $DIR/error-recovery-mismatch.rs:11:35 + --> $DIR/error-recovery-mismatch.rs:12:35 | LL | fn fold(&self, _: T, &self._) {} | ^ help: try naming the parameter or explicitly ignoring it: `_: _` @@ -30,7 +30,7 @@ LL | fn fold(&self, _: T, &self._) {} = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default error[E0121]: the placeholder `_` is not allowed within types on item signatures for methods - --> $DIR/error-recovery-mismatch.rs:11:35 + --> $DIR/error-recovery-mismatch.rs:12:35 | LL | fn fold(&self, _: T, &self._) {} | ^ not allowed in type signatures diff --git a/tests/ui/hashmap/hashmap-memory.rs b/tests/ui/hashmap/hashmap-memory.rs index 6db5d2e7bef35..961ebcc0720dc 100644 --- a/tests/ui/hashmap/hashmap-memory.rs +++ b/tests/ui/hashmap/hashmap-memory.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass #![allow(improper_ctypes_definitions)] diff --git a/tests/ui/hygiene/auxiliary/xcrate.rs b/tests/ui/hygiene/auxiliary/xcrate.rs index f5a911f57df69..baa0eabb0b591 100644 --- a/tests/ui/hygiene/auxiliary/xcrate.rs +++ b/tests/ui/hygiene/auxiliary/xcrate.rs @@ -1,3 +1,5 @@ +//@ edition:2015 + #![feature(decl_macro)] #![allow(unused)] diff --git a/tests/ui/hygiene/globs.rs b/tests/ui/hygiene/globs.rs index a3f466ef435d3..6fd2afccc008f 100644 --- a/tests/ui/hygiene/globs.rs +++ b/tests/ui/hygiene/globs.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(decl_macro)] mod foo { diff --git a/tests/ui/hygiene/globs.stderr b/tests/ui/hygiene/globs.stderr index 85946bf34bc53..71cdce9a7f1d3 100644 --- a/tests/ui/hygiene/globs.stderr +++ b/tests/ui/hygiene/globs.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find function `f` in this scope - --> $DIR/globs.rs:22:9 + --> $DIR/globs.rs:23:9 | LL | pub fn g() {} | ---------- similarly named function `g` defined here @@ -18,7 +18,7 @@ LL + use foo::f; | error[E0425]: cannot find function `g` in this scope - --> $DIR/globs.rs:15:5 + --> $DIR/globs.rs:16:5 | LL | pub fn f() {} | ---------- similarly named function `f` defined here @@ -45,7 +45,7 @@ LL + use bar::g; | error[E0425]: cannot find function `f` in this scope - --> $DIR/globs.rs:61:12 + --> $DIR/globs.rs:62:12 | LL | n!(f); | ----- @@ -62,7 +62,7 @@ LL | n!(f); = note: this error originates in the macro `n` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find function `f` in this scope - --> $DIR/globs.rs:65:17 + --> $DIR/globs.rs:66:17 | LL | n!(f); | ----- diff --git a/tests/ui/hygiene/issue-47311.rs b/tests/ui/hygiene/issue-47311.rs index e12b174f82fa2..c2b35722bd861 100644 --- a/tests/ui/hygiene/issue-47311.rs +++ b/tests/ui/hygiene/issue-47311.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass #![feature(decl_macro)] diff --git a/tests/ui/hygiene/issue-47312.rs b/tests/ui/hygiene/issue-47312.rs index 8d11d3b9ce293..3b5624216588f 100644 --- a/tests/ui/hygiene/issue-47312.rs +++ b/tests/ui/hygiene/issue-47312.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass #![feature(decl_macro)] diff --git a/tests/ui/hygiene/legacy_interaction.rs b/tests/ui/hygiene/legacy_interaction.rs index 277650b545064..e5b75d58ad615 100644 --- a/tests/ui/hygiene/legacy_interaction.rs +++ b/tests/ui/hygiene/legacy_interaction.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass #![allow(dead_code)] diff --git a/tests/ui/hygiene/no_implicit_prelude.rs b/tests/ui/hygiene/no_implicit_prelude.rs index e23826e9d4ef6..8145212fe309d 100644 --- a/tests/ui/hygiene/no_implicit_prelude.rs +++ b/tests/ui/hygiene/no_implicit_prelude.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(decl_macro)] mod foo { diff --git a/tests/ui/hygiene/no_implicit_prelude.stderr b/tests/ui/hygiene/no_implicit_prelude.stderr index 42049da23eb55..0606fe5013862 100644 --- a/tests/ui/hygiene/no_implicit_prelude.stderr +++ b/tests/ui/hygiene/no_implicit_prelude.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared type `Vec` - --> $DIR/no_implicit_prelude.rs:11:9 + --> $DIR/no_implicit_prelude.rs:12:9 | LL | fn f() { ::bar::m!(); } | ----------- in this macro invocation @@ -14,7 +14,7 @@ LL + use std::vec::Vec; | error[E0599]: no method named `clone` found for unit type `()` in the current scope - --> $DIR/no_implicit_prelude.rs:12:12 + --> $DIR/no_implicit_prelude.rs:13:12 | LL | fn f() { ::bar::m!(); } | ----------- in this macro invocation diff --git a/tests/ui/hygiene/privacy.rs b/tests/ui/hygiene/privacy.rs index 78d2555539dc7..121eb7d066f7d 100644 --- a/tests/ui/hygiene/privacy.rs +++ b/tests/ui/hygiene/privacy.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(decl_macro)] mod foo { diff --git a/tests/ui/hygiene/privacy.stderr b/tests/ui/hygiene/privacy.stderr index c677c88128865..b4835644a538c 100644 --- a/tests/ui/hygiene/privacy.stderr +++ b/tests/ui/hygiene/privacy.stderr @@ -1,11 +1,11 @@ error[E0603]: function `f` is private - --> $DIR/privacy.rs:16:14 + --> $DIR/privacy.rs:17:14 | LL | foo::f() | ^ private function | note: the function `f` is defined here - --> $DIR/privacy.rs:4:5 + --> $DIR/privacy.rs:5:5 | LL | fn f() {} | ^^^^^^ diff --git a/tests/ui/hygiene/trait_items.rs b/tests/ui/hygiene/trait_items.rs index 15c4acbc939bc..8b952d51bd952 100644 --- a/tests/ui/hygiene/trait_items.rs +++ b/tests/ui/hygiene/trait_items.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(decl_macro)] mod foo { diff --git a/tests/ui/hygiene/trait_items.stderr b/tests/ui/hygiene/trait_items.stderr index 0e276bf69d6ec..e5212ce1f56c0 100644 --- a/tests/ui/hygiene/trait_items.stderr +++ b/tests/ui/hygiene/trait_items.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `f` found for unit type `()` in the current scope - --> $DIR/trait_items.rs:17:24 + --> $DIR/trait_items.rs:18:24 | LL | fn f(&self) {} | - the method is available for `()` here diff --git a/tests/ui/hygiene/xcrate.rs b/tests/ui/hygiene/xcrate.rs index 3567a4848e47c..0dd9136e4d562 100644 --- a/tests/ui/hygiene/xcrate.rs +++ b/tests/ui/hygiene/xcrate.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass //@ aux-build:xcrate.rs diff --git a/tests/ui/impl-trait/no-method-suggested-traits.rs b/tests/ui/impl-trait/no-method-suggested-traits.rs index 5a9361310c349..27484963e6cef 100644 --- a/tests/ui/impl-trait/no-method-suggested-traits.rs +++ b/tests/ui/impl-trait/no-method-suggested-traits.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:no_method_suggested_traits.rs //@ dont-require-annotations: HELP diff --git a/tests/ui/impl-trait/no-method-suggested-traits.stderr b/tests/ui/impl-trait/no-method-suggested-traits.stderr index b376f205411c6..53c3e2caae6ae 100644 --- a/tests/ui/impl-trait/no-method-suggested-traits.stderr +++ b/tests/ui/impl-trait/no-method-suggested-traits.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `method` found for type `u32` in the current scope - --> $DIR/no-method-suggested-traits.rs:25:10 + --> $DIR/no-method-suggested-traits.rs:26:10 | LL | 1u32.method(); | ^^^^^^ @@ -17,7 +17,7 @@ LL | 1u32.method2(); | + error[E0599]: no method named `method` found for struct `Rc<&mut Box<&u32>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:28:44 + --> $DIR/no-method-suggested-traits.rs:29:44 | LL | std::rc::Rc::new(&mut Box::new(&1u32)).method(); | ^^^^^^ @@ -35,7 +35,7 @@ LL | std::rc::Rc::new(&mut Box::new(&1u32)).method2(); | + error[E0599]: no method named `method` found for type `char` in the current scope - --> $DIR/no-method-suggested-traits.rs:32:9 + --> $DIR/no-method-suggested-traits.rs:33:9 | LL | fn method(&self) {} | ------ the method is available for `char` here @@ -54,7 +54,7 @@ LL | 'a'.method2(); | + error[E0599]: no method named `method` found for struct `Rc<&mut Box<&char>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:34:43 + --> $DIR/no-method-suggested-traits.rs:35:43 | LL | std::rc::Rc::new(&mut Box::new(&'a')).method(); | ^^^^^^ @@ -70,7 +70,7 @@ LL | std::rc::Rc::new(&mut Box::new(&'a')).method2(); | + error[E0599]: no method named `method` found for type `i32` in the current scope - --> $DIR/no-method-suggested-traits.rs:37:10 + --> $DIR/no-method-suggested-traits.rs:38:10 | LL | 1i32.method(); | ^^^^^^ @@ -91,7 +91,7 @@ LL | 1i32.method3(); | + error[E0599]: no method named `method` found for struct `Rc<&mut Box<&i32>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:39:44 + --> $DIR/no-method-suggested-traits.rs:40:44 | LL | std::rc::Rc::new(&mut Box::new(&1i32)).method(); | ^^^^^^ @@ -107,7 +107,7 @@ LL | std::rc::Rc::new(&mut Box::new(&1i32)).method3(); | + error[E0599]: no method named `method` found for struct `Foo` in the current scope - --> $DIR/no-method-suggested-traits.rs:42:9 + --> $DIR/no-method-suggested-traits.rs:43:9 | LL | struct Foo; | ---------- method `method` not found for this struct @@ -123,7 +123,7 @@ LL | Foo.method(); candidate #4: `no_method_suggested_traits::qux::PrivPub` error[E0599]: no method named `method` found for struct `Rc<&mut Box<&Foo>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:44:43 + --> $DIR/no-method-suggested-traits.rs:45:43 | LL | std::rc::Rc::new(&mut Box::new(&Foo)).method(); | ^^^^^^ method not found in `Rc<&mut Box<&Foo>>` @@ -136,85 +136,85 @@ LL | std::rc::Rc::new(&mut Box::new(&Foo)).method(); candidate #4: `no_method_suggested_traits::qux::PrivPub` error[E0599]: no method named `method2` found for type `u64` in the current scope - --> $DIR/no-method-suggested-traits.rs:47:10 + --> $DIR/no-method-suggested-traits.rs:48:10 | LL | 1u64.method2(); | ^^^^^^^ method not found in `u64` | = help: items from traits can only be used if the trait is implemented and in scope note: `foo::Bar` defines an item `method2`, perhaps you need to implement it - --> $DIR/no-method-suggested-traits.rs:10:5 + --> $DIR/no-method-suggested-traits.rs:11:5 | LL | pub trait Bar { | ^^^^^^^^^^^^^ error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&u64>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:49:44 + --> $DIR/no-method-suggested-traits.rs:50:44 | LL | std::rc::Rc::new(&mut Box::new(&1u64)).method2(); | ^^^^^^^ method not found in `Rc<&mut Box<&u64>>` | = help: items from traits can only be used if the trait is implemented and in scope note: `foo::Bar` defines an item `method2`, perhaps you need to implement it - --> $DIR/no-method-suggested-traits.rs:10:5 + --> $DIR/no-method-suggested-traits.rs:11:5 | LL | pub trait Bar { | ^^^^^^^^^^^^^ error[E0599]: no method named `method2` found for struct `no_method_suggested_traits::Foo` in the current scope - --> $DIR/no-method-suggested-traits.rs:52:37 + --> $DIR/no-method-suggested-traits.rs:53:37 | LL | no_method_suggested_traits::Foo.method2(); | ^^^^^^^ method not found in `no_method_suggested_traits::Foo` | = help: items from traits can only be used if the trait is implemented and in scope note: `foo::Bar` defines an item `method2`, perhaps you need to implement it - --> $DIR/no-method-suggested-traits.rs:10:5 + --> $DIR/no-method-suggested-traits.rs:11:5 | LL | pub trait Bar { | ^^^^^^^^^^^^^ error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:54:71 + --> $DIR/no-method-suggested-traits.rs:55:71 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2(); | ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Foo>>` | = help: items from traits can only be used if the trait is implemented and in scope note: `foo::Bar` defines an item `method2`, perhaps you need to implement it - --> $DIR/no-method-suggested-traits.rs:10:5 + --> $DIR/no-method-suggested-traits.rs:11:5 | LL | pub trait Bar { | ^^^^^^^^^^^^^ error[E0599]: no method named `method2` found for enum `no_method_suggested_traits::Bar` in the current scope - --> $DIR/no-method-suggested-traits.rs:56:40 + --> $DIR/no-method-suggested-traits.rs:57:40 | LL | no_method_suggested_traits::Bar::X.method2(); | ^^^^^^^ method not found in `no_method_suggested_traits::Bar` | = help: items from traits can only be used if the trait is implemented and in scope note: `foo::Bar` defines an item `method2`, perhaps you need to implement it - --> $DIR/no-method-suggested-traits.rs:10:5 + --> $DIR/no-method-suggested-traits.rs:11:5 | LL | pub trait Bar { | ^^^^^^^^^^^^^ error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:58:74 + --> $DIR/no-method-suggested-traits.rs:59:74 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2(); | ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Bar>>` | = help: items from traits can only be used if the trait is implemented and in scope note: `foo::Bar` defines an item `method2`, perhaps you need to implement it - --> $DIR/no-method-suggested-traits.rs:10:5 + --> $DIR/no-method-suggested-traits.rs:11:5 | LL | pub trait Bar { | ^^^^^^^^^^^^^ error[E0599]: no method named `method3` found for struct `Foo` in the current scope - --> $DIR/no-method-suggested-traits.rs:61:9 + --> $DIR/no-method-suggested-traits.rs:62:9 | LL | struct Foo; | ---------- method `method3` not found for this struct @@ -227,7 +227,7 @@ LL | Foo.method3(); candidate #1: `PubPub` error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Foo>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:63:43 + --> $DIR/no-method-suggested-traits.rs:64:43 | LL | std::rc::Rc::new(&mut Box::new(&Foo)).method3(); | ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>` @@ -237,7 +237,7 @@ LL | std::rc::Rc::new(&mut Box::new(&Foo)).method3(); candidate #1: `PubPub` error[E0599]: no method named `method3` found for enum `Bar` in the current scope - --> $DIR/no-method-suggested-traits.rs:65:12 + --> $DIR/no-method-suggested-traits.rs:66:12 | LL | enum Bar { X } | -------- method `method3` not found for this enum @@ -250,7 +250,7 @@ LL | Bar::X.method3(); candidate #1: `PubPub` error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Bar>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:67:46 + --> $DIR/no-method-suggested-traits.rs:68:46 | LL | std::rc::Rc::new(&mut Box::new(&Bar::X)).method3(); | ^^^^^^^ method not found in `Rc<&mut Box<&Bar>>` @@ -260,37 +260,37 @@ LL | std::rc::Rc::new(&mut Box::new(&Bar::X)).method3(); candidate #1: `PubPub` error[E0599]: no method named `method3` found for type `usize` in the current scope - --> $DIR/no-method-suggested-traits.rs:71:13 + --> $DIR/no-method-suggested-traits.rs:72:13 | LL | 1_usize.method3(); | ^^^^^^^ method not found in `usize` error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&usize>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:72:47 + --> $DIR/no-method-suggested-traits.rs:73:47 | LL | std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); | ^^^^^^^ method not found in `Rc<&mut Box<&usize>>` error[E0599]: no method named `method3` found for struct `no_method_suggested_traits::Foo` in the current scope - --> $DIR/no-method-suggested-traits.rs:73:37 + --> $DIR/no-method-suggested-traits.rs:74:37 | LL | no_method_suggested_traits::Foo.method3(); | ^^^^^^^ method not found in `no_method_suggested_traits::Foo` error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:74:71 + --> $DIR/no-method-suggested-traits.rs:75:71 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3(); | ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Foo>>` error[E0599]: no method named `method3` found for enum `no_method_suggested_traits::Bar` in the current scope - --> $DIR/no-method-suggested-traits.rs:76:40 + --> $DIR/no-method-suggested-traits.rs:77:40 | LL | no_method_suggested_traits::Bar::X.method3(); | ^^^^^^^ method not found in `no_method_suggested_traits::Bar` error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope - --> $DIR/no-method-suggested-traits.rs:77:74 + --> $DIR/no-method-suggested-traits.rs:78:74 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3(); | ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Bar>>` diff --git a/tests/ui/imports/ambiguous-14.rs b/tests/ui/imports/ambiguous-14.rs index f752387aa7e1b..ba2d7dc4e0166 100644 --- a/tests/ui/imports/ambiguous-14.rs +++ b/tests/ui/imports/ambiguous-14.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // https://github.com/rust-lang/rust/issues/98467 mod a { diff --git a/tests/ui/imports/ambiguous-14.stderr b/tests/ui/imports/ambiguous-14.stderr index ef7e2669bae4c..4efa31c61e328 100644 --- a/tests/ui/imports/ambiguous-14.stderr +++ b/tests/ui/imports/ambiguous-14.stderr @@ -1,5 +1,5 @@ error: `foo` is ambiguous - --> $DIR/ambiguous-14.rs:22:8 + --> $DIR/ambiguous-14.rs:23:8 | LL | g::foo(); | ^^^ ambiguous name @@ -8,13 +8,13 @@ LL | g::foo(); = note: for more information, see issue #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `foo` could refer to the function imported here - --> $DIR/ambiguous-14.rs:12:13 + --> $DIR/ambiguous-14.rs:13:13 | LL | pub use a::*; | ^^^^ = help: consider adding an explicit import of `foo` to disambiguate note: `foo` could also refer to the function imported here - --> $DIR/ambiguous-14.rs:13:13 + --> $DIR/ambiguous-14.rs:14:13 | LL | pub use b::*; | ^^^^ @@ -25,7 +25,7 @@ error: aborting due to 1 previous error Future incompatibility report: Future breakage diagnostic: error: `foo` is ambiguous - --> $DIR/ambiguous-14.rs:22:8 + --> $DIR/ambiguous-14.rs:23:8 | LL | g::foo(); | ^^^ ambiguous name @@ -34,13 +34,13 @@ LL | g::foo(); = note: for more information, see issue #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `foo` could refer to the function imported here - --> $DIR/ambiguous-14.rs:12:13 + --> $DIR/ambiguous-14.rs:13:13 | LL | pub use a::*; | ^^^^ = help: consider adding an explicit import of `foo` to disambiguate note: `foo` could also refer to the function imported here - --> $DIR/ambiguous-14.rs:13:13 + --> $DIR/ambiguous-14.rs:14:13 | LL | pub use b::*; | ^^^^ diff --git a/tests/ui/imports/ambiguous-17.rs b/tests/ui/imports/ambiguous-17.rs index 520ac70c6f10b..3a51c156d34ca 100644 --- a/tests/ui/imports/ambiguous-17.rs +++ b/tests/ui/imports/ambiguous-17.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152 pub use evp::*; //~ WARNING ambiguous glob re-exports diff --git a/tests/ui/imports/ambiguous-17.stderr b/tests/ui/imports/ambiguous-17.stderr index 38491ce10628d..1849b83d76a35 100644 --- a/tests/ui/imports/ambiguous-17.stderr +++ b/tests/ui/imports/ambiguous-17.stderr @@ -1,5 +1,5 @@ warning: ambiguous glob re-exports - --> $DIR/ambiguous-17.rs:3:9 + --> $DIR/ambiguous-17.rs:4:9 | LL | pub use evp::*; | ^^^^^^ the name `id` in the value namespace is first re-exported here @@ -9,7 +9,7 @@ LL | pub use handwritten::*; = note: `#[warn(ambiguous_glob_reexports)]` on by default error: `id` is ambiguous - --> $DIR/ambiguous-17.rs:25:5 + --> $DIR/ambiguous-17.rs:26:5 | LL | id(); | ^^ ambiguous name @@ -18,13 +18,13 @@ LL | id(); = note: for more information, see issue #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `id` could refer to the function imported here - --> $DIR/ambiguous-17.rs:3:9 + --> $DIR/ambiguous-17.rs:4:9 | LL | pub use evp::*; | ^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: `id` could also refer to the function imported here - --> $DIR/ambiguous-17.rs:4:9 + --> $DIR/ambiguous-17.rs:5:9 | LL | pub use handwritten::*; | ^^^^^^^^^^^^^^ @@ -35,7 +35,7 @@ error: aborting due to 1 previous error; 1 warning emitted Future incompatibility report: Future breakage diagnostic: error: `id` is ambiguous - --> $DIR/ambiguous-17.rs:25:5 + --> $DIR/ambiguous-17.rs:26:5 | LL | id(); | ^^ ambiguous name @@ -44,13 +44,13 @@ LL | id(); = note: for more information, see issue #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `id` could refer to the function imported here - --> $DIR/ambiguous-17.rs:3:9 + --> $DIR/ambiguous-17.rs:4:9 | LL | pub use evp::*; | ^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: `id` could also refer to the function imported here - --> $DIR/ambiguous-17.rs:4:9 + --> $DIR/ambiguous-17.rs:5:9 | LL | pub use handwritten::*; | ^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/ambiguous-4-extern.rs b/tests/ui/imports/ambiguous-4-extern.rs index bc856af852d61..125612dea03e5 100644 --- a/tests/ui/imports/ambiguous-4-extern.rs +++ b/tests/ui/imports/ambiguous-4-extern.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass // https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883 diff --git a/tests/ui/imports/ambiguous-4-extern.stderr b/tests/ui/imports/ambiguous-4-extern.stderr index a9427ac03504b..87492dee67fb4 100644 --- a/tests/ui/imports/ambiguous-4-extern.stderr +++ b/tests/ui/imports/ambiguous-4-extern.stderr @@ -1,5 +1,5 @@ warning: ambiguous glob re-exports - --> $DIR/ambiguous-4-extern.rs:12:9 + --> $DIR/ambiguous-4-extern.rs:13:9 | LL | pub use evp::*; | ^^^^^^ the name `id` in the value namespace is first re-exported here @@ -9,7 +9,7 @@ LL | pub use handwritten::*; = note: `#[warn(ambiguous_glob_reexports)]` on by default warning: `id` is ambiguous - --> $DIR/ambiguous-4-extern.rs:25:5 + --> $DIR/ambiguous-4-extern.rs:26:5 | LL | id(); | ^^ ambiguous name @@ -18,19 +18,19 @@ LL | id(); = note: for more information, see issue #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `id` could refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:12:9 + --> $DIR/ambiguous-4-extern.rs:13:9 | LL | pub use evp::*; | ^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: `id` could also refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:13:9 + --> $DIR/ambiguous-4-extern.rs:14:9 | LL | pub use handwritten::*; | ^^^^^^^^^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: the lint level is defined here - --> $DIR/ambiguous-4-extern.rs:4:9 + --> $DIR/ambiguous-4-extern.rs:5:9 | LL | #![warn(ambiguous_glob_imports)] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -39,7 +39,7 @@ warning: 2 warnings emitted Future incompatibility report: Future breakage diagnostic: warning: `id` is ambiguous - --> $DIR/ambiguous-4-extern.rs:25:5 + --> $DIR/ambiguous-4-extern.rs:26:5 | LL | id(); | ^^ ambiguous name @@ -48,19 +48,19 @@ LL | id(); = note: for more information, see issue #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `id` could refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:12:9 + --> $DIR/ambiguous-4-extern.rs:13:9 | LL | pub use evp::*; | ^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: `id` could also refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:13:9 + --> $DIR/ambiguous-4-extern.rs:14:9 | LL | pub use handwritten::*; | ^^^^^^^^^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: the lint level is defined here - --> $DIR/ambiguous-4-extern.rs:4:9 + --> $DIR/ambiguous-4-extern.rs:5:9 | LL | #![warn(ambiguous_glob_imports)] | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/ambiguous-4.rs b/tests/ui/imports/ambiguous-4.rs index 3a9a14bfb524e..d604dca30eed8 100644 --- a/tests/ui/imports/ambiguous-4.rs +++ b/tests/ui/imports/ambiguous-4.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass //@ aux-build: ../ambiguous-4-extern.rs diff --git a/tests/ui/imports/append-import-suggestion.rs b/tests/ui/imports/append-import-suggestion.rs index 6b75804b86fcb..e957572c27bfe 100644 --- a/tests/ui/imports/append-import-suggestion.rs +++ b/tests/ui/imports/append-import-suggestion.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // https://github.com/rust-lang/rust/issues/114884 mod mod1 { diff --git a/tests/ui/imports/append-import-suggestion.stderr b/tests/ui/imports/append-import-suggestion.stderr index 6d7b657f3d128..9db31c73a08ef 100644 --- a/tests/ui/imports/append-import-suggestion.stderr +++ b/tests/ui/imports/append-import-suggestion.stderr @@ -1,17 +1,17 @@ error[E0603]: module `sub_mod` is private - --> $DIR/append-import-suggestion.rs:13:12 + --> $DIR/append-import-suggestion.rs:14:12 | LL | use mod2::{sub_mod::TraitA}; | ^^^^^^^ private module | help: consider importing this trait instead: mod1::TraitA - --> $DIR/append-import-suggestion.rs:13:12 + --> $DIR/append-import-suggestion.rs:14:12 | LL | use mod2::{sub_mod::TraitA}; | ^^^^^^^^^^^^^^^ note: the module `sub_mod` is defined here - --> $DIR/append-import-suggestion.rs:8:5 + --> $DIR/append-import-suggestion.rs:9:5 | LL | mod sub_mod { | ^^^^^^^^^^^ diff --git a/tests/ui/imports/auxiliary/glob-conflict.rs b/tests/ui/imports/auxiliary/glob-conflict.rs index 8a146378b4395..dea947b564b6a 100644 --- a/tests/ui/imports/auxiliary/glob-conflict.rs +++ b/tests/ui/imports/auxiliary/glob-conflict.rs @@ -1,3 +1,5 @@ +//@ edition:2015 + #![allow(ambiguous_glob_reexports)] mod m1 { diff --git a/tests/ui/imports/bad-import-with-rename.rs b/tests/ui/imports/bad-import-with-rename.rs index ffe56916f92f0..52b71802b3515 100644 --- a/tests/ui/imports/bad-import-with-rename.rs +++ b/tests/ui/imports/bad-import-with-rename.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod A { pub type B = (); pub type B2 = (); diff --git a/tests/ui/imports/bad-import-with-rename.stderr b/tests/ui/imports/bad-import-with-rename.stderr index a8e97d13c55ad..45e359a6a1945 100644 --- a/tests/ui/imports/bad-import-with-rename.stderr +++ b/tests/ui/imports/bad-import-with-rename.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `crate::D::B` - --> $DIR/bad-import-with-rename.rs:7:9 + --> $DIR/bad-import-with-rename.rs:8:9 | LL | use crate::D::B as _; | ^^^^^^^^^^^^^^^^ no `B` in `D` @@ -11,7 +11,7 @@ LL + use A::B as _; | error[E0432]: unresolved import `crate::D::B2` - --> $DIR/bad-import-with-rename.rs:10:9 + --> $DIR/bad-import-with-rename.rs:11:9 | LL | use crate::D::B2; | ^^^^^^^^^^^^ no `B2` in `D` diff --git a/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs b/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs index 666b9f279ae50..202f41c2687bc 100644 --- a/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs +++ b/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:two_macros.rs macro_rules! define_vec { diff --git a/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr b/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr index ade479ed10221..d09d14b27f90f 100644 --- a/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr +++ b/tests/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr @@ -1,5 +1,5 @@ error: macro-expanded `extern crate` items cannot shadow names passed with `--extern` - --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:19:9 + --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:20:9 | LL | extern crate std as core; | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -10,14 +10,14 @@ LL | define_other_core!(); = note: this error originates in the macro `define_other_core` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `Vec` is ambiguous - --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:13:9 + --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:14:9 | LL | Vec::panic!(); | ^^^ ambiguous name | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `Vec` could refer to the crate imported here - --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:5:9 + --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:6:9 | LL | extern crate std as Vec; | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/glob-conflict-cross-crate-1.rs b/tests/ui/imports/glob-conflict-cross-crate-1.rs index 5f0433d13fcfd..6e32003296166 100644 --- a/tests/ui/imports/glob-conflict-cross-crate-1.rs +++ b/tests/ui/imports/glob-conflict-cross-crate-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:glob-conflict.rs extern crate glob_conflict; diff --git a/tests/ui/imports/glob-conflict-cross-crate-1.stderr b/tests/ui/imports/glob-conflict-cross-crate-1.stderr index 758087107f397..cf40076ecb863 100644 --- a/tests/ui/imports/glob-conflict-cross-crate-1.stderr +++ b/tests/ui/imports/glob-conflict-cross-crate-1.stderr @@ -1,11 +1,11 @@ error[E0425]: cannot find function `f` in crate `glob_conflict` - --> $DIR/glob-conflict-cross-crate-1.rs:6:20 + --> $DIR/glob-conflict-cross-crate-1.rs:7:20 | LL | glob_conflict::f(); | ^ not found in `glob_conflict` error[E0425]: cannot find function `f` in module `glob_conflict::glob` - --> $DIR/glob-conflict-cross-crate-1.rs:9:26 + --> $DIR/glob-conflict-cross-crate-1.rs:10:26 | LL | glob_conflict::glob::f(); | ^ not found in `glob_conflict::glob` diff --git a/tests/ui/imports/glob-resolve1.rs b/tests/ui/imports/glob-resolve1.rs index 904b77117dafc..ef82817e373cc 100644 --- a/tests/ui/imports/glob-resolve1.rs +++ b/tests/ui/imports/glob-resolve1.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Make sure that globs only bring in public things. use bar::*; diff --git a/tests/ui/imports/glob-resolve1.stderr b/tests/ui/imports/glob-resolve1.stderr index 23b0db0fa465b..30dddba9e9180 100644 --- a/tests/ui/imports/glob-resolve1.stderr +++ b/tests/ui/imports/glob-resolve1.stderr @@ -1,35 +1,35 @@ error[E0425]: cannot find function `fpriv` in this scope - --> $DIR/glob-resolve1.rs:26:5 + --> $DIR/glob-resolve1.rs:27:5 | LL | fpriv(); | ^^^^^ not found in this scope | note: function `bar::fpriv` exists but is inaccessible - --> $DIR/glob-resolve1.rs:7:5 + --> $DIR/glob-resolve1.rs:8:5 | LL | fn fpriv() {} | ^^^^^^^^^^ not accessible error[E0425]: cannot find function `epriv` in this scope - --> $DIR/glob-resolve1.rs:27:5 + --> $DIR/glob-resolve1.rs:28:5 | LL | epriv(); | ^^^^^ not found in this scope | note: function `bar::epriv` exists but is inaccessible - --> $DIR/glob-resolve1.rs:9:9 + --> $DIR/glob-resolve1.rs:10:9 | LL | fn epriv(); | ^^^^^^^^^^^ not accessible error[E0423]: expected value, found enum `B` - --> $DIR/glob-resolve1.rs:28:5 + --> $DIR/glob-resolve1.rs:29:5 | LL | B; | ^ | note: the enum is defined here - --> $DIR/glob-resolve1.rs:14:5 + --> $DIR/glob-resolve1.rs:15:5 | LL | / pub enum B { LL | | B1, @@ -41,25 +41,25 @@ LL | B::B1; | ++++ error[E0425]: cannot find value `C` in this scope - --> $DIR/glob-resolve1.rs:29:5 + --> $DIR/glob-resolve1.rs:30:5 | LL | C; | ^ not found in this scope | note: unit struct `bar::C` exists but is inaccessible - --> $DIR/glob-resolve1.rs:18:5 + --> $DIR/glob-resolve1.rs:19:5 | LL | struct C; | ^^^^^^^^^ not accessible error[E0425]: cannot find function `import` in this scope - --> $DIR/glob-resolve1.rs:30:5 + --> $DIR/glob-resolve1.rs:31:5 | LL | import(); | ^^^^^^ not found in this scope | note: function `bar::import` exists but is inaccessible - --> $DIR/glob-resolve1.rs:7:5 + --> $DIR/glob-resolve1.rs:8:5 | LL | fn fpriv() {} | ^^^^^^^^^^ not accessible @@ -69,7 +69,7 @@ LL + use other::import; | error[E0412]: cannot find type `A` in this scope - --> $DIR/glob-resolve1.rs:32:11 + --> $DIR/glob-resolve1.rs:33:11 | LL | pub enum B { | ---------- similarly named enum `B` defined here @@ -78,13 +78,13 @@ LL | foo::(); | ^ help: an enum with a similar name exists: `B` | note: enum `bar::A` exists but is inaccessible - --> $DIR/glob-resolve1.rs:11:5 + --> $DIR/glob-resolve1.rs:12:5 | LL | enum A { | ^^^^^^ not accessible error[E0412]: cannot find type `C` in this scope - --> $DIR/glob-resolve1.rs:33:11 + --> $DIR/glob-resolve1.rs:34:11 | LL | pub enum B { | ---------- similarly named enum `B` defined here @@ -93,13 +93,13 @@ LL | foo::(); | ^ help: an enum with a similar name exists: `B` | note: struct `bar::C` exists but is inaccessible - --> $DIR/glob-resolve1.rs:18:5 + --> $DIR/glob-resolve1.rs:19:5 | LL | struct C; | ^^^^^^^^^ not accessible error[E0412]: cannot find type `D` in this scope - --> $DIR/glob-resolve1.rs:34:11 + --> $DIR/glob-resolve1.rs:35:11 | LL | pub enum B { | ---------- similarly named enum `B` defined here @@ -108,7 +108,7 @@ LL | foo::(); | ^ help: an enum with a similar name exists: `B` | note: type alias `bar::D` exists but is inaccessible - --> $DIR/glob-resolve1.rs:20:5 + --> $DIR/glob-resolve1.rs:21:5 | LL | type D = isize; | ^^^^^^^^^^^^^^^ not accessible diff --git a/tests/ui/imports/import-from-missing-star-3.rs b/tests/ui/imports/import-from-missing-star-3.rs index bec51fd47b375..f8407cb4787a2 100644 --- a/tests/ui/imports/import-from-missing-star-3.rs +++ b/tests/ui/imports/import-from-missing-star-3.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod foo { use spam::*; //~ ERROR unresolved import `spam` [E0432] diff --git a/tests/ui/imports/import-from-missing-star-3.stderr b/tests/ui/imports/import-from-missing-star-3.stderr index c0b2e5675d391..52047b374d7d9 100644 --- a/tests/ui/imports/import-from-missing-star-3.stderr +++ b/tests/ui/imports/import-from-missing-star-3.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `spam` - --> $DIR/import-from-missing-star-3.rs:2:9 + --> $DIR/import-from-missing-star-3.rs:3:9 | LL | use spam::*; | ^^^^ use of unresolved module or unlinked crate `spam` @@ -10,7 +10,7 @@ LL + extern crate spam; | error[E0432]: unresolved import `spam` - --> $DIR/import-from-missing-star-3.rs:27:13 + --> $DIR/import-from-missing-star-3.rs:28:13 | LL | use spam::*; | ^^^^ use of unresolved module or unlinked crate `spam` diff --git a/tests/ui/imports/import-from-missing-star.rs b/tests/ui/imports/import-from-missing-star.rs index cb21e16ba6773..d0752845d6748 100644 --- a/tests/ui/imports/import-from-missing-star.rs +++ b/tests/ui/imports/import-from-missing-star.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use spam::*; //~ ERROR unresolved import `spam` [E0432] fn main() { diff --git a/tests/ui/imports/import-from-missing-star.stderr b/tests/ui/imports/import-from-missing-star.stderr index 768e1ea1e2cf8..6810526149c92 100644 --- a/tests/ui/imports/import-from-missing-star.stderr +++ b/tests/ui/imports/import-from-missing-star.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `spam` - --> $DIR/import-from-missing-star.rs:1:5 + --> $DIR/import-from-missing-star.rs:2:5 | LL | use spam::*; | ^^^^ use of unresolved module or unlinked crate `spam` diff --git a/tests/ui/imports/import.rs b/tests/ui/imports/import.rs index 39a087c7a4394..e001ae5fac8db 100644 --- a/tests/ui/imports/import.rs +++ b/tests/ui/imports/import.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ dont-require-annotations: NOTE use zed::bar; diff --git a/tests/ui/imports/import.stderr b/tests/ui/imports/import.stderr index 4dae164991b2c..6b41d0d731166 100644 --- a/tests/ui/imports/import.stderr +++ b/tests/ui/imports/import.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `zed::baz` - --> $DIR/import.rs:4:5 + --> $DIR/import.rs:5:5 | LL | use zed::baz; | ^^^^^--- @@ -8,19 +8,19 @@ LL | use zed::baz; | no `baz` in `zed` error[E0432]: unresolved import `foo` - --> $DIR/import.rs:12:9 + --> $DIR/import.rs:13:9 | LL | use foo; | ^^^ no `foo` in the root error[E0603]: unresolved item import `foo` is private - --> $DIR/import.rs:17:10 + --> $DIR/import.rs:18:10 | LL | zed::foo(); | ^^^ private unresolved item import | note: the unresolved item import `foo` is defined here - --> $DIR/import.rs:12:9 + --> $DIR/import.rs:13:9 | LL | use foo; | ^^^ diff --git a/tests/ui/imports/import3.rs b/tests/ui/imports/import3.rs index 7bd6458cba103..d25930258535f 100644 --- a/tests/ui/imports/import3.rs +++ b/tests/ui/imports/import3.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use main::bar; //~ ERROR unresolved import `main` fn main() { println!("foo"); } diff --git a/tests/ui/imports/import3.stderr b/tests/ui/imports/import3.stderr index 871104ce50da1..7f58114678117 100644 --- a/tests/ui/imports/import3.stderr +++ b/tests/ui/imports/import3.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `main` - --> $DIR/import3.rs:1:5 + --> $DIR/import3.rs:2:5 | LL | use main::bar; | ^^^^ use of unresolved module or unlinked crate `main` diff --git a/tests/ui/imports/import7.rs b/tests/ui/imports/import7.rs index ee1ce1a5d3e1d..f834b685deac3 100644 --- a/tests/ui/imports/import7.rs +++ b/tests/ui/imports/import7.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass #![allow(unused_imports)] diff --git a/tests/ui/imports/inaccessible_type_aliases.rs b/tests/ui/imports/inaccessible_type_aliases.rs index c3d4214e282d7..e8f8ce9a63aff 100644 --- a/tests/ui/imports/inaccessible_type_aliases.rs +++ b/tests/ui/imports/inaccessible_type_aliases.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod a { type Foo = u64; type Bar = u64; diff --git a/tests/ui/imports/inaccessible_type_aliases.stderr b/tests/ui/imports/inaccessible_type_aliases.stderr index ef224246061d9..9afcfb21487bc 100644 --- a/tests/ui/imports/inaccessible_type_aliases.stderr +++ b/tests/ui/imports/inaccessible_type_aliases.stderr @@ -1,11 +1,11 @@ error[E0412]: cannot find type `Foo` in this scope - --> $DIR/inaccessible_type_aliases.rs:11:12 + --> $DIR/inaccessible_type_aliases.rs:12:12 | LL | let x: Foo = 100; | ^^^ not found in this scope | note: these type aliases exist but are inaccessible - --> $DIR/inaccessible_type_aliases.rs:2:5 + --> $DIR/inaccessible_type_aliases.rs:3:5 | LL | type Foo = u64; | ^^^^^^^^^^^^^^^ `a::Foo`: not accessible @@ -14,13 +14,13 @@ LL | type Foo = u64; | ^^^^^^^^^^^^^^^ `b::Foo`: not accessible error[E0412]: cannot find type `Bar` in this scope - --> $DIR/inaccessible_type_aliases.rs:12:12 + --> $DIR/inaccessible_type_aliases.rs:13:12 | LL | let y: Bar = 100; | ^^^ not found in this scope | note: type alias `a::Bar` exists but is inaccessible - --> $DIR/inaccessible_type_aliases.rs:3:5 + --> $DIR/inaccessible_type_aliases.rs:4:5 | LL | type Bar = u64; | ^^^^^^^^^^^^^^^ not accessible diff --git a/tests/ui/imports/issue-109343.rs b/tests/ui/imports/issue-109343.rs index 0c10259bcd716..255f4bb9721da 100644 --- a/tests/ui/imports/issue-109343.rs +++ b/tests/ui/imports/issue-109343.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![crate_type = "lib"] pub mod f {} diff --git a/tests/ui/imports/issue-109343.stderr b/tests/ui/imports/issue-109343.stderr index e1071e45b924c..f3496d00d34b1 100644 --- a/tests/ui/imports/issue-109343.stderr +++ b/tests/ui/imports/issue-109343.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `unresolved` - --> $DIR/issue-109343.rs:4:9 + --> $DIR/issue-109343.rs:5:9 | LL | pub use unresolved::f; | ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved` diff --git a/tests/ui/imports/issue-1697.rs b/tests/ui/imports/issue-1697.rs index 3d3d4a17d6c19..046d73babec3d 100644 --- a/tests/ui/imports/issue-1697.rs +++ b/tests/ui/imports/issue-1697.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Testing that we don't fail abnormally after hitting the errors use unresolved::*; diff --git a/tests/ui/imports/issue-1697.stderr b/tests/ui/imports/issue-1697.stderr index 96e371c64f9e5..1bdd794ba1684 100644 --- a/tests/ui/imports/issue-1697.stderr +++ b/tests/ui/imports/issue-1697.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `unresolved` - --> $DIR/issue-1697.rs:3:5 + --> $DIR/issue-1697.rs:4:5 | LL | use unresolved::*; | ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved` diff --git a/tests/ui/imports/issue-28388-1.rs b/tests/ui/imports/issue-28388-1.rs index 14de621405dfe..a1e79ff7f2436 100644 --- a/tests/ui/imports/issue-28388-1.rs +++ b/tests/ui/imports/issue-28388-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Prefix in imports with empty braces should be resolved and checked privacy, stability, etc. use foo::{}; //~ ERROR unresolved import `foo` diff --git a/tests/ui/imports/issue-28388-1.stderr b/tests/ui/imports/issue-28388-1.stderr index 8256f96c62dd9..0fc4777434af7 100644 --- a/tests/ui/imports/issue-28388-1.stderr +++ b/tests/ui/imports/issue-28388-1.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `foo` - --> $DIR/issue-28388-1.rs:3:5 + --> $DIR/issue-28388-1.rs:4:5 | LL | use foo::{}; | ^^^^^^^ no `foo` in the root diff --git a/tests/ui/imports/issue-32833.rs b/tests/ui/imports/issue-32833.rs index 8f82eb68c1ff2..fd93889d079ed 100644 --- a/tests/ui/imports/issue-32833.rs +++ b/tests/ui/imports/issue-32833.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use bar::Foo; //~ ERROR unresolved import `bar::Foo` [E0432] //~^ NOTE no `Foo` in `bar` mod bar { diff --git a/tests/ui/imports/issue-32833.stderr b/tests/ui/imports/issue-32833.stderr index 332561eca7a33..1d346c79a4ec2 100644 --- a/tests/ui/imports/issue-32833.stderr +++ b/tests/ui/imports/issue-32833.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `bar::Foo` - --> $DIR/issue-32833.rs:1:5 + --> $DIR/issue-32833.rs:2:5 | LL | use bar::Foo; | ^^^^^^^^ no `Foo` in `bar` diff --git a/tests/ui/imports/issue-33464.rs b/tests/ui/imports/issue-33464.rs index a0edb5fdb6f93..80c48d92b37b7 100644 --- a/tests/ui/imports/issue-33464.rs +++ b/tests/ui/imports/issue-33464.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Make sure that the spans of import errors are correct. use abc::one_el; diff --git a/tests/ui/imports/issue-33464.stderr b/tests/ui/imports/issue-33464.stderr index dba4518467580..50ee8620b736c 100644 --- a/tests/ui/imports/issue-33464.stderr +++ b/tests/ui/imports/issue-33464.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `abc` - --> $DIR/issue-33464.rs:3:5 + --> $DIR/issue-33464.rs:4:5 | LL | use abc::one_el; | ^^^ use of unresolved module or unlinked crate `abc` @@ -10,7 +10,7 @@ LL + extern crate abc; | error[E0432]: unresolved import `abc` - --> $DIR/issue-33464.rs:5:5 + --> $DIR/issue-33464.rs:6:5 | LL | use abc::{a, bbb, cccccc}; | ^^^ use of unresolved module or unlinked crate `abc` @@ -21,7 +21,7 @@ LL + extern crate abc; | error[E0432]: unresolved import `a_very_long_name` - --> $DIR/issue-33464.rs:7:5 + --> $DIR/issue-33464.rs:8:5 | LL | use a_very_long_name::{el, el2}; | ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `a_very_long_name` diff --git a/tests/ui/imports/issue-36881.rs b/tests/ui/imports/issue-36881.rs index 4aff642ea9584..8003ea447e97d 100644 --- a/tests/ui/imports/issue-36881.rs +++ b/tests/ui/imports/issue-36881.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:issue-36881-aux.rs fn main() { diff --git a/tests/ui/imports/issue-36881.stderr b/tests/ui/imports/issue-36881.stderr index 33d628f40da22..21210d743066c 100644 --- a/tests/ui/imports/issue-36881.stderr +++ b/tests/ui/imports/issue-36881.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `issue_36881_aux` - --> $DIR/issue-36881.rs:5:9 + --> $DIR/issue-36881.rs:6:9 | LL | use issue_36881_aux::Foo; | ^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `issue_36881_aux` diff --git a/tests/ui/imports/issue-37887.rs b/tests/ui/imports/issue-37887.rs index 919f46d34c6d9..0ef84f01e1c73 100644 --- a/tests/ui/imports/issue-37887.rs +++ b/tests/ui/imports/issue-37887.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn main() { extern crate test; //~ ERROR use of unstable use test::*; //~ ERROR unresolved import diff --git a/tests/ui/imports/issue-37887.stderr b/tests/ui/imports/issue-37887.stderr index b83ba273a0194..73b64f60fcba7 100644 --- a/tests/ui/imports/issue-37887.stderr +++ b/tests/ui/imports/issue-37887.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `test` - --> $DIR/issue-37887.rs:3:9 + --> $DIR/issue-37887.rs:4:9 | LL | use test::*; | ^^^^ use of unresolved module or unlinked crate `test` @@ -10,7 +10,7 @@ LL + extern crate test; | error[E0658]: use of unstable library feature `test` - --> $DIR/issue-37887.rs:2:5 + --> $DIR/issue-37887.rs:3:5 | LL | extern crate test; | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/issue-38293.rs b/tests/ui/imports/issue-38293.rs index 3b1393600ba87..01c40ca48d2a2 100644 --- a/tests/ui/imports/issue-38293.rs +++ b/tests/ui/imports/issue-38293.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Test that `fn foo::bar::{self}` only imports `bar` in the type namespace. mod foo { diff --git a/tests/ui/imports/issue-38293.stderr b/tests/ui/imports/issue-38293.stderr index 1bb7ae29e1083..a6f0032bc735a 100644 --- a/tests/ui/imports/issue-38293.stderr +++ b/tests/ui/imports/issue-38293.stderr @@ -1,11 +1,11 @@ error[E0432]: unresolved import `foo::f` - --> $DIR/issue-38293.rs:6:14 + --> $DIR/issue-38293.rs:7:14 | LL | use foo::f::{self}; | ^^^^ no `f` in `foo` error[E0423]: expected function, found module `baz` - --> $DIR/issue-38293.rs:15:5 + --> $DIR/issue-38293.rs:16:5 | LL | baz(); | ^^^ not a function diff --git a/tests/ui/imports/issue-4366-2.rs b/tests/ui/imports/issue-4366-2.rs index e92d964f88932..a594db91e9f24 100644 --- a/tests/ui/imports/issue-4366-2.rs +++ b/tests/ui/imports/issue-4366-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // ensures that 'use foo:*' doesn't import non-public item use m1::*; diff --git a/tests/ui/imports/issue-4366-2.stderr b/tests/ui/imports/issue-4366-2.stderr index b1c0092b05d11..517a434ebe37b 100644 --- a/tests/ui/imports/issue-4366-2.stderr +++ b/tests/ui/imports/issue-4366-2.stderr @@ -1,23 +1,23 @@ error[E0412]: cannot find type `Bar` in this scope - --> $DIR/issue-4366-2.rs:15:21 + --> $DIR/issue-4366-2.rs:16:21 | LL | fn sub() -> Bar { 1 } | ^^^ not found in this scope | note: type alias `a::b::Bar` exists but is inaccessible - --> $DIR/issue-4366-2.rs:11:9 + --> $DIR/issue-4366-2.rs:12:9 | LL | type Bar = isize; | ^^^^^^^^^^^^^^^^^ not accessible error[E0423]: expected function, found module `foo` - --> $DIR/issue-4366-2.rs:25:5 + --> $DIR/issue-4366-2.rs:26:5 | LL | foo(); | ^^^ not a function | note: function `m1::foo` exists but is inaccessible - --> $DIR/issue-4366-2.rs:21:5 + --> $DIR/issue-4366-2.rs:22:5 | LL | fn foo() {} | ^^^^^^^^ not accessible diff --git a/tests/ui/imports/issue-4366.rs b/tests/ui/imports/issue-4366.rs index e2d89fdaff3aa..62185e0862e00 100644 --- a/tests/ui/imports/issue-4366.rs +++ b/tests/ui/imports/issue-4366.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // regression test for issue 4366 // ensures that 'use foo:*' doesn't import non-public 'use' statements in the diff --git a/tests/ui/imports/issue-4366.stderr b/tests/ui/imports/issue-4366.stderr index 54b7f31b2313a..a70ede97f411f 100644 --- a/tests/ui/imports/issue-4366.stderr +++ b/tests/ui/imports/issue-4366.stderr @@ -1,11 +1,11 @@ error[E0425]: cannot find function `foo` in this scope - --> $DIR/issue-4366.rs:18:29 + --> $DIR/issue-4366.rs:19:29 | LL | fn sub() -> isize { foo(); 1 } | ^^^ not found in this scope | note: function `m1::foo` exists but is inaccessible - --> $DIR/issue-4366.rs:23:5 + --> $DIR/issue-4366.rs:24:5 | LL | fn foo() {} | ^^^^^^^^ not accessible diff --git a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed index bc5b72c3f7294..5cc0083bc42c6 100644 --- a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed +++ b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix extern crate std as other_std; diff --git a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs index 5ac7407371d52..5bf82e8e0f737 100644 --- a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs +++ b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix extern crate std; diff --git a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr index 2621f913186ee..e6b99b9aef661 100644 --- a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr +++ b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr @@ -1,5 +1,5 @@ error[E0259]: the name `std` is defined multiple times - --> $DIR/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs:3:1 + --> $DIR/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs:4:1 | LL | extern crate std; | ^^^^^^^^^^^^^^^^^ `std` reimported here diff --git a/tests/ui/imports/issue-53269.rs b/tests/ui/imports/issue-53269.rs index 1031d507101de..becabbc8a05c6 100644 --- a/tests/ui/imports/issue-53269.rs +++ b/tests/ui/imports/issue-53269.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Ambiguity between a `macro_rules` macro and a non-existent import recovered as `Res::Err` macro_rules! mac { () => () } diff --git a/tests/ui/imports/issue-53269.stderr b/tests/ui/imports/issue-53269.stderr index c12fc0f378e81..b719558e8af26 100644 --- a/tests/ui/imports/issue-53269.stderr +++ b/tests/ui/imports/issue-53269.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `nonexistent_module` - --> $DIR/issue-53269.rs:6:9 + --> $DIR/issue-53269.rs:7:9 | LL | use nonexistent_module::mac; | ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent_module` @@ -10,19 +10,19 @@ LL + extern crate nonexistent_module; | error[E0659]: `mac` is ambiguous - --> $DIR/issue-53269.rs:8:5 + --> $DIR/issue-53269.rs:9:5 | LL | mac!(); | ^^^ ambiguous name | = note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module note: `mac` could refer to the macro defined here - --> $DIR/issue-53269.rs:3:1 + --> $DIR/issue-53269.rs:4:1 | LL | macro_rules! mac { () => () } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `mac` could also refer to the unresolved item imported here - --> $DIR/issue-53269.rs:6:9 + --> $DIR/issue-53269.rs:7:9 | LL | use nonexistent_module::mac; | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/issue-55457.rs b/tests/ui/imports/issue-55457.rs index fd08294025587..1f5c595037f3e 100644 --- a/tests/ui/imports/issue-55457.rs +++ b/tests/ui/imports/issue-55457.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use NonExistent; //~ ERROR unresolved import `NonExistent` use non_existent::non_existent; //~ ERROR unresolved import `non_existent` diff --git a/tests/ui/imports/issue-55457.stderr b/tests/ui/imports/issue-55457.stderr index 472e46caf31e1..e88831bb44b0b 100644 --- a/tests/ui/imports/issue-55457.stderr +++ b/tests/ui/imports/issue-55457.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `NonExistent` - --> $DIR/issue-55457.rs:1:5 + --> $DIR/issue-55457.rs:2:5 | LL | use NonExistent; | ^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | use NonExistent; | help: a similar name exists in the module: `non_existent` error[E0432]: unresolved import `non_existent` - --> $DIR/issue-55457.rs:2:5 + --> $DIR/issue-55457.rs:3:5 | LL | use non_existent::non_existent; | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `non_existent` diff --git a/tests/ui/imports/issue-55884-2.rs b/tests/ui/imports/issue-55884-2.rs index 6f8d0cf8ae2a2..1355a6c52b89a 100644 --- a/tests/ui/imports/issue-55884-2.rs +++ b/tests/ui/imports/issue-55884-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod options { pub struct ParseOptions {} } diff --git a/tests/ui/imports/issue-55884-2.stderr b/tests/ui/imports/issue-55884-2.stderr index 0d4f01aeafc64..7425b92a11e0f 100644 --- a/tests/ui/imports/issue-55884-2.stderr +++ b/tests/ui/imports/issue-55884-2.stderr @@ -1,26 +1,26 @@ error[E0603]: struct import `ParseOptions` is private - --> $DIR/issue-55884-2.rs:13:17 + --> $DIR/issue-55884-2.rs:14:17 | LL | pub use parser::ParseOptions; | ^^^^^^^^^^^^ private struct import | note: the struct import `ParseOptions` is defined here... - --> $DIR/issue-55884-2.rs:10:9 + --> $DIR/issue-55884-2.rs:11:9 | LL | use ParseOptions; | ^^^^^^^^^^^^ note: ...and refers to the struct import `ParseOptions` which is defined here... - --> $DIR/issue-55884-2.rs:13:9 + --> $DIR/issue-55884-2.rs:14:9 | LL | pub use parser::ParseOptions; | ^^^^^^^^^^^^^^^^^^^^ you could import this re-export note: ...and refers to the struct import `ParseOptions` which is defined here... - --> $DIR/issue-55884-2.rs:6:13 + --> $DIR/issue-55884-2.rs:7:13 | LL | pub use options::*; | ^^^^^^^^^^ you could import this re-export note: ...and refers to the struct `ParseOptions` which is defined here - --> $DIR/issue-55884-2.rs:2:5 + --> $DIR/issue-55884-2.rs:3:5 | LL | pub struct ParseOptions {} | ^^^^^^^^^^^^^^^^^^^^^^^ you could import this directly diff --git a/tests/ui/imports/issue-57015.rs b/tests/ui/imports/issue-57015.rs index 27688fd34f62f..cda5aa3e9ba21 100644 --- a/tests/ui/imports/issue-57015.rs +++ b/tests/ui/imports/issue-57015.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod glob_ok { pub mod something { pub mod something_else {} diff --git a/tests/ui/imports/issue-57015.stderr b/tests/ui/imports/issue-57015.stderr index d3b9cd21fba0f..409007c50019f 100644 --- a/tests/ui/imports/issue-57015.stderr +++ b/tests/ui/imports/issue-57015.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `single_err::something` - --> $DIR/issue-57015.rs:10:5 + --> $DIR/issue-57015.rs:11:5 | LL | use single_err::something; | ^^^^^^^^^^^^^^^^^^^^^ no `something` in `single_err` diff --git a/tests/ui/imports/issue-81413.rs b/tests/ui/imports/issue-81413.rs index f3fb8bfab20a4..63e91e3cec057 100644 --- a/tests/ui/imports/issue-81413.rs +++ b/tests/ui/imports/issue-81413.rs @@ -1,3 +1,4 @@ +//@ edition:2015 pub const ITEM: Item = Item; pub struct Item; diff --git a/tests/ui/imports/issue-81413.stderr b/tests/ui/imports/issue-81413.stderr index 257aca4455c5d..287f847e71280 100644 --- a/tests/ui/imports/issue-81413.stderr +++ b/tests/ui/imports/issue-81413.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `doesnt_exist` - --> $DIR/issue-81413.rs:7:9 + --> $DIR/issue-81413.rs:8:9 | LL | pub use doesnt_exist::*; | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `doesnt_exist` diff --git a/tests/ui/imports/local-modularized.rs b/tests/ui/imports/local-modularized.rs index 39d0169dd7993..402c0891990b5 100644 --- a/tests/ui/imports/local-modularized.rs +++ b/tests/ui/imports/local-modularized.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ build-pass (FIXME(62277): could be check-pass?) #[macro_export(local_inner_macros)] diff --git a/tests/ui/imports/no-std-inject.rs b/tests/ui/imports/no-std-inject.rs index e9664a4dd480e..6dc866353465e 100644 --- a/tests/ui/imports/no-std-inject.rs +++ b/tests/ui/imports/no-std-inject.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![no_std] extern crate core; //~ ERROR: the name `core` is defined multiple times diff --git a/tests/ui/imports/no-std-inject.stderr b/tests/ui/imports/no-std-inject.stderr index 7299c2e8a9f39..f6c32b83ca971 100644 --- a/tests/ui/imports/no-std-inject.stderr +++ b/tests/ui/imports/no-std-inject.stderr @@ -1,5 +1,5 @@ error[E0259]: the name `core` is defined multiple times - --> $DIR/no-std-inject.rs:3:1 + --> $DIR/no-std-inject.rs:4:1 | LL | extern crate core; | ^^^^^^^^^^^^^^^^^^ `core` reimported here diff --git a/tests/ui/imports/overlapping_pub_trait.rs b/tests/ui/imports/overlapping_pub_trait.rs index 9a56b96adbfa0..b73852e18a01d 100644 --- a/tests/ui/imports/overlapping_pub_trait.rs +++ b/tests/ui/imports/overlapping_pub_trait.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:overlapping_pub_trait_source.rs /* diff --git a/tests/ui/imports/overlapping_pub_trait.stderr b/tests/ui/imports/overlapping_pub_trait.stderr index 51a8bec85b7d4..3dedc3528595f 100644 --- a/tests/ui/imports/overlapping_pub_trait.stderr +++ b/tests/ui/imports/overlapping_pub_trait.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `method` found for struct `S` in the current scope - --> $DIR/overlapping_pub_trait.rs:12:7 + --> $DIR/overlapping_pub_trait.rs:13:7 | LL | S.method(); | ^^^^^^ method not found in `S` diff --git a/tests/ui/imports/private-std-reexport-suggest-public.fixed b/tests/ui/imports/private-std-reexport-suggest-public.fixed index 6374ba00bb4dc..0fc3b35b6252d 100644 --- a/tests/ui/imports/private-std-reexport-suggest-public.fixed +++ b/tests/ui/imports/private-std-reexport-suggest-public.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(unused_imports)] fn main() { diff --git a/tests/ui/imports/private-std-reexport-suggest-public.rs b/tests/ui/imports/private-std-reexport-suggest-public.rs index 04ec679c4d707..2a40404e87bd4 100644 --- a/tests/ui/imports/private-std-reexport-suggest-public.rs +++ b/tests/ui/imports/private-std-reexport-suggest-public.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(unused_imports)] fn main() { diff --git a/tests/ui/imports/private-std-reexport-suggest-public.stderr b/tests/ui/imports/private-std-reexport-suggest-public.stderr index 90d84bb4f5b47..49718da7fc939 100644 --- a/tests/ui/imports/private-std-reexport-suggest-public.stderr +++ b/tests/ui/imports/private-std-reexport-suggest-public.stderr @@ -1,11 +1,11 @@ error[E0603]: module import `mem` is private - --> $DIR/private-std-reexport-suggest-public.rs:4:14 + --> $DIR/private-std-reexport-suggest-public.rs:5:14 | LL | use foo::mem; | ^^^ private module import | note: the module import `mem` is defined here... - --> $DIR/private-std-reexport-suggest-public.rs:8:9 + --> $DIR/private-std-reexport-suggest-public.rs:9:9 | LL | use std::mem; | ^^^^^^^^ diff --git a/tests/ui/imports/resolve_self_super_hint.rs b/tests/ui/imports/resolve_self_super_hint.rs index a14ec5b7290b4..00a454bd61bfb 100644 --- a/tests/ui/imports/resolve_self_super_hint.rs +++ b/tests/ui/imports/resolve_self_super_hint.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod a { extern crate alloc; use alloc::HashMap; diff --git a/tests/ui/imports/resolve_self_super_hint.stderr b/tests/ui/imports/resolve_self_super_hint.stderr index bc862553b5bce..095a89ca2f1d2 100644 --- a/tests/ui/imports/resolve_self_super_hint.stderr +++ b/tests/ui/imports/resolve_self_super_hint.stderr @@ -1,17 +1,17 @@ error[E0432]: unresolved import `alloc` - --> $DIR/resolve_self_super_hint.rs:3:9 + --> $DIR/resolve_self_super_hint.rs:4:9 | LL | use alloc::HashMap; | ^^^^^ help: a similar path exists: `self::alloc` error[E0432]: unresolved import `alloc` - --> $DIR/resolve_self_super_hint.rs:8:13 + --> $DIR/resolve_self_super_hint.rs:9:13 | LL | use alloc::HashMap; | ^^^^^ help: a similar path exists: `super::alloc` error[E0432]: unresolved import `alloc` - --> $DIR/resolve_self_super_hint.rs:13:17 + --> $DIR/resolve_self_super_hint.rs:14:17 | LL | use alloc::HashMap; | ^^^^^ @@ -20,7 +20,7 @@ LL | use alloc::HashMap; | help: a similar path exists: `a::alloc` error[E0432]: unresolved import `alloc` - --> $DIR/resolve_self_super_hint.rs:18:21 + --> $DIR/resolve_self_super_hint.rs:19:21 | LL | use alloc::HashMap; | ^^^^^ diff --git a/tests/ui/imports/rfc-1560-warning-cycle.rs b/tests/ui/imports/rfc-1560-warning-cycle.rs index cfa7179fb6b57..29ad8735b8549 100644 --- a/tests/ui/imports/rfc-1560-warning-cycle.rs +++ b/tests/ui/imports/rfc-1560-warning-cycle.rs @@ -1,3 +1,4 @@ +//@ edition:2015 pub struct Foo; mod bar { diff --git a/tests/ui/imports/rfc-1560-warning-cycle.stderr b/tests/ui/imports/rfc-1560-warning-cycle.stderr index 8a83e58138365..7f47fdc74172e 100644 --- a/tests/ui/imports/rfc-1560-warning-cycle.stderr +++ b/tests/ui/imports/rfc-1560-warning-cycle.stderr @@ -1,18 +1,18 @@ error[E0659]: `Foo` is ambiguous - --> $DIR/rfc-1560-warning-cycle.rs:9:17 + --> $DIR/rfc-1560-warning-cycle.rs:10:17 | LL | fn f(_: Foo) {} | ^^^ ambiguous name | = note: ambiguous because of multiple glob imports of a name in the same module note: `Foo` could refer to the struct imported here - --> $DIR/rfc-1560-warning-cycle.rs:7:13 + --> $DIR/rfc-1560-warning-cycle.rs:8:13 | LL | use *; | ^ = help: consider adding an explicit import of `Foo` to disambiguate note: `Foo` could also refer to the struct imported here - --> $DIR/rfc-1560-warning-cycle.rs:8:13 + --> $DIR/rfc-1560-warning-cycle.rs:9:13 | LL | use bar::*; | ^^^^^^ diff --git a/tests/ui/imports/shadow-glob-module-resolution-2.rs b/tests/ui/imports/shadow-glob-module-resolution-2.rs index 36bd72658ae84..c3abd1f75542c 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-2.rs +++ b/tests/ui/imports/shadow-glob-module-resolution-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // https://github.com/rust-lang/rust/issues/125013 mod a { diff --git a/tests/ui/imports/shadow-glob-module-resolution-2.stderr b/tests/ui/imports/shadow-glob-module-resolution-2.stderr index 644fcb8416289..4fdfe27b3d729 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-2.stderr +++ b/tests/ui/imports/shadow-glob-module-resolution-2.stderr @@ -1,11 +1,11 @@ error: cannot determine resolution for the import - --> $DIR/shadow-glob-module-resolution-2.rs:15:5 + --> $DIR/shadow-glob-module-resolution-2.rs:16:5 | LL | use b::c::D as e; | ^^^^^^^^^^^^ error: cannot determine resolution for the import - --> $DIR/shadow-glob-module-resolution-2.rs:15:5 + --> $DIR/shadow-glob-module-resolution-2.rs:16:5 | LL | use b::c::D as e; | ^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | use b::c::D as e; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0432]: unresolved import `e` - --> $DIR/shadow-glob-module-resolution-2.rs:13:5 + --> $DIR/shadow-glob-module-resolution-2.rs:14:5 | LL | use e as b; | -^^^^^ diff --git a/tests/ui/imports/show-private-items-issue-138626.rs b/tests/ui/imports/show-private-items-issue-138626.rs index d9708fc33c215..4d7ab28efdd67 100644 --- a/tests/ui/imports/show-private-items-issue-138626.rs +++ b/tests/ui/imports/show-private-items-issue-138626.rs @@ -1,3 +1,4 @@ +//@ edition:2015 pub mod one { mod foo { pub struct Foo; diff --git a/tests/ui/imports/show-private-items-issue-138626.stderr b/tests/ui/imports/show-private-items-issue-138626.stderr index b664462daed7d..2fa4a56ccf18a 100644 --- a/tests/ui/imports/show-private-items-issue-138626.stderr +++ b/tests/ui/imports/show-private-items-issue-138626.stderr @@ -1,11 +1,11 @@ error[E0432]: unresolved import `crate::two::foo::Foo` - --> $DIR/show-private-items-issue-138626.rs:16:13 + --> $DIR/show-private-items-issue-138626.rs:17:13 | LL | pub use crate::two::foo::Foo; | ^^^^^^^^^^^^^^^^^^^^ no `Foo` in `two::foo` | note: struct `two::foo::bar::Foo` exists but is inaccessible - --> $DIR/show-private-items-issue-138626.rs:12:13 + --> $DIR/show-private-items-issue-138626.rs:13:13 | LL | pub struct Foo; | ^^^^^^^^^^^^^^^ not accessible diff --git a/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr b/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr index 10b8db62edc91..91fad1fb3099c 100644 --- a/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr +++ b/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: unresolved import - --> $DIR/suggest-import-issue-120074.rs:12:35 + --> $DIR/suggest-import-issue-120074.rs:14:35 | LL | println!("Hello, {}!", crate::bar::do_the_thing); | ^^^ unresolved import diff --git a/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr b/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr index 10b8db62edc91..91fad1fb3099c 100644 --- a/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr +++ b/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: unresolved import - --> $DIR/suggest-import-issue-120074.rs:12:35 + --> $DIR/suggest-import-issue-120074.rs:14:35 | LL | println!("Hello, {}!", crate::bar::do_the_thing); | ^^^ unresolved import diff --git a/tests/ui/imports/suggest-import-issue-120074.post2015.stderr b/tests/ui/imports/suggest-import-issue-120074.post2015.stderr new file mode 100644 index 0000000000000..f334fb31a3dc1 --- /dev/null +++ b/tests/ui/imports/suggest-import-issue-120074.post2015.stderr @@ -0,0 +1,23 @@ +error[E0433]: failed to resolve: unresolved import + --> $DIR/suggest-import-issue-120074.rs:14:35 + | +LL | println!("Hello, {}!", crate::bar::do_the_thing); + | ^^^ unresolved import + | +help: a similar path exists + | +LL | println!("Hello, {}!", crate::foo::bar::do_the_thing); + | +++++ +help: consider importing this module + | +LL + use crate::foo::bar; + | +help: if you import `bar`, refer to it directly + | +LL - println!("Hello, {}!", crate::bar::do_the_thing); +LL + println!("Hello, {}!", bar::do_the_thing); + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/tests/ui/imports/suggest-import-issue-120074.rs b/tests/ui/imports/suggest-import-issue-120074.rs index 7b6b5c73103a1..4ca0d52b1f3ee 100644 --- a/tests/ui/imports/suggest-import-issue-120074.rs +++ b/tests/ui/imports/suggest-import-issue-120074.rs @@ -1,4 +1,6 @@ -//@ revisions: edition2015 edition2021 +//@ revisions: edition2015 post2015 +//@[edition2015] edition: 2015 +//@[post2015] edition: 2018.. pub mod foo { pub mod bar { diff --git a/tests/ui/imports/tool-mod-child.rs b/tests/ui/imports/tool-mod-child.rs index 38bcdfb024941..c0978046719af 100644 --- a/tests/ui/imports/tool-mod-child.rs +++ b/tests/ui/imports/tool-mod-child.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use clippy::a; //~ ERROR unresolved import `clippy` use clippy::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `clippy` diff --git a/tests/ui/imports/tool-mod-child.stderr b/tests/ui/imports/tool-mod-child.stderr index b0e446fcbf6a7..3e216c492d34a 100644 --- a/tests/ui/imports/tool-mod-child.stderr +++ b/tests/ui/imports/tool-mod-child.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `clippy` - --> $DIR/tool-mod-child.rs:2:5 + --> $DIR/tool-mod-child.rs:3:5 | LL | use clippy::a::b; | ^^^^^^ use of unresolved module or unlinked crate `clippy` @@ -10,7 +10,7 @@ LL + extern crate clippy; | error[E0432]: unresolved import `clippy` - --> $DIR/tool-mod-child.rs:1:5 + --> $DIR/tool-mod-child.rs:2:5 | LL | use clippy::a; | ^^^^^^ use of unresolved module or unlinked crate `clippy` @@ -21,7 +21,7 @@ LL + extern crate clippy; | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustdoc` - --> $DIR/tool-mod-child.rs:5:5 + --> $DIR/tool-mod-child.rs:6:5 | LL | use rustdoc::a::b; | ^^^^^^^ use of unresolved module or unlinked crate `rustdoc` @@ -32,7 +32,7 @@ LL + extern crate rustdoc; | error[E0432]: unresolved import `rustdoc` - --> $DIR/tool-mod-child.rs:4:5 + --> $DIR/tool-mod-child.rs:5:5 | LL | use rustdoc::a; | ^^^^^^^ use of unresolved module or unlinked crate `rustdoc` diff --git a/tests/ui/imports/unnamed_pub_trait.rs b/tests/ui/imports/unnamed_pub_trait.rs index 1527dfef14763..d988758478c96 100644 --- a/tests/ui/imports/unnamed_pub_trait.rs +++ b/tests/ui/imports/unnamed_pub_trait.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:unnamed_pub_trait_source.rs /* diff --git a/tests/ui/imports/unnamed_pub_trait.stderr b/tests/ui/imports/unnamed_pub_trait.stderr index 7d6b7742981ce..7c4c76f6f2a47 100644 --- a/tests/ui/imports/unnamed_pub_trait.stderr +++ b/tests/ui/imports/unnamed_pub_trait.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `method` found for struct `S` in the current scope - --> $DIR/unnamed_pub_trait.rs:13:7 + --> $DIR/unnamed_pub_trait.rs:14:7 | LL | S.method(); | ^^^^^^ method not found in `S` diff --git a/tests/ui/imports/unresolved-imports-used.rs b/tests/ui/imports/unresolved-imports-used.rs index 75cf880192c8e..fb52c2e357fb2 100644 --- a/tests/ui/imports/unresolved-imports-used.rs +++ b/tests/ui/imports/unresolved-imports-used.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // There should be *one* unused import error. #![deny(unused_imports)] diff --git a/tests/ui/imports/unresolved-imports-used.stderr b/tests/ui/imports/unresolved-imports-used.stderr index d39d268521718..5febca8eeb73d 100644 --- a/tests/ui/imports/unresolved-imports-used.stderr +++ b/tests/ui/imports/unresolved-imports-used.stderr @@ -1,17 +1,17 @@ error[E0432]: unresolved import `qux::bar` - --> $DIR/unresolved-imports-used.rs:10:5 + --> $DIR/unresolved-imports-used.rs:11:5 | LL | use qux::bar; | ^^^^^^^^ no `bar` in `qux` error[E0432]: unresolved import `qux::bar2` - --> $DIR/unresolved-imports-used.rs:13:5 + --> $DIR/unresolved-imports-used.rs:14:5 | LL | use qux::bar2; | ^^^^^^^^^ no `bar2` in `qux` error[E0432]: unresolved import `foo` - --> $DIR/unresolved-imports-used.rs:11:5 + --> $DIR/unresolved-imports-used.rs:12:5 | LL | use foo::bar; | ^^^ use of unresolved module or unlinked crate `foo` @@ -22,7 +22,7 @@ LL + extern crate foo; | error[E0432]: unresolved import `baz` - --> $DIR/unresolved-imports-used.rs:12:5 + --> $DIR/unresolved-imports-used.rs:13:5 | LL | use baz::*; | ^^^ use of unresolved module or unlinked crate `baz` @@ -33,7 +33,7 @@ LL + extern crate baz; | error[E0432]: unresolved import `foo2` - --> $DIR/unresolved-imports-used.rs:14:5 + --> $DIR/unresolved-imports-used.rs:15:5 | LL | use foo2::bar2; | ^^^^ use of unresolved module or unlinked crate `foo2` @@ -44,7 +44,7 @@ LL + extern crate foo2; | error[E0432]: unresolved import `baz2` - --> $DIR/unresolved-imports-used.rs:15:5 + --> $DIR/unresolved-imports-used.rs:16:5 | LL | use baz2::*; | ^^^^ use of unresolved module or unlinked crate `baz2` @@ -55,25 +55,25 @@ LL + extern crate baz2; | error[E0603]: function `quz` is private - --> $DIR/unresolved-imports-used.rs:9:10 + --> $DIR/unresolved-imports-used.rs:10:10 | LL | use qux::quz; | ^^^ private function | note: the function `quz` is defined here - --> $DIR/unresolved-imports-used.rs:5:4 + --> $DIR/unresolved-imports-used.rs:6:4 | LL | fn quz() {} | ^^^^^^^^ error: unused import: `qux::quy` - --> $DIR/unresolved-imports-used.rs:16:5 + --> $DIR/unresolved-imports-used.rs:17:5 | LL | use qux::quy; | ^^^^^^^^ | note: the lint level is defined here - --> $DIR/unresolved-imports-used.rs:2:9 + --> $DIR/unresolved-imports-used.rs:3:9 | LL | #![deny(unused_imports)] | ^^^^^^^^^^^^^^ diff --git a/tests/ui/inference/inference-variable-behind-raw-pointer.rs b/tests/ui/inference/inference-variable-behind-raw-pointer.rs index 6a67cf593a567..1b0db7b2b09c6 100644 --- a/tests/ui/inference/inference-variable-behind-raw-pointer.rs +++ b/tests/ui/inference/inference-variable-behind-raw-pointer.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass // tests that the following code compiles, but produces a future-compatibility warning diff --git a/tests/ui/inference/inference-variable-behind-raw-pointer.stderr b/tests/ui/inference/inference-variable-behind-raw-pointer.stderr index fe4e16c332869..50202ea3db3e3 100644 --- a/tests/ui/inference/inference-variable-behind-raw-pointer.stderr +++ b/tests/ui/inference/inference-variable-behind-raw-pointer.stderr @@ -1,5 +1,5 @@ warning: type annotations needed - --> $DIR/inference-variable-behind-raw-pointer.rs:8:13 + --> $DIR/inference-variable-behind-raw-pointer.rs:9:13 | LL | if data.is_null() {} | ^^^^^^^ diff --git a/tests/ui/issues/issue-17546.rs b/tests/ui/issues/issue-17546.rs index ade6335055ac8..1f0afc368a2eb 100644 --- a/tests/ui/issues/issue-17546.rs +++ b/tests/ui/issues/issue-17546.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ ignore-sgx std::os::fortanix_sgx::usercalls::raw::Result changes compiler suggestions use foo::MyEnum::Result; diff --git a/tests/ui/issues/issue-17546.stderr b/tests/ui/issues/issue-17546.stderr index 5bae738d3ecde..d4aa354491fe1 100644 --- a/tests/ui/issues/issue-17546.stderr +++ b/tests/ui/issues/issue-17546.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `NoResult` - --> $DIR/issue-17546.rs:14:17 + --> $DIR/issue-17546.rs:15:17 | LL | fn new() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL + fn new() -> Result { | error[E0573]: expected type, found variant `Result` - --> $DIR/issue-17546.rs:24:17 + --> $DIR/issue-17546.rs:25:17 | LL | fn new() -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type @@ -36,7 +36,7 @@ LL + use std::thread::Result; | error[E0573]: expected type, found variant `Result` - --> $DIR/issue-17546.rs:30:13 + --> $DIR/issue-17546.rs:31:13 | LL | fn new() -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type @@ -53,7 +53,7 @@ LL + use std::thread::Result; | error[E0573]: expected type, found variant `NoResult` - --> $DIR/issue-17546.rs:35:15 + --> $DIR/issue-17546.rs:36:15 | LL | fn newer() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-28344.rs b/tests/ui/issues/issue-28344.rs index 951ea5d69e931..883a8397e5a9e 100644 --- a/tests/ui/issues/issue-28344.rs +++ b/tests/ui/issues/issue-28344.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use std::ops::BitXor; fn main() { diff --git a/tests/ui/issues/issue-28344.stderr b/tests/ui/issues/issue-28344.stderr index c23b5767302c9..c85424e227941 100644 --- a/tests/ui/issues/issue-28344.stderr +++ b/tests/ui/issues/issue-28344.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-28344.rs:4:17 + --> $DIR/issue-28344.rs:5:17 | LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); | ^^^^^^ @@ -13,13 +13,13 @@ LL | let x: u8 = ::bitor(0 as u8, 0 as u8); | ++++ + error[E0191]: the value of the associated type `Output` in `BitXor<_>` must be specified - --> $DIR/issue-28344.rs:4:17 + --> $DIR/issue-28344.rs:5:17 | LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); | ^^^^^^ help: specify the associated type: `BitXor::` warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-28344.rs:9:13 + --> $DIR/issue-28344.rs:10:13 | LL | let g = BitXor::bitor; | ^^^^^^ @@ -32,7 +32,7 @@ LL | let g = ::bitor; | ++++ + error[E0191]: the value of the associated type `Output` in `BitXor<_>` must be specified - --> $DIR/issue-28344.rs:9:13 + --> $DIR/issue-28344.rs:10:13 | LL | let g = BitXor::bitor; | ^^^^^^ help: specify the associated type: `BitXor::` diff --git a/tests/ui/issues/issue-35976.rs b/tests/ui/issues/issue-35976.rs index 8249da4a01d16..03d4a187f5557 100644 --- a/tests/ui/issues/issue-35976.rs +++ b/tests/ui/issues/issue-35976.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ revisions: imported unimported //@[imported] check-pass diff --git a/tests/ui/issues/issue-35976.unimported.stderr b/tests/ui/issues/issue-35976.unimported.stderr index 169e3d05d23b1..db2973d902efb 100644 --- a/tests/ui/issues/issue-35976.unimported.stderr +++ b/tests/ui/issues/issue-35976.unimported.stderr @@ -1,5 +1,5 @@ error: the `wait` method cannot be invoked on a trait object - --> $DIR/issue-35976.rs:20:9 + --> $DIR/issue-35976.rs:21:9 | LL | fn wait(&self) where Self: Sized; | ----- this has a `Sized` requirement diff --git a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.rs b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.rs index a46ce67d40d5a..b05774cfe70c9 100644 --- a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.rs +++ b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use extern::foo; //~ ERROR expected identifier, found keyword `extern` //~| ERROR unresolved import `r#extern` diff --git a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr index dab68258a4720..df733fa61992a 100644 --- a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr +++ b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr @@ -1,5 +1,5 @@ error: expected identifier, found keyword `extern` - --> $DIR/keyword-extern-as-identifier-use.rs:1:5 + --> $DIR/keyword-extern-as-identifier-use.rs:2:5 | LL | use extern::foo; | ^^^^^^ expected identifier, found keyword @@ -10,7 +10,7 @@ LL | use r#extern::foo; | ++ error[E0432]: unresolved import `r#extern` - --> $DIR/keyword-extern-as-identifier-use.rs:1:5 + --> $DIR/keyword-extern-as-identifier-use.rs:2:5 | LL | use extern::foo; | ^^^^^^ use of unresolved module or unlinked crate `r#extern` diff --git a/tests/ui/label/continue-pointing-to-block-ice-113379.rs b/tests/ui/label/continue-pointing-to-block-ice-113379.rs index 8a6a9cc840986..f39c363ef93c5 100644 --- a/tests/ui/label/continue-pointing-to-block-ice-113379.rs +++ b/tests/ui/label/continue-pointing-to-block-ice-113379.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //! Regression test for ICE #113379. Liveness linting assumes that `continue`s all point to loops. //! This tests that if a `continue` points to a block, we don't run liveness lints. diff --git a/tests/ui/label/continue-pointing-to-block-ice-113379.stderr b/tests/ui/label/continue-pointing-to-block-ice-113379.stderr index ada6305ec999b..01152b9ed676f 100644 --- a/tests/ui/label/continue-pointing-to-block-ice-113379.stderr +++ b/tests/ui/label/continue-pointing-to-block-ice-113379.stderr @@ -1,5 +1,5 @@ error[E0670]: `async fn` is not permitted in Rust 2015 - --> $DIR/continue-pointing-to-block-ice-113379.rs:4:1 + --> $DIR/continue-pointing-to-block-ice-113379.rs:5:1 | LL | async fn f999() -> Vec { | ^^^^^ to use `async fn`, switch to Rust 2018 or later @@ -8,13 +8,13 @@ LL | async fn f999() -> Vec { = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0601]: `main` function not found in crate `continue_pointing_to_block_ice_113379` - --> $DIR/continue-pointing-to-block-ice-113379.rs:11:2 + --> $DIR/continue-pointing-to-block-ice-113379.rs:12:2 | LL | } | ^ consider adding a `main` function to `$DIR/continue-pointing-to-block-ice-113379.rs` error[E0696]: `continue` pointing to a labeled block - --> $DIR/continue-pointing-to-block-ice-113379.rs:8:9 + --> $DIR/continue-pointing-to-block-ice-113379.rs:9:9 | LL | / 'b: { LL | | @@ -25,7 +25,7 @@ LL | | } | |_____- labeled block the `continue` points to error[E0308]: mismatched types - --> $DIR/continue-pointing-to-block-ice-113379.rs:6:5 + --> $DIR/continue-pointing-to-block-ice-113379.rs:7:5 | LL | / 'b: { LL | | diff --git a/tests/ui/lang-items/issue-83471.rs b/tests/ui/lang-items/issue-83471.rs index f3ce9f25c1360..9952faa2472ae 100644 --- a/tests/ui/lang-items/issue-83471.rs +++ b/tests/ui/lang-items/issue-83471.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Regression test for the ICE reported in issue #83471. #![crate_type="lib"] diff --git a/tests/ui/lang-items/issue-83471.stderr b/tests/ui/lang-items/issue-83471.stderr index 28fa552fbeb4d..0c2b403902e2d 100644 --- a/tests/ui/lang-items/issue-83471.stderr +++ b/tests/ui/lang-items/issue-83471.stderr @@ -1,11 +1,11 @@ error[E0573]: expected type, found built-in attribute `export_name` - --> $DIR/issue-83471.rs:23:13 + --> $DIR/issue-83471.rs:24:13 | LL | fn call(export_name); | ^^^^^^^^^^^ not a type error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:7:1 + --> $DIR/issue-83471.rs:8:1 | LL | #[lang = "pointee_sized"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | #[lang = "pointee_sized"] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:11:1 + --> $DIR/issue-83471.rs:12:1 | LL | #[lang = "meta_sized"] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | #[lang = "meta_sized"] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:15:1 + --> $DIR/issue-83471.rs:16:1 | LL | #[lang = "sized"] | ^^^^^^^^^^^^^^^^^ @@ -32,7 +32,7 @@ LL | #[lang = "sized"] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:19:1 + --> $DIR/issue-83471.rs:20:1 | LL | #[lang = "fn"] | ^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ LL | #[lang = "fn"] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date warning: anonymous parameters are deprecated and will be removed in the next edition - --> $DIR/issue-83471.rs:23:13 + --> $DIR/issue-83471.rs:24:13 | LL | fn call(export_name); | ^^^^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: export_name` @@ -51,7 +51,7 @@ LL | fn call(export_name); = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default error[E0718]: `fn` lang item must be applied to a trait with 1 generic argument - --> $DIR/issue-83471.rs:19:1 + --> $DIR/issue-83471.rs:20:1 | LL | #[lang = "fn"] | ^^^^^^^^^^^^^^ @@ -60,7 +60,7 @@ LL | trait Fn { | - this trait has 0 generic arguments error[E0425]: cannot find function `a` in this scope - --> $DIR/issue-83471.rs:29:5 + --> $DIR/issue-83471.rs:30:5 | LL | a() | ^ not found in this scope diff --git a/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.rs b/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.rs index 1d4fe7a3f0a57..5be0330893792 100644 --- a/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.rs +++ b/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // --force-warn $LINT causes $LINT (which is warn-by-default) to warn // despite $LINT_GROUP (which contains $LINT) being allowed //@ compile-flags: --force-warn bare_trait_objects diff --git a/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr index 2be7416711e04..1575eef1a0183 100644 --- a/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/allowed-group-warn-by-default-lint.rs:10:25 + --> $DIR/allowed-group-warn-by-default-lint.rs:11:25 | LL | pub fn function(_x: Box) {} | ^^^^^^^^^ diff --git a/tests/ui/lint/force-warn/cap-lints-allow.rs b/tests/ui/lint/force-warn/cap-lints-allow.rs index a4492494489c1..041e821f8b66a 100644 --- a/tests/ui/lint/force-warn/cap-lints-allow.rs +++ b/tests/ui/lint/force-warn/cap-lints-allow.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // --force-warn $LINT casuses $LINT to warn despite --cap-lints // set to allow //@ compile-flags: --cap-lints allow --force-warn bare_trait_objects diff --git a/tests/ui/lint/force-warn/cap-lints-allow.stderr b/tests/ui/lint/force-warn/cap-lints-allow.stderr index 92bcde11415f6..049fbdcdc2f21 100644 --- a/tests/ui/lint/force-warn/cap-lints-allow.stderr +++ b/tests/ui/lint/force-warn/cap-lints-allow.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/cap-lints-allow.rs:8:25 + --> $DIR/cap-lints-allow.rs:9:25 | LL | pub fn function(_x: Box) {} | ^^^^^^^^^ diff --git a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.rs b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.rs index 5a9d29c520d1f..6ed97a17fb937 100644 --- a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.rs +++ b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // --force-warn $LINT_GROUP causes $LINT to warn despite $LINT being // allowed in module and cap-lints set to warn //@ compile-flags: --cap-lints warn --force-warn rust-2021-compatibility diff --git a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr index 74b34de90f17c..28e91a09f990d 100644 --- a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr @@ -1,5 +1,5 @@ warning: `...` range patterns are deprecated - --> $DIR/cap-lints-warn-allowed-warn-by-default-lint.rs:10:10 + --> $DIR/cap-lints-warn-allowed-warn-by-default-lint.rs:11:10 | LL | 0...100 => true, | ^^^ help: use `..=` for an inclusive range diff --git a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.rs b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.rs index 2f7f64be05691..6edba4c5c738c 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.rs +++ b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // --force-warn $LINT_GROUP causes $LINT (which is warn-by-default) to warn // despite $LINT being allowed on command line //@ compile-flags: -A bare-trait-objects --force-warn rust-2018-idioms diff --git a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr index 5bfbc9599bc3f..f581f4d52b839 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/lint-group-allowed-cli-warn-by-default-lint.rs:8:25 + --> $DIR/lint-group-allowed-cli-warn-by-default-lint.rs:9:25 | LL | pub fn function(_x: Box) {} | ^^^^^^^^^ diff --git a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.rs b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.rs index 818d021e60f98..5c770c1c38ad9 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.rs +++ b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // --force-warn $LINT_GROUP causes $LINT to warn despite // $LINT_GROUP being allowed in module //@ compile-flags: --force-warn rust_2018_idioms diff --git a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr index dabf12be5ff77..90b25b175be14 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/lint-group-allowed-lint-group.rs:10:25 + --> $DIR/lint-group-allowed-lint-group.rs:11:25 | LL | pub fn function(_x: Box) {} | ^^^^^^^^^ diff --git a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.rs b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.rs index 358a7a32cfe01..0805c62b1ec60 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.rs +++ b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // --force-warn $LINT_GROUP causes $LINT (which is warn-by-default) to warn // despite $LINT being allowed in module //@ compile-flags: --force-warn rust-2018-idioms diff --git a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr index 23a3a9107a13f..2f91ce6b265f3 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/lint-group-allowed-warn-by-default-lint.rs:10:25 + --> $DIR/lint-group-allowed-warn-by-default-lint.rs:11:25 | LL | pub fn function(_x: Box) {} | ^^^^^^^^^ diff --git a/tests/ui/lint/future-incompatible-lint-group.rs b/tests/ui/lint/future-incompatible-lint-group.rs index 22a7ccb463b6c..e7a9ecd1920ab 100644 --- a/tests/ui/lint/future-incompatible-lint-group.rs +++ b/tests/ui/lint/future-incompatible-lint-group.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //! Test that future_incompatible lint group only includes edition-independent lints // Ensure that the future_incompatible lint group only includes diff --git a/tests/ui/lint/future-incompatible-lint-group.stderr b/tests/ui/lint/future-incompatible-lint-group.stderr index 4157cd0c77d94..bac24740fb4e1 100644 --- a/tests/ui/lint/future-incompatible-lint-group.stderr +++ b/tests/ui/lint/future-incompatible-lint-group.stderr @@ -1,5 +1,5 @@ warning: anonymous parameters are deprecated and will be removed in the next edition - --> $DIR/future-incompatible-lint-group.rs:25:10 + --> $DIR/future-incompatible-lint-group.rs:26:10 | LL | fn f(u8) {} | ^^ help: try naming the parameter or explicitly ignoring it: `_: u8` @@ -9,7 +9,7 @@ LL | fn f(u8) {} = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default error: ambiguous associated item - --> $DIR/future-incompatible-lint-group.rs:18:17 + --> $DIR/future-incompatible-lint-group.rs:19:17 | LL | fn foo() -> Self::V { 0 } | ^^^^^^^ help: use fully-qualified syntax: `::V` @@ -17,17 +17,17 @@ LL | fn foo() -> Self::V { 0 } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #57644 note: `V` could refer to the variant defined here - --> $DIR/future-incompatible-lint-group.rs:7:10 + --> $DIR/future-incompatible-lint-group.rs:8:10 | LL | enum E { V } | ^ note: `V` could also refer to the associated type defined here - --> $DIR/future-incompatible-lint-group.rs:10:5 + --> $DIR/future-incompatible-lint-group.rs:11:5 | LL | type V; | ^^^^^^ note: the lint level is defined here - --> $DIR/future-incompatible-lint-group.rs:5:9 + --> $DIR/future-incompatible-lint-group.rs:6:9 | LL | #![deny(future_incompatible)] | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/inclusive-range-pattern-syntax.fixed b/tests/ui/lint/inclusive-range-pattern-syntax.fixed index 1c47673cfc3ef..824b7384eb45a 100644 --- a/tests/ui/lint/inclusive-range-pattern-syntax.fixed +++ b/tests/ui/lint/inclusive-range-pattern-syntax.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass //@ run-rustfix diff --git a/tests/ui/lint/inclusive-range-pattern-syntax.rs b/tests/ui/lint/inclusive-range-pattern-syntax.rs index e6e8c1c9532c4..93f4ba01bc5ba 100644 --- a/tests/ui/lint/inclusive-range-pattern-syntax.rs +++ b/tests/ui/lint/inclusive-range-pattern-syntax.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass //@ run-rustfix diff --git a/tests/ui/lint/inclusive-range-pattern-syntax.stderr b/tests/ui/lint/inclusive-range-pattern-syntax.stderr index a41082bb13b12..06c2883c4e2e6 100644 --- a/tests/ui/lint/inclusive-range-pattern-syntax.stderr +++ b/tests/ui/lint/inclusive-range-pattern-syntax.stderr @@ -1,5 +1,5 @@ warning: `...` range patterns are deprecated - --> $DIR/inclusive-range-pattern-syntax.rs:9:10 + --> $DIR/inclusive-range-pattern-syntax.rs:10:10 | LL | 1...2 => {} | ^^^ help: use `..=` for an inclusive range @@ -7,13 +7,13 @@ LL | 1...2 => {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/inclusive-range-pattern-syntax.rs:4:9 + --> $DIR/inclusive-range-pattern-syntax.rs:5:9 | LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: `...` range patterns are deprecated - --> $DIR/inclusive-range-pattern-syntax.rs:16:9 + --> $DIR/inclusive-range-pattern-syntax.rs:17:9 | LL | &1...2 => {} | ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)` diff --git a/tests/ui/lint/issue-35075.rs b/tests/ui/lint/issue-35075.rs index 0e54131c24560..134fa884e3c33 100644 --- a/tests/ui/lint/issue-35075.rs +++ b/tests/ui/lint/issue-35075.rs @@ -1,3 +1,4 @@ +//@ edition:2015 struct Bar { inner: Foo //~ ERROR cannot find type `Foo` in this scope } diff --git a/tests/ui/lint/issue-35075.stderr b/tests/ui/lint/issue-35075.stderr index f02f9e678b469..f1f27152c2ff5 100644 --- a/tests/ui/lint/issue-35075.stderr +++ b/tests/ui/lint/issue-35075.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Foo` in this scope - --> $DIR/issue-35075.rs:2:12 + --> $DIR/issue-35075.rs:3:12 | LL | inner: Foo | ^^^ not found in this scope @@ -11,7 +11,7 @@ LL + inner: Baz | error[E0412]: cannot find type `Foo` in this scope - --> $DIR/issue-35075.rs:6:9 + --> $DIR/issue-35075.rs:7:9 | LL | Foo(Foo) | ^^^ not found in this scope diff --git a/tests/ui/lint/issue-87274-paren-parent.rs b/tests/ui/lint/issue-87274-paren-parent.rs index 409824cc9406d..2b1172ee2f9f3 100644 --- a/tests/ui/lint/issue-87274-paren-parent.rs +++ b/tests/ui/lint/issue-87274-paren-parent.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass // Tests that we properly lint at 'paren' expressions diff --git a/tests/ui/lint/issue-87274-paren-parent.stderr b/tests/ui/lint/issue-87274-paren-parent.stderr index f06024298bc19..996ea6e530e1e 100644 --- a/tests/ui/lint/issue-87274-paren-parent.stderr +++ b/tests/ui/lint/issue-87274-paren-parent.stderr @@ -1,5 +1,5 @@ warning: use of deprecated macro `try`: use the `?` operator instead - --> $DIR/issue-87274-paren-parent.rs:5:6 + --> $DIR/issue-87274-paren-parent.rs:6:6 | LL | (try!(Ok::(1))); | ^^^ diff --git a/tests/ui/lint/lint-attr-everywhere-early.rs b/tests/ui/lint/lint-attr-everywhere-early.rs index 7ca127d066f56..a025589ff9b28 100644 --- a/tests/ui/lint/lint-attr-everywhere-early.rs +++ b/tests/ui/lint/lint-attr-everywhere-early.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Tests that lint levels can be set for early lints. #![allow(non_camel_case_types, unsafe_code, while_true, unused_parens)] diff --git a/tests/ui/lint/lint-attr-everywhere-early.stderr b/tests/ui/lint/lint-attr-everywhere-early.stderr index 2389b698c83c6..b84ccf15caef5 100644 --- a/tests/ui/lint/lint-attr-everywhere-early.stderr +++ b/tests/ui/lint/lint-attr-everywhere-early.stderr @@ -1,23 +1,23 @@ error: type `type_outer` should have an upper camel case name - --> $DIR/lint-attr-everywhere-early.rs:22:6 + --> $DIR/lint-attr-everywhere-early.rs:23:6 | LL | type type_outer = i32; | ^^^^^^^^^^ help: convert the identifier to upper camel case: `TypeOuter` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:21:8 + --> $DIR/lint-attr-everywhere-early.rs:22:8 | LL | #[deny(non_camel_case_types)] | ^^^^^^^^^^^^^^^^^^^^ error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:24:43 + --> $DIR/lint-attr-everywhere-early.rs:25:43 | LL | type BareFnPtr = fn(#[deny(unused_parens)](i32)); | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:24:28 + --> $DIR/lint-attr-everywhere-early.rs:25:28 | LL | type BareFnPtr = fn(#[deny(unused_parens)](i32)); | ^^^^^^^^^^^^^ @@ -28,169 +28,169 @@ LL + type BareFnPtr = fn(#[deny(unused_parens)]i32); | error: type `ITEM_OUTER` should have an upper camel case name - --> $DIR/lint-attr-everywhere-early.rs:30:8 + --> $DIR/lint-attr-everywhere-early.rs:31:8 | LL | struct ITEM_OUTER; | ^^^^^^^^^^ help: convert the identifier to upper camel case: `ItemOuter` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:29:8 + --> $DIR/lint-attr-everywhere-early.rs:30:8 | LL | #[deny(non_camel_case_types)] | ^^^^^^^^^^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:35:9 + --> $DIR/lint-attr-everywhere-early.rs:36:9 | LL | unsafe {} | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:33:13 + --> $DIR/lint-attr-everywhere-early.rs:34:13 | LL | #![deny(unsafe_code)] | ^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:43:39 + --> $DIR/lint-attr-everywhere-early.rs:44:39 | LL | fn inherent_denied_from_inner() { unsafe {} } | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:41:13 + --> $DIR/lint-attr-everywhere-early.rs:42:13 | LL | #![deny(unsafe_code)] | ^^^^^^^^^^^ error: denote infinite loops with `loop { ... }` - --> $DIR/lint-attr-everywhere-early.rs:46:24 + --> $DIR/lint-attr-everywhere-early.rs:47:24 | LL | fn inherent_fn() { while true {} } | ^^^^^^^^^^ help: use `loop` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:45:12 + --> $DIR/lint-attr-everywhere-early.rs:46:12 | LL | #[deny(while_true)] | ^^^^^^^^^^ error: denote infinite loops with `loop { ... }` - --> $DIR/lint-attr-everywhere-early.rs:49:34 + --> $DIR/lint-attr-everywhere-early.rs:50:34 | LL | const INHERENT_CONST: i32 = {while true {} 1}; | ^^^^^^^^^^ help: use `loop` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:48:12 + --> $DIR/lint-attr-everywhere-early.rs:49:12 | LL | #[deny(while_true)] | ^^^^^^^^^^ error: trait `trait_inner` should have an upper camel case name - --> $DIR/lint-attr-everywhere-early.rs:52:7 + --> $DIR/lint-attr-everywhere-early.rs:53:7 | LL | trait trait_inner { | ^^^^^^^^^^^ help: convert the identifier to upper camel case: `TraitInner` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:53:13 + --> $DIR/lint-attr-everywhere-early.rs:54:13 | LL | #![deny(non_camel_case_types)] | ^^^^^^^^^^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:59:30 + --> $DIR/lint-attr-everywhere-early.rs:60:30 | LL | fn denied_from_inner() { unsafe {} } | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:57:13 + --> $DIR/lint-attr-everywhere-early.rs:58:13 | LL | #![deny(unsafe_code)] | ^^^^^^^^^^^ error: denote infinite loops with `loop { ... }` - --> $DIR/lint-attr-everywhere-early.rs:62:21 + --> $DIR/lint-attr-everywhere-early.rs:63:21 | LL | fn assoc_fn() { while true {} } | ^^^^^^^^^^ help: use `loop` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:61:12 + --> $DIR/lint-attr-everywhere-early.rs:62:12 | LL | #[deny(while_true)] | ^^^^^^^^^^ error: denote infinite loops with `loop { ... }` - --> $DIR/lint-attr-everywhere-early.rs:65:31 + --> $DIR/lint-attr-everywhere-early.rs:66:31 | LL | const ASSOC_CONST: i32 = {while true {} 1}; | ^^^^^^^^^^ help: use `loop` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:64:12 + --> $DIR/lint-attr-everywhere-early.rs:65:12 | LL | #[deny(while_true)] | ^^^^^^^^^^ error: associated type `assoc_type` should have an upper camel case name - --> $DIR/lint-attr-everywhere-early.rs:68:10 + --> $DIR/lint-attr-everywhere-early.rs:69:10 | LL | type assoc_type; | ^^^^^^^^^^ help: convert the identifier to upper camel case: `AssocType` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:67:12 + --> $DIR/lint-attr-everywhere-early.rs:68:12 | LL | #[deny(non_camel_case_types)] | ^^^^^^^^^^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:74:30 + --> $DIR/lint-attr-everywhere-early.rs:75:30 | LL | fn denied_from_inner() { unsafe {} } | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:72:13 + --> $DIR/lint-attr-everywhere-early.rs:73:13 | LL | #![deny(unsafe_code)] | ^^^^^^^^^^^ error: denote infinite loops with `loop { ... }` - --> $DIR/lint-attr-everywhere-early.rs:77:21 + --> $DIR/lint-attr-everywhere-early.rs:78:21 | LL | fn assoc_fn() { while true {} } | ^^^^^^^^^^ help: use `loop` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:76:12 + --> $DIR/lint-attr-everywhere-early.rs:77:12 | LL | #[deny(while_true)] | ^^^^^^^^^^ error: denote infinite loops with `loop { ... }` - --> $DIR/lint-attr-everywhere-early.rs:80:31 + --> $DIR/lint-attr-everywhere-early.rs:81:31 | LL | const ASSOC_CONST: i32 = {while true {} 1}; | ^^^^^^^^^^ help: use `loop` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:79:12 + --> $DIR/lint-attr-everywhere-early.rs:80:12 | LL | #[deny(while_true)] | ^^^^^^^^^^ error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:83:23 + --> $DIR/lint-attr-everywhere-early.rs:84:23 | LL | type assoc_type = (i32); | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:82:12 + --> $DIR/lint-attr-everywhere-early.rs:83:12 | LL | #[deny(unused_parens)] | ^^^^^^^^^^^^^ @@ -201,13 +201,13 @@ LL + type assoc_type = i32; | error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:87:31 + --> $DIR/lint-attr-everywhere-early.rs:88:31 | LL | #[deny(unused_parens)]f1: (i32), | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:87:12 + --> $DIR/lint-attr-everywhere-early.rs:88:12 | LL | #[deny(unused_parens)]f1: (i32), | ^^^^^^^^^^^^^ @@ -218,13 +218,13 @@ LL + #[deny(unused_parens)]f1: i32, | error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:89:42 + --> $DIR/lint-attr-everywhere-early.rs:90:42 | LL | struct StructTuple(#[deny(unused_parens)](i32)); | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:89:27 + --> $DIR/lint-attr-everywhere-early.rs:90:27 | LL | struct StructTuple(#[deny(unused_parens)](i32)); | ^^^^^^^^^^^^^ @@ -235,25 +235,25 @@ LL + struct StructTuple(#[deny(unused_parens)]i32); | error: variant `VARIANT_CAMEL` should have an upper camel case name - --> $DIR/lint-attr-everywhere-early.rs:93:5 + --> $DIR/lint-attr-everywhere-early.rs:94:5 | LL | VARIANT_CAMEL, | ^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `VariantCamel` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:92:12 + --> $DIR/lint-attr-everywhere-early.rs:93:12 | LL | #[deny(non_camel_case_types)] | ^^^^^^^^^^^^^^^^^^^^ error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:99:37 + --> $DIR/lint-attr-everywhere-early.rs:100:37 | LL | fn foreign_denied_from_inner(x: (i32)); | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:97:13 + --> $DIR/lint-attr-everywhere-early.rs:98:13 | LL | #![deny(unused_parens)] | ^^^^^^^^^^^^^ @@ -264,13 +264,13 @@ LL + fn foreign_denied_from_inner(x: i32); | error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:104:37 + --> $DIR/lint-attr-everywhere-early.rs:105:37 | LL | fn foreign_denied_from_outer(x: (i32)); | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:103:12 + --> $DIR/lint-attr-everywhere-early.rs:104:12 | LL | #[deny(unused_parens)] | ^^^^^^^^^^^^^ @@ -281,13 +281,13 @@ LL + fn foreign_denied_from_outer(x: i32); | error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:107:43 + --> $DIR/lint-attr-everywhere-early.rs:108:43 | LL | fn function(#[deny(unused_parens)] param: (i32)) {} | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:107:20 + --> $DIR/lint-attr-everywhere-early.rs:108:20 | LL | fn function(#[deny(unused_parens)] param: (i32)) {} | ^^^^^^^^^^^^^ @@ -298,25 +298,25 @@ LL + fn function(#[deny(unused_parens)] param: i32) {} | error: type parameter `foo` should have an upper camel case name - --> $DIR/lint-attr-everywhere-early.rs:109:42 + --> $DIR/lint-attr-everywhere-early.rs:110:42 | LL | fn generics<#[deny(non_camel_case_types)]foo>() {} | ^^^ help: convert the identifier to upper camel case (notice the capitalization): `Foo` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:109:20 + --> $DIR/lint-attr-everywhere-early.rs:110:20 | LL | fn generics<#[deny(non_camel_case_types)]foo>() {} | ^^^^^^^^^^^^^^^^^^^^ error: unnecessary parentheses around assigned value - --> $DIR/lint-attr-everywhere-early.rs:115:13 + --> $DIR/lint-attr-everywhere-early.rs:116:13 | LL | let x = (1); | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:114:12 + --> $DIR/lint-attr-everywhere-early.rs:115:12 | LL | #[deny(unused_parens)] | ^^^^^^^^^^^^^ @@ -327,13 +327,13 @@ LL + let x = 1; | error: unnecessary parentheses around type - --> $DIR/lint-attr-everywhere-early.rs:121:50 + --> $DIR/lint-attr-everywhere-early.rs:122:50 | LL | let closure = |#[deny(unused_parens)] param: (i32)| {}; | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:121:27 + --> $DIR/lint-attr-everywhere-early.rs:122:27 | LL | let closure = |#[deny(unused_parens)] param: (i32)| {}; | ^^^^^^^^^^^^^ @@ -344,13 +344,13 @@ LL + let closure = |#[deny(unused_parens)] param: i32| {}; | error: unnecessary parentheses around block return value - --> $DIR/lint-attr-everywhere-early.rs:125:46 + --> $DIR/lint-attr-everywhere-early.rs:126:46 | LL | let f = Match{#[deny(unused_parens)]f1: {(123)}}; | ^ ^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:125:26 + --> $DIR/lint-attr-everywhere-early.rs:126:26 | LL | let f = Match{#[deny(unused_parens)]f1: {(123)}}; | ^^^^^^^^^^^^^ @@ -361,31 +361,31 @@ LL + let f = Match{#[deny(unused_parens)]f1: {123}}; | error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:132:13 + --> $DIR/lint-attr-everywhere-early.rs:133:13 | LL | unsafe {} | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:128:17 + --> $DIR/lint-attr-everywhere-early.rs:129:17 | LL | #![deny(unsafe_code)] | ^^^^^^^^^^^ error: denote infinite loops with `loop { ... }` - --> $DIR/lint-attr-everywhere-early.rs:133:13 + --> $DIR/lint-attr-everywhere-early.rs:134:13 | LL | while true {} | ^^^^^^^^^^ help: use `loop` | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:130:16 + --> $DIR/lint-attr-everywhere-early.rs:131:16 | LL | #[deny(while_true)] | ^^^^^^^^^^ error: `...` range patterns are deprecated - --> $DIR/lint-attr-everywhere-early.rs:139:20 + --> $DIR/lint-attr-everywhere-early.rs:140:20 | LL | Match{f1: 0...100} => {} | ^^^ help: use `..=` for an inclusive range @@ -393,97 +393,97 @@ LL | Match{f1: 0...100} => {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:138:16 + --> $DIR/lint-attr-everywhere-early.rs:139:16 | LL | #[deny(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:148:9 + --> $DIR/lint-attr-everywhere-early.rs:149:9 | LL | unsafe {} | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:147:17 + --> $DIR/lint-attr-everywhere-early.rs:148:17 | LL | #![deny(unsafe_code)] | ^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:152:9 + --> $DIR/lint-attr-everywhere-early.rs:153:9 | LL | unsafe {} | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:151:16 + --> $DIR/lint-attr-everywhere-early.rs:152:16 | LL | #[deny(unsafe_code)] | ^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:157:5 + --> $DIR/lint-attr-everywhere-early.rs:158:5 | LL | unsafe {}; | ^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:156:12 + --> $DIR/lint-attr-everywhere-early.rs:157:12 | LL | #[deny(unsafe_code)] | ^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:159:27 + --> $DIR/lint-attr-everywhere-early.rs:160:27 | LL | [#[deny(unsafe_code)] unsafe {123}]; | ^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:159:13 + --> $DIR/lint-attr-everywhere-early.rs:160:13 | LL | [#[deny(unsafe_code)] unsafe {123}]; | ^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:160:27 + --> $DIR/lint-attr-everywhere-early.rs:161:27 | LL | (#[deny(unsafe_code)] unsafe {123},); | ^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:160:13 + --> $DIR/lint-attr-everywhere-early.rs:161:13 | LL | (#[deny(unsafe_code)] unsafe {123},); | ^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:162:31 + --> $DIR/lint-attr-everywhere-early.rs:163:31 | LL | call(#[deny(unsafe_code)] unsafe {123}); | ^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:162:17 + --> $DIR/lint-attr-everywhere-early.rs:163:17 | LL | call(#[deny(unsafe_code)] unsafe {123}); | ^^^^^^^^^^^ error: usage of an `unsafe` block - --> $DIR/lint-attr-everywhere-early.rs:164:38 + --> $DIR/lint-attr-everywhere-early.rs:165:38 | LL | TupleStruct(#[deny(unsafe_code)] unsafe {123}); | ^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:164:24 + --> $DIR/lint-attr-everywhere-early.rs:165:24 | LL | TupleStruct(#[deny(unsafe_code)] unsafe {123}); | ^^^^^^^^^^^ error: `...` range patterns are deprecated - --> $DIR/lint-attr-everywhere-early.rs:175:18 + --> $DIR/lint-attr-everywhere-early.rs:176:18 | LL | f1: 0...100, | ^^^ help: use `..=` for an inclusive range @@ -491,7 +491,7 @@ LL | f1: 0...100, = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/lint-attr-everywhere-early.rs:174:20 + --> $DIR/lint-attr-everywhere-early.rs:175:20 | LL | #[deny(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/use_suggestion_json.rs b/tests/ui/lint/use_suggestion_json.rs index 1a797c71bf4bb..7bb92409b6629 100644 --- a/tests/ui/lint/use_suggestion_json.rs +++ b/tests/ui/lint/use_suggestion_json.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ ignore-windows //@ ignore-sgx std::os::fortanix_sgx::usercalls::alloc::Iter changes compiler suggestions //@ compile-flags: --error-format pretty-json --json=diagnostic-rendered-ansi -Z unstable-options diff --git a/tests/ui/lint/use_suggestion_json.stderr b/tests/ui/lint/use_suggestion_json.stderr index 558c2260fcede..0a7cba2cb1888 100644 --- a/tests/ui/lint/use_suggestion_json.stderr +++ b/tests/ui/lint/use_suggestion_json.stderr @@ -73,10 +73,10 @@ mod foo { "spans": [ { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 564, - "byte_end": 568, - "line_start": 12, - "line_end": 12, + "byte_start": 581, + "byte_end": 585, + "line_start": 13, + "line_end": 13, "column_start": 12, "column_end": 16, "is_primary": true, @@ -101,10 +101,10 @@ mod foo { "spans": [ { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -124,10 +124,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -147,10 +147,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -170,10 +170,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -193,10 +193,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -216,10 +216,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -239,10 +239,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -262,10 +262,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -285,10 +285,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -308,10 +308,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -331,10 +331,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -354,10 +354,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -377,10 +377,10 @@ mod foo { }, { "file_name": "$DIR/use_suggestion_json.rs", - "byte_start": 541, - "byte_end": 541, - "line_start": 11, - "line_end": 11, + "byte_start": 558, + "byte_end": 558, + "line_start": 12, + "line_end": 12, "column_start": 1, "column_end": 1, "is_primary": true, @@ -404,7 +404,7 @@ mod foo { } ], "rendered": "\u001b[0m\u001b[1m\u001b[38;5;9merror[E0412]\u001b[0m\u001b[0m\u001b[1m: cannot find type `Iter` in this scope\u001b[0m -\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m$DIR/use_suggestion_json.rs:12:12\u001b[0m +\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m$DIR/use_suggestion_json.rs:13:12\u001b[0m \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m \u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m let x: Iter;\u001b[0m \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m diff --git a/tests/ui/macros/auxiliary/issue-100199.rs b/tests/ui/macros/auxiliary/issue-100199.rs index f05c4f0722cfb..111b2971d13f2 100644 --- a/tests/ui/macros/auxiliary/issue-100199.rs +++ b/tests/ui/macros/auxiliary/issue-100199.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/macros/issue-100199.rs b/tests/ui/macros/issue-100199.rs index 78a6ff149e2aa..5821232d915b1 100644 --- a/tests/ui/macros/issue-100199.rs +++ b/tests/ui/macros/issue-100199.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #[issue_100199::struct_with_bound] //~ ERROR cannot find trait `MyTrait` in the crate root struct Foo {} // The above must be on the first line so that it's span points to pos 0. diff --git a/tests/ui/macros/issue-100199.stderr b/tests/ui/macros/issue-100199.stderr index 89c634ce4f0b5..eaaa5499d906b 100644 --- a/tests/ui/macros/issue-100199.stderr +++ b/tests/ui/macros/issue-100199.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `MyTrait` in the crate root - --> $DIR/issue-100199.rs:1:1 + --> $DIR/issue-100199.rs:2:1 | LL | #[issue_100199::struct_with_bound] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root diff --git a/tests/ui/macros/macro-comma-support-rpass.rs b/tests/ui/macros/macro-comma-support-rpass.rs index ef6c1ff6fd061..fcb2a4facc23b 100644 --- a/tests/ui/macros/macro-comma-support-rpass.rs +++ b/tests/ui/macros/macro-comma-support-rpass.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-pass // This is meant to be a comprehensive test of invocations with/without // trailing commas (or other, similar optionally-trailing separators). diff --git a/tests/ui/macros/macro-or-patterns-back-compat.fixed b/tests/ui/macros/macro-or-patterns-back-compat.fixed index c16190c399aef..5ff249ee17492 100644 --- a/tests/ui/macros/macro-or-patterns-back-compat.fixed +++ b/tests/ui/macros/macro-or-patterns-back-compat.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix //@ aux-build:or-pattern.rs diff --git a/tests/ui/macros/macro-or-patterns-back-compat.rs b/tests/ui/macros/macro-or-patterns-back-compat.rs index ef0ffb99c1a62..1c7beaeed7751 100644 --- a/tests/ui/macros/macro-or-patterns-back-compat.rs +++ b/tests/ui/macros/macro-or-patterns-back-compat.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix //@ aux-build:or-pattern.rs diff --git a/tests/ui/macros/macro-or-patterns-back-compat.stderr b/tests/ui/macros/macro-or-patterns-back-compat.stderr index 67794f0a8b233..3718bcb4c8cc4 100644 --- a/tests/ui/macros/macro-or-patterns-back-compat.stderr +++ b/tests/ui/macros/macro-or-patterns-back-compat.stderr @@ -1,5 +1,5 @@ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:10:21 + --> $DIR/macro-or-patterns-back-compat.rs:11:21 | LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` @@ -7,13 +7,13 @@ LL | macro_rules! foo { ($x:pat | $y:pat) => {} } = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/macro-or-patterns-back-compat.rs:4:9 + --> $DIR/macro-or-patterns-back-compat.rs:5:9 | LL | #![deny(rust_2021_incompatible_or_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:13:23 + --> $DIR/macro-or-patterns-back-compat.rs:14:23 | LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` @@ -22,7 +22,7 @@ LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } = note: for more information, see error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:19:21 + --> $DIR/macro-or-patterns-back-compat.rs:20:21 | LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` @@ -31,7 +31,7 @@ LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } = note: for more information, see error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:23:26 + --> $DIR/macro-or-patterns-back-compat.rs:24:26 | LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { | ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param` diff --git a/tests/ui/macros/macro-outer-attributes.rs b/tests/ui/macros/macro-outer-attributes.rs index 5b41cf9fd29d6..efd06591e5ee2 100644 --- a/tests/ui/macros/macro-outer-attributes.rs +++ b/tests/ui/macros/macro-outer-attributes.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(rustc_attrs)] macro_rules! test { ($nm:ident, diff --git a/tests/ui/macros/macro-outer-attributes.stderr b/tests/ui/macros/macro-outer-attributes.stderr index 4696bb774e304..52bde019c95fd 100644 --- a/tests/ui/macros/macro-outer-attributes.stderr +++ b/tests/ui/macros/macro-outer-attributes.stderr @@ -1,11 +1,11 @@ error[E0425]: cannot find function `bar` in module `a` - --> $DIR/macro-outer-attributes.rs:18:8 + --> $DIR/macro-outer-attributes.rs:19:8 | LL | a::bar(); | ^^^ not found in `a` | note: found an item that was configured out - --> $DIR/macro-outer-attributes.rs:9:14 + --> $DIR/macro-outer-attributes.rs:10:14 | LL | #[cfg(false)], | ----- the item is gated here diff --git a/tests/ui/macros/macro-path-prelude-shadowing.rs b/tests/ui/macros/macro-path-prelude-shadowing.rs index f18d4db3ad4b1..cbcff6ee46bd9 100644 --- a/tests/ui/macros/macro-path-prelude-shadowing.rs +++ b/tests/ui/macros/macro-path-prelude-shadowing.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:macro-in-other-crate.rs #![feature(decl_macro)] diff --git a/tests/ui/macros/macro-path-prelude-shadowing.stderr b/tests/ui/macros/macro-path-prelude-shadowing.stderr index e719c397ff212..d7c091393c9c7 100644 --- a/tests/ui/macros/macro-path-prelude-shadowing.stderr +++ b/tests/ui/macros/macro-path-prelude-shadowing.stderr @@ -1,5 +1,5 @@ error[E0659]: `std` is ambiguous - --> $DIR/macro-path-prelude-shadowing.rs:29:9 + --> $DIR/macro-path-prelude-shadowing.rs:30:9 | LL | std::panic!(); | ^^^ ambiguous name @@ -7,7 +7,7 @@ LL | std::panic!(); = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution = note: `std` could refer to a built-in crate note: `std` could also refer to the module imported here - --> $DIR/macro-path-prelude-shadowing.rs:27:9 + --> $DIR/macro-path-prelude-shadowing.rs:28:9 | LL | use m2::*; // glob-import user-defined `std` | ^^^^^ diff --git a/tests/ui/macros/macro-rules-attr.rs b/tests/ui/macros/macro-rules-attr.rs index 1d6f09b53e1a5..102d18426dd6b 100644 --- a/tests/ui/macros/macro-rules-attr.rs +++ b/tests/ui/macros/macro-rules-attr.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass //@ check-run-results #![feature(macro_attr)] diff --git a/tests/ui/macros/macro-rules-attr.stderr b/tests/ui/macros/macro-rules-attr.stderr index 567664cd73d32..54b400e2c911b 100644 --- a/tests/ui/macros/macro-rules-attr.stderr +++ b/tests/ui/macros/macro-rules-attr.stderr @@ -1,18 +1,18 @@ warning: rule #3 of macro `local_attr` is never used - --> $DIR/macro-rules-attr.rs:43:9 + --> $DIR/macro-rules-attr.rs:44:9 | LL | attr() {} => { | ^^ ^^ | note: the lint level is defined here - --> $DIR/macro-rules-attr.rs:4:9 + --> $DIR/macro-rules-attr.rs:5:9 | LL | #![warn(unused)] | ^^^^^^ = note: `#[warn(unused_macro_rules)]` implied by `#[warn(unused)]` warning: rule #5 of macro `local_attr` is never used - --> $DIR/macro-rules-attr.rs:49:5 + --> $DIR/macro-rules-attr.rs:50:5 | LL | {} => { | ^^ diff --git a/tests/ui/macros/meta-item-absolute-path.rs b/tests/ui/macros/meta-item-absolute-path.rs index 8ed911cbca718..e677016cff82e 100644 --- a/tests/ui/macros/meta-item-absolute-path.rs +++ b/tests/ui/macros/meta-item-absolute-path.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #[derive(::Absolute)] //~ ERROR failed to resolve //~| ERROR failed to resolve struct S; diff --git a/tests/ui/macros/meta-item-absolute-path.stderr b/tests/ui/macros/meta-item-absolute-path.stderr index 8fa5e97899ca2..93c442036ce26 100644 --- a/tests/ui/macros/meta-item-absolute-path.stderr +++ b/tests/ui/macros/meta-item-absolute-path.stderr @@ -1,11 +1,11 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute` - --> $DIR/meta-item-absolute-path.rs:1:12 + --> $DIR/meta-item-absolute-path.rs:2:12 | LL | #[derive(::Absolute)] | ^^^^^^^^ use of unresolved module or unlinked crate `Absolute` error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute` - --> $DIR/meta-item-absolute-path.rs:1:12 + --> $DIR/meta-item-absolute-path.rs:2:12 | LL | #[derive(::Absolute)] | ^^^^^^^^ use of unresolved module or unlinked crate `Absolute` diff --git a/tests/ui/macros/no-std-macros.rs b/tests/ui/macros/no-std-macros.rs index be0f5921598a7..25f5d84d180d9 100644 --- a/tests/ui/macros/no-std-macros.rs +++ b/tests/ui/macros/no-std-macros.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ compile-flags: --crate-type=lib //@ check-pass // issue #55482 diff --git a/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.rs b/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.rs index 8363ec1b3fb54..b48a5bb16e973 100644 --- a/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.rs +++ b/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Regression test for . mod module { diff --git a/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.stderr b/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.stderr index 433cab9cf9e4f..4a8aa61d8bd4a 100644 --- a/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.stderr +++ b/tests/ui/methods/rigid-alias-bound-is-not-inherent-2.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `method` found for type parameter `impl Deref` in the current scope - --> $DIR/rigid-alias-bound-is-not-inherent-2.rs:13:7 + --> $DIR/rigid-alias-bound-is-not-inherent-2.rs:14:7 | LL | fn foo(x: impl Deref) { | --------------------------------- method `method` not found for this type parameter diff --git a/tests/ui/mir/var_debug_ref.rs b/tests/ui/mir/var_debug_ref.rs index 1dcf38b5bb9f7..1cce8fa09ee5a 100644 --- a/tests/ui/mir/var_debug_ref.rs +++ b/tests/ui/mir/var_debug_ref.rs @@ -20,5 +20,5 @@ mod detail { fn main() { // SingleUseConsts represents "x" using VarDebugInfoContents::Const. // It is the only reference to `f` remaining. - let x = <() as ::Fun>::FUN; + let x = <() as Fun>::FUN; } diff --git a/tests/ui/namespace/auxiliary/namespace-mix.rs b/tests/ui/namespace/auxiliary/namespace-mix.rs index fb39d29f87fc4..60e015a2fce45 100644 --- a/tests/ui/namespace/auxiliary/namespace-mix.rs +++ b/tests/ui/namespace/auxiliary/namespace-mix.rs @@ -1,3 +1,5 @@ +//@ edition:2015 + pub mod c { pub struct S {} pub struct TS(); diff --git a/tests/ui/namespace/namespace-mix.rs b/tests/ui/namespace/namespace-mix.rs index 44790b83d6e82..a640a38d7f6cb 100644 --- a/tests/ui/namespace/namespace-mix.rs +++ b/tests/ui/namespace/namespace-mix.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:namespace-mix.rs extern crate namespace_mix; diff --git a/tests/ui/namespace/namespace-mix.stderr b/tests/ui/namespace/namespace-mix.stderr index 7c889f34e91af..78866b4916061 100644 --- a/tests/ui/namespace/namespace-mix.stderr +++ b/tests/ui/namespace/namespace-mix.stderr @@ -1,5 +1,5 @@ error[E0423]: expected value, found type alias `m1::S` - --> $DIR/namespace-mix.rs:34:11 + --> $DIR/namespace-mix.rs:35:11 | LL | pub struct TS(); | ---------------- similarly named tuple struct `TS` defined here @@ -24,12 +24,12 @@ LL + check(S); | error[E0423]: expected value, found type alias `xm1::S` - --> $DIR/namespace-mix.rs:40:11 + --> $DIR/namespace-mix.rs:41:11 | LL | check(xm1::S); | ^^^^^^ | - ::: $DIR/auxiliary/namespace-mix.rs:3:5 + ::: $DIR/auxiliary/namespace-mix.rs:5:5 | LL | pub struct TS(); | ------------- similarly named tuple struct `TS` defined here @@ -51,7 +51,7 @@ LL + check(S); | error[E0423]: expected value, found type alias `m7::V` - --> $DIR/namespace-mix.rs:100:11 + --> $DIR/namespace-mix.rs:101:11 | LL | TV(), | ---- similarly named tuple variant `TV` defined here @@ -76,12 +76,12 @@ LL + check(V); | error[E0423]: expected value, found type alias `xm7::V` - --> $DIR/namespace-mix.rs:106:11 + --> $DIR/namespace-mix.rs:107:11 | LL | check(xm7::V); | ^^^^^^ | - ::: $DIR/auxiliary/namespace-mix.rs:7:9 + ::: $DIR/auxiliary/namespace-mix.rs:9:9 | LL | TV(), | -- similarly named tuple variant `TV` defined here @@ -103,7 +103,7 @@ LL + check(V); | error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:33:11 + --> $DIR/namespace-mix.rs:34:11 | LL | check(m1::S{}); | ----- ^^^^^^^ unsatisfied trait bound @@ -111,23 +111,23 @@ LL | check(m1::S{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::S: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:35:11 + --> $DIR/namespace-mix.rs:36:11 | LL | check(m2::S{}); | ----- ^^^^^^^ unsatisfied trait bound @@ -135,23 +135,23 @@ LL | check(m2::S{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::S` - --> $DIR/namespace-mix.rs:7:5 + --> $DIR/namespace-mix.rs:8:5 | LL | pub struct S {} | ^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:36:11 + --> $DIR/namespace-mix.rs:37:11 | LL | check(m2::S); | ----- ^^^^^ unsatisfied trait bound @@ -159,23 +159,23 @@ LL | check(m2::S); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:39:11 + --> $DIR/namespace-mix.rs:40:11 | LL | check(xm1::S{}); | ----- ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -183,18 +183,18 @@ LL | check(xm1::S{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::S: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:41:11 + --> $DIR/namespace-mix.rs:42:11 | LL | check(xm2::S{}); | ----- ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::S` @@ -202,18 +202,18 @@ LL | check(xm2::S{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:42:11 + --> $DIR/namespace-mix.rs:43:11 | LL | check(xm2::S); | ----- ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -221,18 +221,18 @@ LL | check(xm2::S); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:55:11 + --> $DIR/namespace-mix.rs:56:11 | LL | check(m3::TS{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -240,23 +240,23 @@ LL | check(m3::TS{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:56:11 + --> $DIR/namespace-mix.rs:57:11 | LL | check(m3::TS); | ----- ^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> c::TS {c::TS}` @@ -264,18 +264,18 @@ LL | check(m3::TS); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::TS: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:57:11 + --> $DIR/namespace-mix.rs:58:11 | LL | check(m4::TS{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -283,23 +283,23 @@ LL | check(m4::TS{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::TS` - --> $DIR/namespace-mix.rs:8:5 + --> $DIR/namespace-mix.rs:9:5 | LL | pub struct TS(); | ^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:58:11 + --> $DIR/namespace-mix.rs:59:11 | LL | check(m4::TS); | ----- ^^^^^^ unsatisfied trait bound @@ -307,23 +307,23 @@ LL | check(m4::TS); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:61:11 + --> $DIR/namespace-mix.rs:62:11 | LL | check(xm3::TS{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -331,18 +331,18 @@ LL | check(xm3::TS{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:62:11 + --> $DIR/namespace-mix.rs:63:11 | LL | check(xm3::TS); | ----- ^^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}` @@ -350,18 +350,18 @@ LL | check(xm3::TS); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::TS: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:63:11 + --> $DIR/namespace-mix.rs:64:11 | LL | check(xm4::TS{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::TS` @@ -369,18 +369,18 @@ LL | check(xm4::TS{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:64:11 + --> $DIR/namespace-mix.rs:65:11 | LL | check(xm4::TS); | ----- ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -388,18 +388,18 @@ LL | check(xm4::TS); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:77:11 + --> $DIR/namespace-mix.rs:78:11 | LL | check(m5::US{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -407,23 +407,23 @@ LL | check(m5::US{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::US: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:78:11 + --> $DIR/namespace-mix.rs:79:11 | LL | check(m5::US); | ----- ^^^^^^ unsatisfied trait bound @@ -431,23 +431,23 @@ LL | check(m5::US); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::US` - --> $DIR/namespace-mix.rs:9:5 + --> $DIR/namespace-mix.rs:10:5 | LL | pub struct US; | ^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::US: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:79:11 + --> $DIR/namespace-mix.rs:80:11 | LL | check(m6::US{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -455,23 +455,23 @@ LL | check(m6::US{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::US` - --> $DIR/namespace-mix.rs:9:5 + --> $DIR/namespace-mix.rs:10:5 | LL | pub struct US; | ^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:80:11 + --> $DIR/namespace-mix.rs:81:11 | LL | check(m6::US); | ----- ^^^^^^ unsatisfied trait bound @@ -479,23 +479,23 @@ LL | check(m6::US); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:83:11 + --> $DIR/namespace-mix.rs:84:11 | LL | check(xm5::US{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -503,18 +503,18 @@ LL | check(xm5::US{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:84:11 + --> $DIR/namespace-mix.rs:85:11 | LL | check(xm5::US); | ----- ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US` @@ -522,18 +522,18 @@ LL | check(xm5::US); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:85:11 + --> $DIR/namespace-mix.rs:86:11 | LL | check(xm6::US{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US` @@ -541,18 +541,18 @@ LL | check(xm6::US{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:86:11 + --> $DIR/namespace-mix.rs:87:11 | LL | check(xm6::US); | ----- ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -560,18 +560,18 @@ LL | check(xm6::US); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:99:11 + --> $DIR/namespace-mix.rs:100:11 | LL | check(m7::V{}); | ----- ^^^^^^^ unsatisfied trait bound @@ -579,23 +579,23 @@ LL | check(m7::V{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:101:11 + --> $DIR/namespace-mix.rs:102:11 | LL | check(m8::V{}); | ----- ^^^^^^^ unsatisfied trait bound @@ -603,23 +603,23 @@ LL | check(m8::V{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::E` - --> $DIR/namespace-mix.rs:10:5 + --> $DIR/namespace-mix.rs:11:5 | LL | pub enum E { | ^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:102:11 + --> $DIR/namespace-mix.rs:103:11 | LL | check(m8::V); | ----- ^^^^^ unsatisfied trait bound @@ -627,23 +627,23 @@ LL | check(m8::V); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:105:11 + --> $DIR/namespace-mix.rs:106:11 | LL | check(xm7::V{}); | ----- ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -651,18 +651,18 @@ LL | check(xm7::V{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:107:11 + --> $DIR/namespace-mix.rs:108:11 | LL | check(xm8::V{}); | ----- ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -670,18 +670,18 @@ LL | check(xm8::V{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:108:11 + --> $DIR/namespace-mix.rs:109:11 | LL | check(xm8::V); | ----- ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -689,18 +689,18 @@ LL | check(xm8::V); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:121:11 + --> $DIR/namespace-mix.rs:122:11 | LL | check(m9::TV{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -708,23 +708,23 @@ LL | check(m9::TV{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:122:11 + --> $DIR/namespace-mix.rs:123:11 | LL | check(m9::TV); | ----- ^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> c::E {c::E::TV}` @@ -732,18 +732,18 @@ LL | check(m9::TV); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:123:11 + --> $DIR/namespace-mix.rs:124:11 | LL | check(mA::TV{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -751,23 +751,23 @@ LL | check(mA::TV{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::E` - --> $DIR/namespace-mix.rs:10:5 + --> $DIR/namespace-mix.rs:11:5 | LL | pub enum E { | ^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:124:11 + --> $DIR/namespace-mix.rs:125:11 | LL | check(mA::TV); | ----- ^^^^^^ unsatisfied trait bound @@ -775,23 +775,23 @@ LL | check(mA::TV); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:127:11 + --> $DIR/namespace-mix.rs:128:11 | LL | check(xm9::TV{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -799,18 +799,18 @@ LL | check(xm9::TV{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:128:11 + --> $DIR/namespace-mix.rs:129:11 | LL | check(xm9::TV); | ----- ^^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}` @@ -818,18 +818,18 @@ LL | check(xm9::TV); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:129:11 + --> $DIR/namespace-mix.rs:130:11 | LL | check(xmA::TV{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -837,18 +837,18 @@ LL | check(xmA::TV{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:130:11 + --> $DIR/namespace-mix.rs:131:11 | LL | check(xmA::TV); | ----- ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -856,18 +856,18 @@ LL | check(xmA::TV); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:143:11 + --> $DIR/namespace-mix.rs:144:11 | LL | check(mB::UV{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -875,23 +875,23 @@ LL | check(mB::UV{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:144:11 + --> $DIR/namespace-mix.rs:145:11 | LL | check(mB::UV); | ----- ^^^^^^ unsatisfied trait bound @@ -899,23 +899,23 @@ LL | check(mB::UV); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::E` - --> $DIR/namespace-mix.rs:10:5 + --> $DIR/namespace-mix.rs:11:5 | LL | pub enum E { | ^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:145:11 + --> $DIR/namespace-mix.rs:146:11 | LL | check(mC::UV{}); | ----- ^^^^^^^^ unsatisfied trait bound @@ -923,23 +923,23 @@ LL | check(mC::UV{}); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::E` - --> $DIR/namespace-mix.rs:10:5 + --> $DIR/namespace-mix.rs:11:5 | LL | pub enum E { | ^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:146:11 + --> $DIR/namespace-mix.rs:147:11 | LL | check(mC::UV); | ----- ^^^^^^ unsatisfied trait bound @@ -947,23 +947,23 @@ LL | check(mC::UV); | required by a bound introduced by this call | help: the trait `Impossible` is not implemented for `c::Item` - --> $DIR/namespace-mix.rs:16:5 + --> $DIR/namespace-mix.rs:17:5 | LL | pub struct Item; | ^^^^^^^^^^^^^^^ help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:149:11 + --> $DIR/namespace-mix.rs:150:11 | LL | check(xmB::UV{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -971,18 +971,18 @@ LL | check(xmB::UV{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:150:11 + --> $DIR/namespace-mix.rs:151:11 | LL | check(xmB::UV); | ----- ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -990,18 +990,18 @@ LL | check(xmB::UV); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:151:11 + --> $DIR/namespace-mix.rs:152:11 | LL | check(xmC::UV{}); | ----- ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -1009,18 +1009,18 @@ LL | check(xmC::UV{}); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied - --> $DIR/namespace-mix.rs:152:11 + --> $DIR/namespace-mix.rs:153:11 | LL | check(xmC::UV); | ----- ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -1028,12 +1028,12 @@ LL | check(xmC::UV); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/namespace-mix.rs:20:1 + --> $DIR/namespace-mix.rs:21:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `check` - --> $DIR/namespace-mix.rs:21:13 + --> $DIR/namespace-mix.rs:22:13 | LL | fn check(_: T) {} | ^^^^^^^^^^ required by this bound in `check` diff --git a/tests/ui/offset-of/offset-of-enum.rs b/tests/ui/offset-of/offset-of-enum.rs index 64850e4782335..10f1353ac31f6 100644 --- a/tests/ui/offset-of/offset-of-enum.rs +++ b/tests/ui/offset-of/offset-of-enum.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(offset_of_enum)] use std::mem::offset_of; diff --git a/tests/ui/offset-of/offset-of-enum.stderr b/tests/ui/offset-of/offset-of-enum.stderr index 7e7ad41f5b6a9..362296a22e8fe 100644 --- a/tests/ui/offset-of/offset-of-enum.stderr +++ b/tests/ui/offset-of/offset-of-enum.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `Alpha::One` - --> $DIR/offset-of-enum.rs:11:16 + --> $DIR/offset-of-enum.rs:12:16 | LL | offset_of!(Alpha::One, 0); | ^^^^^^^^^^ @@ -8,19 +8,19 @@ LL | offset_of!(Alpha::One, 0); | help: try using the variant's enum: `Alpha` error[E0412]: cannot find type `Beta` in this scope - --> $DIR/offset-of-enum.rs:17:16 + --> $DIR/offset-of-enum.rs:18:16 | LL | offset_of!(Beta, One); | ^^^^ not found in this scope error[E0795]: `One` is an enum variant; expected field at end of `offset_of` - --> $DIR/offset-of-enum.rs:12:23 + --> $DIR/offset-of-enum.rs:13:23 | LL | offset_of!(Alpha, One); | ^^^ enum variant error[E0609]: no field named `1` on enum variant `Alpha::Two` - --> $DIR/offset-of-enum.rs:14:23 + --> $DIR/offset-of-enum.rs:15:23 | LL | offset_of!(Alpha, Two.1); | ^^^ - ...does not have this field @@ -28,7 +28,7 @@ LL | offset_of!(Alpha, Two.1); | this enum variant... error[E0609]: no field named `foo` on enum variant `Alpha::Two` - --> $DIR/offset-of-enum.rs:15:23 + --> $DIR/offset-of-enum.rs:16:23 | LL | offset_of!(Alpha, Two.foo); | ^^^ --- ...does not have this field @@ -36,7 +36,7 @@ LL | offset_of!(Alpha, Two.foo); | this enum variant... error[E0599]: no variant named `NonExistent` found for enum `Alpha` - --> $DIR/offset-of-enum.rs:16:23 + --> $DIR/offset-of-enum.rs:17:23 | LL | offset_of!(Alpha, NonExistent); | ^^^^^^^^^^^ variant not found diff --git a/tests/ui/offset-of/offset-of-self.rs b/tests/ui/offset-of/offset-of-self.rs index 0a6de2ebbb356..6156f719fb2c9 100644 --- a/tests/ui/offset-of/offset-of-self.rs +++ b/tests/ui/offset-of/offset-of-self.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use std::mem::offset_of; struct C { diff --git a/tests/ui/offset-of/offset-of-self.stderr b/tests/ui/offset-of/offset-of-self.stderr index 5bbb4ecf091a7..57afb6b9282ea 100644 --- a/tests/ui/offset-of/offset-of-self.stderr +++ b/tests/ui/offset-of/offset-of-self.stderr @@ -1,11 +1,11 @@ error: offset_of expects dot-separated field and variant names - --> $DIR/offset-of-self.rs:18:26 + --> $DIR/offset-of-self.rs:19:26 | LL | offset_of!(Self, Self::v); | ^^^^^^^ error[E0412]: cannot find type `S` in module `self` - --> $DIR/offset-of-self.rs:32:26 + --> $DIR/offset-of-self.rs:33:26 | LL | offset_of!(self::S, v); | ^ not found in `self` @@ -21,7 +21,7 @@ LL + offset_of!(S, v); | error[E0411]: cannot find type `Self` in this scope - --> $DIR/offset-of-self.rs:49:16 + --> $DIR/offset-of-self.rs:50:16 | LL | fn main() { | ---- `Self` not allowed in a function @@ -30,7 +30,7 @@ LL | offset_of!(Self, v); | ^^^^ `Self` is only available in impls, traits, and type definitions error[E0609]: no field `Self` on type `S` - --> $DIR/offset-of-self.rs:19:23 + --> $DIR/offset-of-self.rs:20:23 | LL | offset_of!(S, Self); | ^^^^ @@ -38,13 +38,13 @@ LL | offset_of!(S, Self); = note: available fields are: `v`, `w` error[E0616]: field `v` of struct `T` is private - --> $DIR/offset-of-self.rs:38:30 + --> $DIR/offset-of-self.rs:39:30 | LL | offset_of!(Self, v) | ^ private field error[E0609]: no field `self` on type `S` - --> $DIR/offset-of-self.rs:51:19 + --> $DIR/offset-of-self.rs:52:19 | LL | offset_of!(S, self); | ^^^^ @@ -52,7 +52,7 @@ LL | offset_of!(S, self); = note: available fields are: `v`, `w` error[E0609]: no field `self` on type `u8` - --> $DIR/offset-of-self.rs:52:21 + --> $DIR/offset-of-self.rs:53:21 | LL | offset_of!(S, v.self); | ^^^^ diff --git a/tests/ui/panic-handler/weak-lang-item.rs b/tests/ui/panic-handler/weak-lang-item.rs index cc5ccb75104be..a8f7aadf6c722 100644 --- a/tests/ui/panic-handler/weak-lang-item.rs +++ b/tests/ui/panic-handler/weak-lang-item.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:weak-lang-items.rs //@ needs-unwind since it affects the error output //@ ignore-emscripten missing eh_catch_typeinfo lang item diff --git a/tests/ui/panic-handler/weak-lang-item.stderr b/tests/ui/panic-handler/weak-lang-item.stderr index 5acd3e3187051..eb5f4ad56ea31 100644 --- a/tests/ui/panic-handler/weak-lang-item.stderr +++ b/tests/ui/panic-handler/weak-lang-item.stderr @@ -1,5 +1,5 @@ error[E0259]: the name `core` is defined multiple times - --> $DIR/weak-lang-item.rs:7:1 + --> $DIR/weak-lang-item.rs:8:1 | LL | extern crate core; | ^^^^^^^^^^^^^^^^^^ `core` reimported here diff --git a/tests/ui/parallel-rustc/unexpected-type-issue-120601.rs b/tests/ui/parallel-rustc/unexpected-type-issue-120601.rs index 2e215aa301aec..c8eaf8284a38e 100644 --- a/tests/ui/parallel-rustc/unexpected-type-issue-120601.rs +++ b/tests/ui/parallel-rustc/unexpected-type-issue-120601.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Test for #120601, which causes an ice bug cause of unexpected type // //@ compile-flags: -Z threads=40 diff --git a/tests/ui/parallel-rustc/unexpected-type-issue-120601.stderr b/tests/ui/parallel-rustc/unexpected-type-issue-120601.stderr index ed563bb0c4e0c..da225ad82bc7b 100644 --- a/tests/ui/parallel-rustc/unexpected-type-issue-120601.stderr +++ b/tests/ui/parallel-rustc/unexpected-type-issue-120601.stderr @@ -1,5 +1,4 @@ error[E0670]: `async fn` is not permitted in Rust 2015 - --> $DIR/unexpected-type-issue-120601.rs:9:1 | LL | async fn foo() -> Result<(), ()> { | ^^^^^ to use `async fn`, switch to Rust 2018 or later @@ -8,7 +7,6 @@ LL | async fn foo() -> Result<(), ()> { = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 - --> $DIR/unexpected-type-issue-120601.rs:15:1 | LL | async fn tuple() -> Tuple { | ^^^^^ to use `async fn`, switch to Rust 2018 or later @@ -17,7 +15,6 @@ LL | async fn tuple() -> Tuple { = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 - --> $DIR/unexpected-type-issue-120601.rs:20:1 | LL | async fn match_() { | ^^^^^ to use `async fn`, switch to Rust 2018 or later @@ -26,13 +23,11 @@ LL | async fn match_() { = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0425]: cannot find function, tuple struct or tuple variant `Unstable2` in this scope - --> $DIR/unexpected-type-issue-120601.rs:10:5 | LL | Unstable2(()) | ^^^^^^^^^ not found in this scope error[E0308]: mismatched types - --> $DIR/unexpected-type-issue-120601.rs:22:9 | LL | match tuple() { | ------- this expression has type `impl Future` @@ -49,4 +44,4 @@ LL | match tuple().await { error: aborting due to 5 previous errors Some errors have detailed explanations: E0308, E0425, E0670. -For more information about an error, try `rustc --explain E0308`. +For more information about an error, try `rustc --explain E0308`. \ No newline at end of file diff --git a/tests/ui/parser/recover/recover-pat-ranges.rs b/tests/ui/parser/recover/recover-pat-ranges.rs index e3f061c625d3d..3fd4f9eb11df6 100644 --- a/tests/ui/parser/recover/recover-pat-ranges.rs +++ b/tests/ui/parser/recover/recover-pat-ranges.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn main() { match -1 { 0..=1 => (), diff --git a/tests/ui/parser/recover/recover-pat-ranges.stderr b/tests/ui/parser/recover/recover-pat-ranges.stderr index afa7f25405435..66d7a89fc89c5 100644 --- a/tests/ui/parser/recover/recover-pat-ranges.stderr +++ b/tests/ui/parser/recover/recover-pat-ranges.stderr @@ -1,5 +1,5 @@ error: range pattern bounds cannot have parentheses - --> $DIR/recover-pat-ranges.rs:4:13 + --> $DIR/recover-pat-ranges.rs:5:13 | LL | 0..=(1) => (), | ^ ^ @@ -11,7 +11,7 @@ LL + 0..=1 => (), | error: range pattern bounds cannot have parentheses - --> $DIR/recover-pat-ranges.rs:6:9 + --> $DIR/recover-pat-ranges.rs:7:9 | LL | (-12)..=4 => (), | ^ ^ @@ -23,7 +23,7 @@ LL + -12..=4 => (), | error: range pattern bounds cannot have parentheses - --> $DIR/recover-pat-ranges.rs:8:9 + --> $DIR/recover-pat-ranges.rs:9:9 | LL | (0)..=(-4) => (), | ^ ^ @@ -35,7 +35,7 @@ LL + 0..=(-4) => (), | error: range pattern bounds cannot have parentheses - --> $DIR/recover-pat-ranges.rs:8:15 + --> $DIR/recover-pat-ranges.rs:9:15 | LL | (0)..=(-4) => (), | ^ ^ @@ -47,7 +47,7 @@ LL + (0)..=-4 => (), | error: range pattern bounds cannot have parentheses - --> $DIR/recover-pat-ranges.rs:13:9 + --> $DIR/recover-pat-ranges.rs:14:9 | LL | (4).. => (), | ^ ^ @@ -59,7 +59,7 @@ LL + 4.. => (), | error: range pattern bounds cannot have parentheses - --> $DIR/recover-pat-ranges.rs:15:9 + --> $DIR/recover-pat-ranges.rs:16:9 | LL | (-4 + 0).. => (), | ^ ^ @@ -71,7 +71,7 @@ LL + -4 + 0.. => (), | error: range pattern bounds cannot have parentheses - --> $DIR/recover-pat-ranges.rs:18:9 + --> $DIR/recover-pat-ranges.rs:19:9 | LL | (1 + 4)...1 * 2 => (), | ^ ^ @@ -83,7 +83,7 @@ LL + 1 + 4...1 * 2 => (), | error: expected a pattern range bound, found an expression - --> $DIR/recover-pat-ranges.rs:11:12 + --> $DIR/recover-pat-ranges.rs:12:12 | LL | ..=1 + 2 => (), | ^^^^^ not a pattern @@ -100,7 +100,7 @@ LL ~ ..=VAL => (), | error: expected a pattern range bound, found an expression - --> $DIR/recover-pat-ranges.rs:15:10 + --> $DIR/recover-pat-ranges.rs:16:10 | LL | (-4 + 0).. => (), | ^^^^^^ not a pattern @@ -117,7 +117,7 @@ LL ~ (VAL).. => (), | error: expected a pattern range bound, found an expression - --> $DIR/recover-pat-ranges.rs:18:10 + --> $DIR/recover-pat-ranges.rs:19:10 | LL | (1 + 4)...1 * 2 => (), | ^^^^^ not a pattern @@ -134,7 +134,7 @@ LL ~ (VAL)...1 * 2 => (), | error: expected a pattern range bound, found an expression - --> $DIR/recover-pat-ranges.rs:18:19 + --> $DIR/recover-pat-ranges.rs:19:19 | LL | (1 + 4)...1 * 2 => (), | ^^^^^ not a pattern @@ -151,7 +151,7 @@ LL ~ (1 + 4)...VAL => (), | error: expected a pattern range bound, found an expression - --> $DIR/recover-pat-ranges.rs:24:9 + --> $DIR/recover-pat-ranges.rs:25:9 | LL | 0.x()..="y".z() => (), | ^^^^^ not a pattern @@ -168,7 +168,7 @@ LL ~ VAL..="y".z() => (), | error: expected a pattern range bound, found an expression - --> $DIR/recover-pat-ranges.rs:24:17 + --> $DIR/recover-pat-ranges.rs:25:17 | LL | 0.x()..="y".z() => (), | ^^^^^^^ not a pattern @@ -185,7 +185,7 @@ LL ~ 0.x()..=VAL => (), | warning: `...` range patterns are deprecated - --> $DIR/recover-pat-ranges.rs:18:16 + --> $DIR/recover-pat-ranges.rs:19:16 | LL | (1 + 4)...1 * 2 => (), | ^^^ help: use `..=` for an inclusive range diff --git a/tests/ui/parser/recover/recover-quantified-closure.rs b/tests/ui/parser/recover/recover-quantified-closure.rs index 1f5004ad0998d..7bac7b6ec4f0c 100644 --- a/tests/ui/parser/recover/recover-quantified-closure.rs +++ b/tests/ui/parser/recover/recover-quantified-closure.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn main() { for<'a> |x: &'a u8| *x + 1; //~^ ERROR `for<...>` binders for closures are experimental diff --git a/tests/ui/parser/recover/recover-quantified-closure.stderr b/tests/ui/parser/recover/recover-quantified-closure.stderr index 48dea071ae64e..96953b7beeede 100644 --- a/tests/ui/parser/recover/recover-quantified-closure.stderr +++ b/tests/ui/parser/recover/recover-quantified-closure.stderr @@ -1,11 +1,11 @@ error: expected one of `move`, `static`, `use`, `|`, or `||`, found `::` - --> $DIR/recover-quantified-closure.rs:9:14 + --> $DIR/recover-quantified-closure.rs:10:14 | LL | for ::Bar in x {} | ^^ expected one of `move`, `static`, `use`, `|`, or `||` error[E0658]: `for<...>` binders for closures are experimental - --> $DIR/recover-quantified-closure.rs:2:5 + --> $DIR/recover-quantified-closure.rs:3:5 | LL | for<'a> |x: &'a u8| *x + 1; | ^^^^^^^ @@ -16,7 +16,7 @@ LL | for<'a> |x: &'a u8| *x + 1; = help: consider removing `for<...>` error[E0658]: `for<...>` binders for closures are experimental - --> $DIR/recover-quantified-closure.rs:9:5 + --> $DIR/recover-quantified-closure.rs:10:5 | LL | for ::Bar in x {} | ^^^^^^^^^ @@ -27,7 +27,7 @@ LL | for ::Bar in x {} = help: consider removing `for<...>` error: implicit types in closure signatures are forbidden when `for<...>` is present - --> $DIR/recover-quantified-closure.rs:2:24 + --> $DIR/recover-quantified-closure.rs:3:24 | LL | for<'a> |x: &'a u8| *x + 1; | ------- ^ diff --git a/tests/ui/parser/recover/recover-range-pats.rs b/tests/ui/parser/recover/recover-range-pats.rs index 42cd69fd9594d..d82039b039b7c 100644 --- a/tests/ui/parser/recover/recover-range-pats.rs +++ b/tests/ui/parser/recover/recover-range-pats.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Here we test all kinds of range patterns in terms of parsing / recovery. // We want to ensure that: // 1. Things parse as they should. diff --git a/tests/ui/parser/recover/recover-range-pats.stderr b/tests/ui/parser/recover/recover-range-pats.stderr index 1570475a0989b..436dad620a98c 100644 --- a/tests/ui/parser/recover/recover-range-pats.stderr +++ b/tests/ui/parser/recover/recover-range-pats.stderr @@ -1,5 +1,5 @@ error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:20:12 + --> $DIR/recover-range-pats.rs:21:12 | LL | if let .0..Y = 0 {} | ^^ @@ -10,7 +10,7 @@ LL | if let 0.0..Y = 0 {} | + error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:22:16 + --> $DIR/recover-range-pats.rs:23:16 | LL | if let X.. .0 = 0 {} | ^^ @@ -21,7 +21,7 @@ LL | if let X.. 0.0 = 0 {} | + error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:33:12 + --> $DIR/recover-range-pats.rs:34:12 | LL | if let .0..=Y = 0 {} | ^^ @@ -32,7 +32,7 @@ LL | if let 0.0..=Y = 0 {} | + error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:35:16 + --> $DIR/recover-range-pats.rs:36:16 | LL | if let X..=.0 = 0 {} | ^^ @@ -43,7 +43,7 @@ LL | if let X..=0.0 = 0 {} | + error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:58:12 + --> $DIR/recover-range-pats.rs:59:12 | LL | if let .0...Y = 0 {} | ^^ @@ -54,7 +54,7 @@ LL | if let 0.0...Y = 0 {} | + error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:62:17 + --> $DIR/recover-range-pats.rs:63:17 | LL | if let X... .0 = 0 {} | ^^ @@ -65,7 +65,7 @@ LL | if let X... 0.0 = 0 {} | + error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:73:12 + --> $DIR/recover-range-pats.rs:74:12 | LL | if let .0.. = 0 {} | ^^ @@ -76,7 +76,7 @@ LL | if let 0.0.. = 0 {} | + error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:79:13 + --> $DIR/recover-range-pats.rs:80:13 | LL | if let 0..= = 0 {} | ^^^ @@ -89,7 +89,7 @@ LL + if let 0.. = 0 {} | error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:80:13 + --> $DIR/recover-range-pats.rs:81:13 | LL | if let X..= = 0 {} | ^^^ @@ -102,7 +102,7 @@ LL + if let X.. = 0 {} | error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:81:16 + --> $DIR/recover-range-pats.rs:82:16 | LL | if let true..= = 0 {} | ^^^ @@ -115,7 +115,7 @@ LL + if let true.. = 0 {} | error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:83:12 + --> $DIR/recover-range-pats.rs:84:12 | LL | if let .0..= = 0 {} | ^^ @@ -126,7 +126,7 @@ LL | if let 0.0..= = 0 {} | + error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:83:14 + --> $DIR/recover-range-pats.rs:84:14 | LL | if let .0..= = 0 {} | ^^^ @@ -139,7 +139,7 @@ LL + if let .0.. = 0 {} | error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:89:13 + --> $DIR/recover-range-pats.rs:90:13 | LL | if let 0... = 0 {} | ^^^ @@ -152,7 +152,7 @@ LL + if let 0.. = 0 {} | error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:90:13 + --> $DIR/recover-range-pats.rs:91:13 | LL | if let X... = 0 {} | ^^^ @@ -165,7 +165,7 @@ LL + if let X.. = 0 {} | error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:91:16 + --> $DIR/recover-range-pats.rs:92:16 | LL | if let true... = 0 {} | ^^^ @@ -178,7 +178,7 @@ LL + if let true.. = 0 {} | error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:93:12 + --> $DIR/recover-range-pats.rs:94:12 | LL | if let .0... = 0 {} | ^^ @@ -189,7 +189,7 @@ LL | if let 0.0... = 0 {} | + error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:93:14 + --> $DIR/recover-range-pats.rs:94:14 | LL | if let .0... = 0 {} | ^^^ @@ -202,7 +202,7 @@ LL + if let .0.. = 0 {} | error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:103:15 + --> $DIR/recover-range-pats.rs:104:15 | LL | if let .. .0 = 0 {} | ^^ @@ -213,7 +213,7 @@ LL | if let .. 0.0 = 0 {} | + error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:113:15 + --> $DIR/recover-range-pats.rs:114:15 | LL | if let ..=.0 = 0 {} | ^^ @@ -224,7 +224,7 @@ LL | if let ..=0.0 = 0 {} | + error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:119:12 + --> $DIR/recover-range-pats.rs:120:12 | LL | if let ...3 = 0 {} | ^^^ @@ -236,7 +236,7 @@ LL + if let ..=3 = 0 {} | error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:121:12 + --> $DIR/recover-range-pats.rs:122:12 | LL | if let ...Y = 0 {} | ^^^ @@ -248,7 +248,7 @@ LL + if let ..=Y = 0 {} | error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:123:12 + --> $DIR/recover-range-pats.rs:124:12 | LL | if let ...true = 0 {} | ^^^ @@ -260,7 +260,7 @@ LL + if let ..=true = 0 {} | error: float literals must have an integer part - --> $DIR/recover-range-pats.rs:126:15 + --> $DIR/recover-range-pats.rs:127:15 | LL | if let ....3 = 0 {} | ^^ @@ -271,7 +271,7 @@ LL | if let ...0.3 = 0 {} | + error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:126:12 + --> $DIR/recover-range-pats.rs:127:12 | LL | if let ....3 = 0 {} | ^^^ @@ -283,7 +283,7 @@ LL + if let ..=.3 = 0 {} | error: range-to patterns with `...` are not allowed - --> $DIR/recover-range-pats.rs:152:17 + --> $DIR/recover-range-pats.rs:153:17 | LL | let ...$e; | ^^^ @@ -299,7 +299,7 @@ LL + let ..=$e; | error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:159:19 + --> $DIR/recover-range-pats.rs:160:19 | LL | let $e...; | ^^^ @@ -316,7 +316,7 @@ LL + let $e..; | error[E0586]: inclusive range with no end - --> $DIR/recover-range-pats.rs:161:19 + --> $DIR/recover-range-pats.rs:162:19 | LL | let $e..=; | ^^^ @@ -333,7 +333,7 @@ LL + let $e..; | error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:40:13 + --> $DIR/recover-range-pats.rs:41:13 | LL | if let 0...3 = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -341,13 +341,13 @@ LL | if let 0...3 = 0 {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/recover-range-pats.rs:6:9 + --> $DIR/recover-range-pats.rs:7:9 | LL | #![deny(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:43:13 + --> $DIR/recover-range-pats.rs:44:13 | LL | if let 0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -356,7 +356,7 @@ LL | if let 0...Y = 0 {} = note: for more information, see error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:46:13 + --> $DIR/recover-range-pats.rs:47:13 | LL | if let X...3 = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -365,7 +365,7 @@ LL | if let X...3 = 0 {} = note: for more information, see error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:49:13 + --> $DIR/recover-range-pats.rs:50:13 | LL | if let X...Y = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -374,7 +374,7 @@ LL | if let X...Y = 0 {} = note: for more information, see error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:52:16 + --> $DIR/recover-range-pats.rs:53:16 | LL | if let true...Y = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -383,7 +383,7 @@ LL | if let true...Y = 0 {} = note: for more information, see error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:55:13 + --> $DIR/recover-range-pats.rs:56:13 | LL | if let X...true = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -392,7 +392,7 @@ LL | if let X...true = 0 {} = note: for more information, see error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:58:14 + --> $DIR/recover-range-pats.rs:59:14 | LL | if let .0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -401,7 +401,7 @@ LL | if let .0...Y = 0 {} = note: for more information, see error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:62:13 + --> $DIR/recover-range-pats.rs:63:13 | LL | if let X... .0 = 0 {} | ^^^ help: use `..=` for an inclusive range @@ -410,7 +410,7 @@ LL | if let X... .0 = 0 {} = note: for more information, see error: `...` range patterns are deprecated - --> $DIR/recover-range-pats.rs:137:20 + --> $DIR/recover-range-pats.rs:138:20 | LL | let $e1...$e2; | ^^^ help: use `..=` for an inclusive range @@ -423,7 +423,7 @@ LL | mac2!(0, 1); = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:18:12 + --> $DIR/recover-range-pats.rs:19:12 | LL | if let true..Y = 0 {} | ^^^^ - this is of type `u8` @@ -431,7 +431,7 @@ LL | if let true..Y = 0 {} | this is of type `bool` but it should be `char` or numeric error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:19:15 + --> $DIR/recover-range-pats.rs:20:15 | LL | if let X..true = 0 {} | - ^^^^ this is of type `bool` but it should be `char` or numeric @@ -439,7 +439,7 @@ LL | if let X..true = 0 {} | this is of type `u8` error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:20:12 + --> $DIR/recover-range-pats.rs:21:12 | LL | if let .0..Y = 0 {} | ^^ - - this expression has type `{integer}` @@ -448,7 +448,7 @@ LL | if let .0..Y = 0 {} | expected integer, found floating-point number error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:22:16 + --> $DIR/recover-range-pats.rs:23:16 | LL | if let X.. .0 = 0 {} | - ^^ - this expression has type `u8` @@ -457,7 +457,7 @@ LL | if let X.. .0 = 0 {} | this is of type `u8` error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:31:12 + --> $DIR/recover-range-pats.rs:32:12 | LL | if let true..=Y = 0 {} | ^^^^ - this is of type `u8` @@ -465,7 +465,7 @@ LL | if let true..=Y = 0 {} | this is of type `bool` but it should be `char` or numeric error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:32:16 + --> $DIR/recover-range-pats.rs:33:16 | LL | if let X..=true = 0 {} | - ^^^^ this is of type `bool` but it should be `char` or numeric @@ -473,7 +473,7 @@ LL | if let X..=true = 0 {} | this is of type `u8` error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:33:12 + --> $DIR/recover-range-pats.rs:34:12 | LL | if let .0..=Y = 0 {} | ^^ - - this expression has type `{integer}` @@ -482,7 +482,7 @@ LL | if let .0..=Y = 0 {} | expected integer, found floating-point number error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:35:16 + --> $DIR/recover-range-pats.rs:36:16 | LL | if let X..=.0 = 0 {} | - ^^ - this expression has type `u8` @@ -491,7 +491,7 @@ LL | if let X..=.0 = 0 {} | this is of type `u8` error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:52:12 + --> $DIR/recover-range-pats.rs:53:12 | LL | if let true...Y = 0 {} | ^^^^ - this is of type `u8` @@ -499,7 +499,7 @@ LL | if let true...Y = 0 {} | this is of type `bool` but it should be `char` or numeric error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:55:16 + --> $DIR/recover-range-pats.rs:56:16 | LL | if let X...true = 0 {} | - ^^^^ this is of type `bool` but it should be `char` or numeric @@ -507,7 +507,7 @@ LL | if let X...true = 0 {} | this is of type `u8` error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:58:12 + --> $DIR/recover-range-pats.rs:59:12 | LL | if let .0...Y = 0 {} | ^^ - - this expression has type `{integer}` @@ -516,7 +516,7 @@ LL | if let .0...Y = 0 {} | expected integer, found floating-point number error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:62:17 + --> $DIR/recover-range-pats.rs:63:17 | LL | if let X... .0 = 0 {} | - ^^ - this expression has type `u8` @@ -525,13 +525,13 @@ LL | if let X... .0 = 0 {} | this is of type `u8` error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:71:12 + --> $DIR/recover-range-pats.rs:72:12 | LL | if let true.. = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:73:12 + --> $DIR/recover-range-pats.rs:74:12 | LL | if let .0.. = 0 {} | ^^ - this expression has type `{integer}` @@ -539,13 +539,13 @@ LL | if let .0.. = 0 {} | expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:81:12 + --> $DIR/recover-range-pats.rs:82:12 | LL | if let true..= = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:83:12 + --> $DIR/recover-range-pats.rs:84:12 | LL | if let .0..= = 0 {} | ^^ - this expression has type `{integer}` @@ -553,13 +553,13 @@ LL | if let .0..= = 0 {} | expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:91:12 + --> $DIR/recover-range-pats.rs:92:12 | LL | if let true... = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:93:12 + --> $DIR/recover-range-pats.rs:94:12 | LL | if let .0... = 0 {} | ^^ - this expression has type `{integer}` @@ -567,13 +567,13 @@ LL | if let .0... = 0 {} | expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:101:14 + --> $DIR/recover-range-pats.rs:102:14 | LL | if let ..true = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:103:15 + --> $DIR/recover-range-pats.rs:104:15 | LL | if let .. .0 = 0 {} | ^^ - this expression has type `{integer}` @@ -581,13 +581,13 @@ LL | if let .. .0 = 0 {} | expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:111:15 + --> $DIR/recover-range-pats.rs:112:15 | LL | if let ..=true = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:113:15 + --> $DIR/recover-range-pats.rs:114:15 | LL | if let ..=.0 = 0 {} | ^^ - this expression has type `{integer}` @@ -595,13 +595,13 @@ LL | if let ..=.0 = 0 {} | expected integer, found floating-point number error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/recover-range-pats.rs:123:15 + --> $DIR/recover-range-pats.rs:124:15 | LL | if let ...true = 0 {} | ^^^^ this is of type `bool` but it should be `char` or numeric error[E0308]: mismatched types - --> $DIR/recover-range-pats.rs:126:15 + --> $DIR/recover-range-pats.rs:127:15 | LL | if let ....3 = 0 {} | ^^ - this expression has type `{integer}` @@ -609,7 +609,7 @@ LL | if let ....3 = 0 {} | expected integer, found floating-point number error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:135:17 + --> $DIR/recover-range-pats.rs:136:17 | LL | let $e1..$e2; | ^^^^^^^^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered @@ -623,7 +623,7 @@ LL | mac2!(0, 1); = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:137:17 + --> $DIR/recover-range-pats.rs:138:17 | LL | let $e1...$e2; | ^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `2_i32..=i32::MAX` not covered @@ -637,7 +637,7 @@ LL | mac2!(0, 1); = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:141:17 + --> $DIR/recover-range-pats.rs:142:17 | LL | let $e1..=$e2; | ^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `2_i32..=i32::MAX` not covered @@ -651,7 +651,7 @@ LL | mac2!(0, 1); = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:150:17 + --> $DIR/recover-range-pats.rs:151:17 | LL | let ..$e; | ^^^^ pattern `0_i32..=i32::MAX` not covered @@ -665,7 +665,7 @@ LL | mac!(0); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:152:17 + --> $DIR/recover-range-pats.rs:153:17 | LL | let ...$e; | ^^^^^ pattern `1_i32..=i32::MAX` not covered @@ -679,7 +679,7 @@ LL | mac!(0); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:155:17 + --> $DIR/recover-range-pats.rs:156:17 | LL | let ..=$e; | ^^^^^ pattern `1_i32..=i32::MAX` not covered @@ -693,7 +693,7 @@ LL | mac!(0); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:157:17 + --> $DIR/recover-range-pats.rs:158:17 | LL | let $e..; | ^^^^ pattern `i32::MIN..=-1_i32` not covered @@ -707,7 +707,7 @@ LL | mac!(0); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:159:17 + --> $DIR/recover-range-pats.rs:160:17 | LL | let $e...; | ^^^^^ pattern `i32::MIN..=-1_i32` not covered @@ -721,7 +721,7 @@ LL | mac!(0); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0005]: refutable pattern in local binding - --> $DIR/recover-range-pats.rs:161:17 + --> $DIR/recover-range-pats.rs:162:17 | LL | let $e..=; | ^^^^^ pattern `i32::MIN..=-1_i32` not covered diff --git a/tests/ui/parser/trait-object-trait-parens.rs b/tests/ui/parser/trait-object-trait-parens.rs index 51f0e2de6116f..2b124c8c94bfd 100644 --- a/tests/ui/parser/trait-object-trait-parens.rs +++ b/tests/ui/parser/trait-object-trait-parens.rs @@ -1,3 +1,4 @@ +//@ edition:2015 trait Trait<'a> {} trait Obj {} diff --git a/tests/ui/parser/trait-object-trait-parens.stderr b/tests/ui/parser/trait-object-trait-parens.stderr index f498d7d36bba6..a86a9e81f2a4d 100644 --- a/tests/ui/parser/trait-object-trait-parens.stderr +++ b/tests/ui/parser/trait-object-trait-parens.stderr @@ -1,23 +1,23 @@ error: relaxed bounds are not permitted in trait object types - --> $DIR/trait-object-trait-parens.rs:8:24 + --> $DIR/trait-object-trait-parens.rs:9:24 | LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | ^^^^^^^^ error: relaxed bounds are not permitted in trait object types - --> $DIR/trait-object-trait-parens.rs:13:16 + --> $DIR/trait-object-trait-parens.rs:14:16 | LL | let _: Box Trait<'a>) + (Obj)>; | ^^^^^^ error: relaxed bounds are not permitted in trait object types - --> $DIR/trait-object-trait-parens.rs:18:44 + --> $DIR/trait-object-trait-parens.rs:19:44 | LL | let _: Box Trait<'a> + (Obj) + (?Sized)>; | ^^^^^^^^ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/trait-object-trait-parens.rs:8:16 + --> $DIR/trait-object-trait-parens.rs:9:16 | LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ LL | let _: Box Trait<'a>)>; | +++ error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-object-trait-parens.rs:8:35 + --> $DIR/trait-object-trait-parens.rs:9:35 | LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | ----- ^^^^^^^^^^^^^^^^^^^ additional non-auto trait @@ -42,7 +42,7 @@ LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/trait-object-trait-parens.rs:13:16 + --> $DIR/trait-object-trait-parens.rs:14:16 | LL | let _: Box Trait<'a>) + (Obj)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -55,7 +55,7 @@ LL | let _: Box Trait<'a>) + (Obj)>; | +++ error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-object-trait-parens.rs:13:47 + --> $DIR/trait-object-trait-parens.rs:14:47 | LL | let _: Box Trait<'a>) + (Obj)>; | ------------------- ^^^^^ additional non-auto trait @@ -66,7 +66,7 @@ LL | let _: Box Trait<'a>) + (Obj)>; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/trait-object-trait-parens.rs:18:16 + --> $DIR/trait-object-trait-parens.rs:19:16 | LL | let _: Box Trait<'a> + (Obj) + (?Sized)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -79,7 +79,7 @@ LL | let _: Box Trait<'a> + (Obj) + (?Sized)>; | +++ error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-object-trait-parens.rs:18:36 + --> $DIR/trait-object-trait-parens.rs:19:36 | LL | let _: Box Trait<'a> + (Obj) + (?Sized)>; | ----------------- ^^^^^ additional non-auto trait diff --git a/tests/ui/parser/triple-colon.fixed b/tests/ui/parser/triple-colon.fixed index 168e4c1f618ae..d91b320837090 100644 --- a/tests/ui/parser/triple-colon.fixed +++ b/tests/ui/parser/triple-colon.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(unused)] diff --git a/tests/ui/parser/triple-colon.rs b/tests/ui/parser/triple-colon.rs index 1a70012685f8d..fa8c18ca75577 100644 --- a/tests/ui/parser/triple-colon.rs +++ b/tests/ui/parser/triple-colon.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(unused)] diff --git a/tests/ui/parser/triple-colon.stderr b/tests/ui/parser/triple-colon.stderr index 8d57fd7ebc9fe..e9729e1fd92fa 100644 --- a/tests/ui/parser/triple-colon.stderr +++ b/tests/ui/parser/triple-colon.stderr @@ -1,5 +1,5 @@ error: path separator must be a double colon - --> $DIR/triple-colon.rs:5:7 + --> $DIR/triple-colon.rs:6:7 | LL | use :::std::{cell as _}; | ^ @@ -11,7 +11,7 @@ LL + use ::std::{cell as _}; | error: path separator must be a double colon - --> $DIR/triple-colon.rs:6:16 + --> $DIR/triple-colon.rs:7:16 | LL | use std::cell:::*; | ^ @@ -23,7 +23,7 @@ LL + use std::cell::*; | error: path separator must be a double colon - --> $DIR/triple-colon.rs:7:16 + --> $DIR/triple-colon.rs:8:16 | LL | use std::cell:::Cell; | ^ @@ -35,7 +35,7 @@ LL + use std::cell::Cell; | error: path separator must be a double colon - --> $DIR/triple-colon.rs:8:10 + --> $DIR/triple-colon.rs:9:10 | LL | use std:::{cell as _}; | ^ @@ -47,7 +47,7 @@ LL + use std::{cell as _}; | error: path separator must be a double colon - --> $DIR/triple-colon.rs:11:11 + --> $DIR/triple-colon.rs:12:11 | LL | use :::{}; | ^ @@ -59,7 +59,7 @@ LL + use ::{}; | error: path separator must be a double colon - --> $DIR/triple-colon.rs:12:11 + --> $DIR/triple-colon.rs:13:11 | LL | use :::*; | ^ @@ -71,7 +71,7 @@ LL + use ::*; | error: path separator must be a double colon - --> $DIR/triple-colon.rs:16:14 + --> $DIR/triple-colon.rs:17:14 | LL | let c: :::std:::cell:::Cell::: = Cell::::::new(0); | ^ @@ -83,7 +83,7 @@ LL + let c: ::std:::cell:::Cell::: = Cell::::::new(0); | error: path separator must be a double colon - --> $DIR/triple-colon.rs:16:20 + --> $DIR/triple-colon.rs:17:20 | LL | let c: :::std:::cell:::Cell::: = Cell::::::new(0); | ^ @@ -95,7 +95,7 @@ LL + let c: :::std::cell:::Cell::: = Cell::::::new(0); | error: path separator must be a double colon - --> $DIR/triple-colon.rs:16:27 + --> $DIR/triple-colon.rs:17:27 | LL | let c: :::std:::cell:::Cell::: = Cell::::::new(0); | ^ @@ -107,7 +107,7 @@ LL + let c: :::std:::cell::Cell::: = Cell::::::new(0); | error: path separator must be a double colon - --> $DIR/triple-colon.rs:16:34 + --> $DIR/triple-colon.rs:17:34 | LL | let c: :::std:::cell:::Cell::: = Cell::::::new(0); | ^ @@ -119,7 +119,7 @@ LL + let c: :::std:::cell:::Cell:: = Cell::::::new(0); | error: path separator must be a double colon - --> $DIR/triple-colon.rs:16:48 + --> $DIR/triple-colon.rs:17:48 | LL | let c: :::std:::cell:::Cell::: = Cell::::::new(0); | ^ @@ -131,7 +131,7 @@ LL + let c: :::std:::cell:::Cell::: = Cell:::::new(0); | error: path separator must be a double colon - --> $DIR/triple-colon.rs:16:55 + --> $DIR/triple-colon.rs:17:55 | LL | let c: :::std:::cell:::Cell::: = Cell::::::new(0); | ^ diff --git a/tests/ui/parser/where_with_bound.rs b/tests/ui/parser/where_with_bound.rs index 3ca45f1889c9c..4e04d8eb05cb1 100644 --- a/tests/ui/parser/where_with_bound.rs +++ b/tests/ui/parser/where_with_bound.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn foo() where ::Item: ToString, T: Iterator { } //~^ ERROR generic parameters on `where` clauses are reserved for future use //~| ERROR cannot find type `Item` in the crate root diff --git a/tests/ui/parser/where_with_bound.stderr b/tests/ui/parser/where_with_bound.stderr index ff98b3f5fed61..06b611e1cd009 100644 --- a/tests/ui/parser/where_with_bound.stderr +++ b/tests/ui/parser/where_with_bound.stderr @@ -1,11 +1,11 @@ error: generic parameters on `where` clauses are reserved for future use - --> $DIR/where_with_bound.rs:1:19 + --> $DIR/where_with_bound.rs:2:19 | LL | fn foo() where ::Item: ToString, T: Iterator { } | ^^^ currently unsupported error[E0412]: cannot find type `Item` in the crate root - --> $DIR/where_with_bound.rs:1:24 + --> $DIR/where_with_bound.rs:2:24 | LL | fn foo() where ::Item: ToString, T: Iterator { } | ^^^^ not found in the crate root diff --git a/tests/ui/pattern/no-patterns-in-args-2.rs b/tests/ui/pattern/no-patterns-in-args-2.rs index 85b7fc5cdba49..f1ed463a93a1f 100644 --- a/tests/ui/pattern/no-patterns-in-args-2.rs +++ b/tests/ui/pattern/no-patterns-in-args-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![deny(patterns_in_fns_without_body)] trait Tr { diff --git a/tests/ui/pattern/no-patterns-in-args-2.stderr b/tests/ui/pattern/no-patterns-in-args-2.stderr index 6adcbb9dccd82..3990f23038714 100644 --- a/tests/ui/pattern/no-patterns-in-args-2.stderr +++ b/tests/ui/pattern/no-patterns-in-args-2.stderr @@ -1,11 +1,11 @@ error[E0642]: patterns aren't allowed in functions without bodies - --> $DIR/no-patterns-in-args-2.rs:6:11 + --> $DIR/no-patterns-in-args-2.rs:7:11 | LL | fn f2(&arg: u8); | ^^^^ pattern not allowed in function without body error: patterns aren't allowed in functions without bodies - --> $DIR/no-patterns-in-args-2.rs:4:11 + --> $DIR/no-patterns-in-args-2.rs:5:11 | LL | fn f1(mut arg: u8); | ^^^^^^^ help: remove `mut` from the parameter: `arg` @@ -13,7 +13,7 @@ LL | fn f1(mut arg: u8); = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #35203 note: the lint level is defined here - --> $DIR/no-patterns-in-args-2.rs:1:9 + --> $DIR/no-patterns-in-args-2.rs:2:9 | LL | #![deny(patterns_in_fns_without_body)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/privacy/privacy-in-paths.rs b/tests/ui/privacy/privacy-in-paths.rs index 4baa9758bbec2..e77b57069222f 100644 --- a/tests/ui/privacy/privacy-in-paths.rs +++ b/tests/ui/privacy/privacy-in-paths.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod foo { pub use self::bar::S; mod bar { diff --git a/tests/ui/privacy/privacy-in-paths.stderr b/tests/ui/privacy/privacy-in-paths.stderr index 4acb9baa66c05..942bda2bf9b6f 100644 --- a/tests/ui/privacy/privacy-in-paths.stderr +++ b/tests/ui/privacy/privacy-in-paths.stderr @@ -1,5 +1,5 @@ error[E0603]: module `bar` is private - --> $DIR/privacy-in-paths.rs:24:21 + --> $DIR/privacy-in-paths.rs:25:21 | LL | crate::foo::bar::baz::f(); | ^^^ - function `f` is not publicly re-exported @@ -7,19 +7,19 @@ LL | crate::foo::bar::baz::f(); | private module | note: the module `bar` is defined here - --> $DIR/privacy-in-paths.rs:3:5 + --> $DIR/privacy-in-paths.rs:4:5 | LL | mod bar { | ^^^^^^^ error[E0603]: module `bar` is private - --> $DIR/privacy-in-paths.rs:25:21 + --> $DIR/privacy-in-paths.rs:26:21 | LL | crate::foo::bar::S::f(); | ^^^ private module | note: the module `bar` is defined here - --> $DIR/privacy-in-paths.rs:3:5 + --> $DIR/privacy-in-paths.rs:4:5 | LL | mod bar { | ^^^^^^^ @@ -30,7 +30,7 @@ LL + foo::S::f(); | error[E0603]: trait `T` is private - --> $DIR/privacy-in-paths.rs:26:28 + --> $DIR/privacy-in-paths.rs:27:28 | LL | <() as crate::foo::T>::Assoc::f(); | ^ ----- associated type `Assoc` is not publicly re-exported @@ -38,7 +38,7 @@ LL | <() as crate::foo::T>::Assoc::f(); | private trait | note: the trait `T` is defined here - --> $DIR/privacy-in-paths.rs:8:5 + --> $DIR/privacy-in-paths.rs:9:5 | LL | trait T { | ^^^^^^^ diff --git a/tests/ui/privacy/privacy-ns1.rs b/tests/ui/privacy/privacy-ns1.rs index 1af5b857e9df6..1ae68759b6d71 100644 --- a/tests/ui/privacy/privacy-ns1.rs +++ b/tests/ui/privacy/privacy-ns1.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Check we do the correct privacy checks when we import a name and there is an // item with that name in both the value and type namespaces. diff --git a/tests/ui/privacy/privacy-ns1.stderr b/tests/ui/privacy/privacy-ns1.stderr index c782c67e71c6e..58e276a75a712 100644 --- a/tests/ui/privacy/privacy-ns1.stderr +++ b/tests/ui/privacy/privacy-ns1.stderr @@ -1,5 +1,5 @@ error[E0423]: expected function, tuple struct or tuple variant, found trait `Bar` - --> $DIR/privacy-ns1.rs:20:5 + --> $DIR/privacy-ns1.rs:21:5 | LL | pub struct Baz; | --------------- similarly named unit struct `Baz` defined here @@ -8,7 +8,7 @@ LL | Bar(); | ^^^ | note: these functions exist but are inaccessible - --> $DIR/privacy-ns1.rs:14:5 + --> $DIR/privacy-ns1.rs:15:5 | LL | fn Bar() { } | ^^^^^^^^ `foo1::Bar`: not accessible @@ -26,7 +26,7 @@ LL + use foo2::Bar; | error[E0425]: cannot find function, tuple struct or tuple variant `Bar` in this scope - --> $DIR/privacy-ns1.rs:51:5 + --> $DIR/privacy-ns1.rs:52:5 | LL | pub struct Baz; | --------------- similarly named unit struct `Baz` defined here @@ -35,7 +35,7 @@ LL | Bar(); | ^^^ | note: these functions exist but are inaccessible - --> $DIR/privacy-ns1.rs:14:5 + --> $DIR/privacy-ns1.rs:15:5 | LL | fn Bar() { } | ^^^^^^^^ `foo1::Bar`: not accessible @@ -53,7 +53,7 @@ LL + use foo2::Bar; | error[E0412]: cannot find type `Bar` in this scope - --> $DIR/privacy-ns1.rs:52:17 + --> $DIR/privacy-ns1.rs:53:17 | LL | pub struct Baz; | --------------- similarly named struct `Baz` defined here @@ -62,7 +62,7 @@ LL | let _x: Box; | ^^^ | note: these traits exist but are inaccessible - --> $DIR/privacy-ns1.rs:25:5 + --> $DIR/privacy-ns1.rs:26:5 | LL | trait Bar { | ^^^^^^^^^ `foo2::Bar`: not accessible @@ -80,7 +80,7 @@ LL + use foo1::Bar; | error[E0747]: constant provided when a type was expected - --> $DIR/privacy-ns1.rs:35:17 + --> $DIR/privacy-ns1.rs:36:17 | LL | let _x: Box; | ^^^ diff --git a/tests/ui/privacy/privacy-ns2.rs b/tests/ui/privacy/privacy-ns2.rs index 47035ef3af5a2..8b671f1ee8509 100644 --- a/tests/ui/privacy/privacy-ns2.rs +++ b/tests/ui/privacy/privacy-ns2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Check we do the correct privacy checks when we import a name and there is an // item with that name in both the value and type namespaces. diff --git a/tests/ui/privacy/privacy-ns2.stderr b/tests/ui/privacy/privacy-ns2.stderr index fe1f0c9bd48ca..62cb773681a7e 100644 --- a/tests/ui/privacy/privacy-ns2.stderr +++ b/tests/ui/privacy/privacy-ns2.stderr @@ -1,11 +1,11 @@ error[E0423]: expected function, tuple struct or tuple variant, found trait `Bar` - --> $DIR/privacy-ns2.rs:20:5 + --> $DIR/privacy-ns2.rs:21:5 | LL | Bar(); | ^^^ not a function, tuple struct or tuple variant | note: these functions exist but are inaccessible - --> $DIR/privacy-ns2.rs:14:5 + --> $DIR/privacy-ns2.rs:15:5 | LL | fn Bar() { } | ^^^^^^^^ `foo1::Bar`: not accessible @@ -18,7 +18,7 @@ LL + use foo2::Bar; | error[E0423]: expected function, tuple struct or tuple variant, found trait `Bar` - --> $DIR/privacy-ns2.rs:26:5 + --> $DIR/privacy-ns2.rs:27:5 | LL | pub struct Baz; | --------------- similarly named unit struct `Baz` defined here @@ -27,7 +27,7 @@ LL | Bar(); | ^^^ | note: these functions exist but are inaccessible - --> $DIR/privacy-ns2.rs:14:5 + --> $DIR/privacy-ns2.rs:15:5 | LL | fn Bar() { } | ^^^^^^^^ `foo1::Bar`: not accessible @@ -45,13 +45,13 @@ LL + use foo2::Bar; | error[E0573]: expected type, found function `Bar` - --> $DIR/privacy-ns2.rs:42:14 + --> $DIR/privacy-ns2.rs:43:14 | LL | let _x : Bar(); | ^^^^^ not a type | note: these traits exist but are inaccessible - --> $DIR/privacy-ns2.rs:31:5 + --> $DIR/privacy-ns2.rs:32:5 | LL | trait Bar { | ^^^^^^^^^ `foo2::Bar`: not accessible @@ -69,43 +69,43 @@ LL + use foo1::Bar; | error[E0603]: trait `Bar` is private - --> $DIR/privacy-ns2.rs:61:15 + --> $DIR/privacy-ns2.rs:62:15 | LL | use foo3::Bar; | ^^^ private trait | note: the trait `Bar` is defined here - --> $DIR/privacy-ns2.rs:53:5 + --> $DIR/privacy-ns2.rs:54:5 | LL | trait Bar { | ^^^^^^^^^ error[E0603]: trait `Bar` is private - --> $DIR/privacy-ns2.rs:65:15 + --> $DIR/privacy-ns2.rs:66:15 | LL | use foo3::Bar; | ^^^ private trait | note: the trait `Bar` is defined here - --> $DIR/privacy-ns2.rs:53:5 + --> $DIR/privacy-ns2.rs:54:5 | LL | trait Bar { | ^^^^^^^^^ error[E0603]: trait `Bar` is private - --> $DIR/privacy-ns2.rs:72:16 + --> $DIR/privacy-ns2.rs:73:16 | LL | use foo3::{Bar,Baz}; | ^^^ private trait | note: the trait `Bar` is defined here - --> $DIR/privacy-ns2.rs:53:5 + --> $DIR/privacy-ns2.rs:54:5 | LL | trait Bar { | ^^^^^^^^^ error[E0747]: constant provided when a type was expected - --> $DIR/privacy-ns2.rs:41:18 + --> $DIR/privacy-ns2.rs:42:18 | LL | let _x : Box; | ^^^ @@ -114,7 +114,7 @@ LL | let _x : Box; = help: function item types cannot be named directly error[E0747]: constant provided when a type was expected - --> $DIR/privacy-ns2.rs:48:17 + --> $DIR/privacy-ns2.rs:49:17 | LL | let _x: Box; | ^^^ diff --git a/tests/ui/privacy/privacy1.rs b/tests/ui/privacy/privacy1.rs index 16aacd8128912..333d94f41798d 100644 --- a/tests/ui/privacy/privacy1.rs +++ b/tests/ui/privacy/privacy1.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(lang_items, no_core)] #![no_core] // makes debugging this test *a lot* easier (during resolve) diff --git a/tests/ui/privacy/privacy1.stderr b/tests/ui/privacy/privacy1.stderr index 98750cee610e4..f62ef3ae2e4cc 100644 --- a/tests/ui/privacy/privacy1.stderr +++ b/tests/ui/privacy/privacy1.stderr @@ -1,54 +1,54 @@ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:138:18 + --> $DIR/privacy1.rs:139:18 | LL | use bar::baz::{foo, bar}; | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:138:18 + --> $DIR/privacy1.rs:139:18 | LL | use bar::baz::{foo, bar}; | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:147:18 + --> $DIR/privacy1.rs:148:18 | LL | use bar::baz; | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `i` is private - --> $DIR/privacy1.rs:171:20 + --> $DIR/privacy1.rs:172:20 | LL | use self::foo::i::A; | ^ private module | note: the module `i` is defined here - --> $DIR/privacy1.rs:176:9 + --> $DIR/privacy1.rs:177:9 | LL | mod i { | ^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:110:21 + --> $DIR/privacy1.rs:111:21 | LL | crate::bar::baz::A::foo(); | ^^^ - struct `A` is not publicly re-exported @@ -56,13 +56,13 @@ LL | crate::bar::baz::A::foo(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:111:21 + --> $DIR/privacy1.rs:112:21 | LL | crate::bar::baz::A::bar(); | ^^^ - struct `A` is not publicly re-exported @@ -70,13 +70,13 @@ LL | crate::bar::baz::A::bar(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:113:21 + --> $DIR/privacy1.rs:114:21 | LL | crate::bar::baz::A.foo2(); | ^^^ - unit struct `A` is not publicly re-exported @@ -84,13 +84,13 @@ LL | crate::bar::baz::A.foo2(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:114:21 + --> $DIR/privacy1.rs:115:21 | LL | crate::bar::baz::A.bar2(); | ^^^ - unit struct `A` is not publicly re-exported @@ -98,13 +98,13 @@ LL | crate::bar::baz::A.bar2(); | private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ error[E0603]: trait `B` is private - --> $DIR/privacy1.rs:118:21 + --> $DIR/privacy1.rs:119:21 | LL | crate::bar::B::foo(); | ^ --- associated function `foo` is not publicly re-exported @@ -112,31 +112,31 @@ LL | crate::bar::B::foo(); | private trait | note: the trait `B` is defined here - --> $DIR/privacy1.rs:46:5 + --> $DIR/privacy1.rs:47:5 | LL | trait B { | ^^^^^^^ error[E0603]: function `epriv` is private - --> $DIR/privacy1.rs:124:25 + --> $DIR/privacy1.rs:125:25 | LL | crate::bar::epriv(); | ^^^^^ private function | note: the function `epriv` is defined here - --> $DIR/privacy1.rs:71:9 + --> $DIR/privacy1.rs:72:9 | LL | fn epriv(); | ^^^^^^^^^^^ error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:133:21 + --> $DIR/privacy1.rs:134:21 | LL | crate::bar::baz::foo(); | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ @@ -147,13 +147,13 @@ LL + bar::foo(); | error[E0603]: module `baz` is private - --> $DIR/privacy1.rs:134:21 + --> $DIR/privacy1.rs:135:21 | LL | crate::bar::baz::bar(); | ^^^ private module | note: the module `baz` is defined here - --> $DIR/privacy1.rs:56:5 + --> $DIR/privacy1.rs:57:5 | LL | mod baz { | ^^^^^^^ @@ -164,19 +164,19 @@ LL + bar::bar(); | error[E0603]: trait `B` is private - --> $DIR/privacy1.rs:163:22 + --> $DIR/privacy1.rs:164:22 | LL | impl crate::bar::B for f32 { fn foo() -> f32 { 1.0 } } | ^ private trait | note: the trait `B` is defined here - --> $DIR/privacy1.rs:46:5 + --> $DIR/privacy1.rs:47:5 | LL | trait B { | ^^^^^^^ error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:83:23 + --> $DIR/privacy1.rs:84:23 | LL | fn bar() {} | -------- private associated function defined here @@ -185,7 +185,7 @@ LL | self::baz::A::bar(); | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:101:13 + --> $DIR/privacy1.rs:102:13 | LL | fn bar() {} | -------- private associated function defined here @@ -194,7 +194,7 @@ LL | bar::A::bar(); | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:108:24 + --> $DIR/privacy1.rs:109:24 | LL | fn bar() {} | -------- private associated function defined here @@ -203,7 +203,7 @@ LL | crate::bar::A::bar(); | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:111:29 + --> $DIR/privacy1.rs:112:29 | LL | fn bar() {} | -------- private associated function defined here @@ -212,7 +212,7 @@ LL | crate::bar::baz::A::bar(); | ^^^ private associated function error[E0624]: method `bar2` is private - --> $DIR/privacy1.rs:114:28 + --> $DIR/privacy1.rs:115:28 | LL | fn bar2(&self) {} | -------------- private method defined here diff --git a/tests/ui/privacy/private-variant-reexport.rs b/tests/ui/privacy/private-variant-reexport.rs index b59243af62067..b371a0e76adc0 100644 --- a/tests/ui/privacy/private-variant-reexport.rs +++ b/tests/ui/privacy/private-variant-reexport.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod m1 { pub use ::E::V; //~ ERROR `V` is only public within the crate, and cannot be re-exported outside } diff --git a/tests/ui/privacy/private-variant-reexport.stderr b/tests/ui/privacy/private-variant-reexport.stderr index d73bd1a8cc29f..68e7d653fb132 100644 --- a/tests/ui/privacy/private-variant-reexport.stderr +++ b/tests/ui/privacy/private-variant-reexport.stderr @@ -1,29 +1,29 @@ error[E0364]: `V` is only public within the crate, and cannot be re-exported outside - --> $DIR/private-variant-reexport.rs:2:13 + --> $DIR/private-variant-reexport.rs:3:13 | LL | pub use ::E::V; | ^^^^^^ | note: consider marking `V` as `pub` in the imported module - --> $DIR/private-variant-reexport.rs:2:13 + --> $DIR/private-variant-reexport.rs:3:13 | LL | pub use ::E::V; | ^^^^^^ error[E0364]: `V` is only public within the crate, and cannot be re-exported outside - --> $DIR/private-variant-reexport.rs:6:19 + --> $DIR/private-variant-reexport.rs:7:19 | LL | pub use ::E::{V}; | ^ | note: consider marking `V` as `pub` in the imported module - --> $DIR/private-variant-reexport.rs:6:19 + --> $DIR/private-variant-reexport.rs:7:19 | LL | pub use ::E::{V}; | ^ error[E0365]: `V` is only public within the crate, and cannot be re-exported outside - --> $DIR/private-variant-reexport.rs:10:22 + --> $DIR/private-variant-reexport.rs:11:22 | LL | pub use ::E::V::{self}; | ^^^^ re-export of crate public `V` @@ -31,25 +31,25 @@ LL | pub use ::E::V::{self}; = note: consider declaring type or module `V` with `pub` error: glob import doesn't reexport anything with visibility `pub` because no imported item is public enough - --> $DIR/private-variant-reexport.rs:15:13 + --> $DIR/private-variant-reexport.rs:16:13 | LL | pub use ::E::*; | ^^^^^^ | note: the most public imported item is `pub(crate)` - --> $DIR/private-variant-reexport.rs:15:13 + --> $DIR/private-variant-reexport.rs:16:13 | LL | pub use ::E::*; | ^^^^^^ = help: reduce the glob import's visibility or increase visibility of imported items note: the lint level is defined here - --> $DIR/private-variant-reexport.rs:13:8 + --> $DIR/private-variant-reexport.rs:14:8 | LL | #[deny(unused_imports)] | ^^^^^^^^^^^^^^ error: unused import: `::E::*` - --> $DIR/private-variant-reexport.rs:15:13 + --> $DIR/private-variant-reexport.rs:16:13 | LL | pub use ::E::*; | ^^^^^^ diff --git a/tests/ui/privacy/restricted/struct-literal-field.rs b/tests/ui/privacy/restricted/struct-literal-field.rs index 2bb2a7fe95fe4..dbdf9f5cc3a07 100644 --- a/tests/ui/privacy/restricted/struct-literal-field.rs +++ b/tests/ui/privacy/restricted/struct-literal-field.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![allow(warnings)] mod foo { diff --git a/tests/ui/privacy/restricted/struct-literal-field.stderr b/tests/ui/privacy/restricted/struct-literal-field.stderr index e1cf7c2fadbfe..6b2ab3ec25cf2 100644 --- a/tests/ui/privacy/restricted/struct-literal-field.stderr +++ b/tests/ui/privacy/restricted/struct-literal-field.stderr @@ -1,5 +1,5 @@ error[E0451]: field `x` of struct `S` is private - --> $DIR/struct-literal-field.rs:18:9 + --> $DIR/struct-literal-field.rs:19:9 | LL | S { x: 0 }; | ^ private field diff --git a/tests/ui/privacy/restricted/test.rs b/tests/ui/privacy/restricted/test.rs index b32b9327f07ee..82432b4db5095 100644 --- a/tests/ui/privacy/restricted/test.rs +++ b/tests/ui/privacy/restricted/test.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:pub_restricted.rs #![allow(warnings)] diff --git a/tests/ui/privacy/restricted/test.stderr b/tests/ui/privacy/restricted/test.stderr index 2744b3708a826..8d7925cf99fc6 100644 --- a/tests/ui/privacy/restricted/test.stderr +++ b/tests/ui/privacy/restricted/test.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `bad` - --> $DIR/test.rs:50:12 + --> $DIR/test.rs:51:12 | LL | pub(in bad::path) mod m1 {} | ^^^ use of unresolved module or unlinked crate `bad` @@ -10,25 +10,25 @@ LL + extern crate bad; | error[E0742]: visibilities can only be restricted to ancestor modules - --> $DIR/test.rs:51:12 + --> $DIR/test.rs:52:12 | LL | pub(in foo) mod m2 {} | ^^^ error[E0364]: `f` is private, and cannot be re-exported - --> $DIR/test.rs:21:24 + --> $DIR/test.rs:22:24 | LL | pub(super) use foo::bar::f as g; | ^^^^^^^^^^^^^^^^ | note: consider marking `f` as `pub` in the imported module - --> $DIR/test.rs:21:24 + --> $DIR/test.rs:22:24 | LL | pub(super) use foo::bar::f as g; | ^^^^^^^^^^^^^^^^ error[E0603]: struct `Crate` is private - --> $DIR/test.rs:38:25 + --> $DIR/test.rs:39:25 | LL | use pub_restricted::Crate; | ^^^^^ private struct @@ -40,25 +40,25 @@ LL | pub(crate) struct Crate; | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: function `f` is private - --> $DIR/test.rs:30:19 + --> $DIR/test.rs:31:19 | LL | use foo::bar::f; | ^ private function | note: the function `f` is defined here - --> $DIR/test.rs:8:9 + --> $DIR/test.rs:9:9 | LL | pub(super) fn f() {} | ^^^^^^^^^^^^^^^^^ error[E0616]: field `x` of struct `S` is private - --> $DIR/test.rs:31:18 + --> $DIR/test.rs:32:18 | LL | S::default().x; | ^ private field error[E0624]: method `f` is private - --> $DIR/test.rs:32:18 + --> $DIR/test.rs:33:18 | LL | pub(super) fn f(&self) {} | ---------------------- private method defined here @@ -67,7 +67,7 @@ LL | S::default().f(); | ^ private method error[E0624]: associated function `g` is private - --> $DIR/test.rs:33:8 + --> $DIR/test.rs:34:8 | LL | pub(super) fn g() {} | ----------------- private associated function defined here @@ -76,19 +76,19 @@ LL | S::g(); | ^ private associated function error[E0616]: field `y` of struct `Universe` is private - --> $DIR/test.rs:42:15 + --> $DIR/test.rs:43:15 | LL | let _ = u.y; | ^ private field error[E0616]: field `z` of struct `Universe` is private - --> $DIR/test.rs:43:15 + --> $DIR/test.rs:44:15 | LL | let _ = u.z; | ^ private field error[E0624]: method `g` is private - --> $DIR/test.rs:45:7 + --> $DIR/test.rs:46:7 | LL | u.g(); | ^ private method @@ -99,7 +99,7 @@ LL | pub(crate) fn g(&self) {} | ---------------------- private method defined here error[E0624]: method `h` is private - --> $DIR/test.rs:46:7 + --> $DIR/test.rs:47:7 | LL | u.h(); | ^ private method diff --git a/tests/ui/privacy/sealed-traits/re-exported-trait.fixed b/tests/ui/privacy/sealed-traits/re-exported-trait.fixed index 1553d689a1c2a..35ac62c3d23bf 100644 --- a/tests/ui/privacy/sealed-traits/re-exported-trait.fixed +++ b/tests/ui/privacy/sealed-traits/re-exported-trait.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(dead_code)] diff --git a/tests/ui/privacy/sealed-traits/re-exported-trait.rs b/tests/ui/privacy/sealed-traits/re-exported-trait.rs index 37eed341be1d9..b5a13204346fc 100644 --- a/tests/ui/privacy/sealed-traits/re-exported-trait.rs +++ b/tests/ui/privacy/sealed-traits/re-exported-trait.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(dead_code)] diff --git a/tests/ui/privacy/sealed-traits/re-exported-trait.stderr b/tests/ui/privacy/sealed-traits/re-exported-trait.stderr index 368389af0b927..9479dffbbf7dc 100644 --- a/tests/ui/privacy/sealed-traits/re-exported-trait.stderr +++ b/tests/ui/privacy/sealed-traits/re-exported-trait.stderr @@ -1,11 +1,11 @@ error[E0603]: module `b` is private - --> $DIR/re-exported-trait.rs:12:9 + --> $DIR/re-exported-trait.rs:13:9 | LL | impl a::b::Trait for S {} | ^ private module | note: the module `b` is defined here - --> $DIR/re-exported-trait.rs:6:5 + --> $DIR/re-exported-trait.rs:7:5 | LL | mod b { | ^^^^^ diff --git a/tests/ui/proc-macro/attributes-included.rs b/tests/ui/proc-macro/attributes-included.rs index 73d1c1a8f05ae..d2e2f7570aa1a 100644 --- a/tests/ui/proc-macro/attributes-included.rs +++ b/tests/ui/proc-macro/attributes-included.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ proc-macro: attributes-included.rs //@ check-pass diff --git a/tests/ui/proc-macro/attributes-included.stderr b/tests/ui/proc-macro/attributes-included.stderr index 72c88d5d8b752..5e2c8aa613db5 100644 --- a/tests/ui/proc-macro/attributes-included.stderr +++ b/tests/ui/proc-macro/attributes-included.stderr @@ -1,11 +1,11 @@ warning: unused variable: `a` - --> $DIR/attributes-included.rs:17:9 + --> $DIR/attributes-included.rs:18:9 | LL | let a: i32 = "foo"; | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here - --> $DIR/attributes-included.rs:4:9 + --> $DIR/attributes-included.rs:5:9 | LL | #![warn(unused)] | ^^^^^^ diff --git a/tests/ui/proc-macro/attributes-on-modules-fail.rs b/tests/ui/proc-macro/attributes-on-modules-fail.rs index 80300b47c5fc1..82d35ed295798 100644 --- a/tests/ui/proc-macro/attributes-on-modules-fail.rs +++ b/tests/ui/proc-macro/attributes-on-modules-fail.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ proc-macro: test-macros.rs #[macro_use] diff --git a/tests/ui/proc-macro/attributes-on-modules-fail.stderr b/tests/ui/proc-macro/attributes-on-modules-fail.stderr index e69ab78723861..658f57a005e61 100644 --- a/tests/ui/proc-macro/attributes-on-modules-fail.stderr +++ b/tests/ui/proc-macro/attributes-on-modules-fail.stderr @@ -1,5 +1,5 @@ error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s - --> $DIR/attributes-on-modules-fail.rs:16:1 + --> $DIR/attributes-on-modules-fail.rs:17:1 | LL | #[derive(Copy)] | ^^^^^^^^^^^^^^^ not applicable here @@ -7,7 +7,7 @@ LL | mod n {} | -------- not a `struct`, `enum` or `union` error[E0658]: non-inline modules in proc macro input are unstable - --> $DIR/attributes-on-modules-fail.rs:20:1 + --> $DIR/attributes-on-modules-fail.rs:21:1 | LL | mod module; | ^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | mod module; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: non-inline modules in proc macro input are unstable - --> $DIR/attributes-on-modules-fail.rs:24:5 + --> $DIR/attributes-on-modules-fail.rs:25:5 | LL | mod inner; | ^^^^^^^^^^ @@ -27,7 +27,7 @@ LL | mod inner; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: non-inline modules in proc macro input are unstable - --> $DIR/attributes-on-modules-fail.rs:33:9 + --> $DIR/attributes-on-modules-fail.rs:34:9 | LL | mod inner; | ^^^^^^^^^^ @@ -37,7 +37,7 @@ LL | mod inner; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: non-inline modules in proc macro input are unstable - --> $DIR/attributes-on-modules-fail.rs:42:5 + --> $DIR/attributes-on-modules-fail.rs:43:5 | LL | mod inner; | ^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | mod inner; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0412]: cannot find type `Y` in this scope - --> $DIR/attributes-on-modules-fail.rs:10:14 + --> $DIR/attributes-on-modules-fail.rs:11:14 | LL | type A = Y; | ^ not found in this scope @@ -58,7 +58,7 @@ LL + use Y; | error[E0412]: cannot find type `X` in this scope - --> $DIR/attributes-on-modules-fail.rs:14:10 + --> $DIR/attributes-on-modules-fail.rs:15:10 | LL | type A = X; | ^ not found in this scope diff --git a/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs b/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs index 32136f79ff286..eb56293955c0c 100644 --- a/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs +++ b/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs @@ -1,3 +1,6 @@ +//@revisions: edition2015 edition2018 +//@[edition2015] edition:2015 +//@[edition2018] edition:2018 extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/duplicate.rs b/tests/ui/proc-macro/auxiliary/duplicate.rs index 0474aed22665f..02c73f4b1e8cf 100644 --- a/tests/ui/proc-macro/auxiliary/duplicate.rs +++ b/tests/ui/proc-macro/auxiliary/duplicate.rs @@ -1,3 +1,5 @@ +//@ edition:2015 + #![deny(unused)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/generate-mod.rs b/tests/ui/proc-macro/auxiliary/generate-mod.rs index 62710bd1e2df4..81ea2945818cc 100644 --- a/tests/ui/proc-macro/auxiliary/generate-mod.rs +++ b/tests/ui/proc-macro/auxiliary/generate-mod.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-pass //@ ignore-pass diff --git a/tests/ui/proc-macro/auxiliary/mixed-site-span.rs b/tests/ui/proc-macro/auxiliary/mixed-site-span.rs index 18df712debc77..63ec0508a9735 100644 --- a/tests/ui/proc-macro/auxiliary/mixed-site-span.rs +++ b/tests/ui/proc-macro/auxiliary/mixed-site-span.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/token-site-span.rs b/tests/ui/proc-macro/auxiliary/token-site-span.rs index 39ad8368a5007..60718c368e347 100644 --- a/tests/ui/proc-macro/auxiliary/token-site-span.rs +++ b/tests/ui/proc-macro/auxiliary/token-site-span.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Testing token span hygiene. //@ proc-macro: mixed-site-span.rs diff --git a/tests/ui/proc-macro/derive-helper-shadowing.edition2015.stderr b/tests/ui/proc-macro/derive-helper-shadowing.edition2015.stderr new file mode 100644 index 0000000000000..921284cd54583 --- /dev/null +++ b/tests/ui/proc-macro/derive-helper-shadowing.edition2015.stderr @@ -0,0 +1,78 @@ +error: cannot find attribute `empty_helper` in this scope + --> $DIR/derive-helper-shadowing.rs:41:22 + | +LL | #[derive(GenHelperUse)] + | ^^^^^^^^^^^^ + | + = note: `empty_helper` is an attribute that can be used by the derive macro `Empty`, you might be missing a `derive` attribute + = note: this error originates in the derive macro `GenHelperUse` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider importing this attribute macro through its public re-export + | +LL + use empty_helper; + | + +error: cannot find attribute `empty_helper` in this scope + --> $DIR/derive-helper-shadowing.rs:17:11 + | +LL | #[empty_helper] + | ^^^^^^^^^^^^ +... +LL | gen_helper_use!(); + | ----------------- in this macro invocation + | + = note: `empty_helper` is an attribute that can be used by the derive macro `Empty`, you might be missing a `derive` attribute + = note: this error originates in the macro `gen_helper_use` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider importing this attribute macro through its public re-export + | +LL + use empty_helper; + | + +error[E0659]: `empty_helper` is ambiguous + --> $DIR/derive-helper-shadowing.rs:22:3 + | +LL | #[empty_helper] + | ^^^^^^^^^^^^ ambiguous name + | + = note: ambiguous because of a name conflict with a derive helper attribute +note: `empty_helper` could refer to the derive helper attribute defined here + --> $DIR/derive-helper-shadowing.rs:25:10 + | +LL | #[derive(Empty)] + | ^^^^^ +note: `empty_helper` could also refer to the attribute macro imported here + --> $DIR/derive-helper-shadowing.rs:13:5 + | +LL | use test_macros::empty_attr as empty_helper; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: use `crate::empty_helper` to refer to this attribute macro unambiguously + +error: derive helper attribute is used before it is introduced + --> $DIR/derive-helper-shadowing.rs:22:3 + | +LL | #[empty_helper] + | ^^^^^^^^^^^^ +... +LL | #[derive(Empty)] + | ----- the attribute is introduced here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #79202 + = note: `#[deny(legacy_derive_helpers)]` (part of `#[deny(future_incompatible)]`) on by default + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0659`. +Future incompatibility report: Future breakage diagnostic: +error: derive helper attribute is used before it is introduced + --> $DIR/derive-helper-shadowing.rs:22:3 + | +LL | #[empty_helper] + | ^^^^^^^^^^^^ +... +LL | #[derive(Empty)] + | ----- the attribute is introduced here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #79202 + = note: `#[deny(legacy_derive_helpers)]` (part of `#[deny(future_incompatible)]`) on by default + diff --git a/tests/ui/proc-macro/derive-helper-shadowing.stderr b/tests/ui/proc-macro/derive-helper-shadowing.edition2018.stderr similarity index 87% rename from tests/ui/proc-macro/derive-helper-shadowing.stderr rename to tests/ui/proc-macro/derive-helper-shadowing.edition2018.stderr index 90b42e8d6e228..1e430d154c3e3 100644 --- a/tests/ui/proc-macro/derive-helper-shadowing.stderr +++ b/tests/ui/proc-macro/derive-helper-shadowing.edition2018.stderr @@ -1,17 +1,17 @@ error: cannot use a derive helper attribute through an import - --> $DIR/derive-helper-shadowing.rs:43:15 + --> $DIR/derive-helper-shadowing.rs:45:15 | LL | #[renamed] | ^^^^^^^ | note: the derive helper attribute imported here - --> $DIR/derive-helper-shadowing.rs:42:17 + --> $DIR/derive-helper-shadowing.rs:44:17 | LL | use empty_helper as renamed; | ^^^^^^^^^^^^^^^^^^^^^^^ error: cannot find attribute `empty_helper` in this scope - --> $DIR/derive-helper-shadowing.rs:39:22 + --> $DIR/derive-helper-shadowing.rs:41:22 | LL | #[derive(GenHelperUse)] | ^^^^^^^^^^^^ @@ -20,11 +20,11 @@ LL | #[derive(GenHelperUse)] = note: this error originates in the derive macro `GenHelperUse` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this attribute macro through its public re-export | -LL + use empty_helper; +LL + use crate::empty_helper; | error: cannot find attribute `empty_helper` in this scope - --> $DIR/derive-helper-shadowing.rs:15:11 + --> $DIR/derive-helper-shadowing.rs:17:11 | LL | #[empty_helper] | ^^^^^^^^^^^^ @@ -40,26 +40,26 @@ LL + use crate::empty_helper; | error[E0659]: `empty_helper` is ambiguous - --> $DIR/derive-helper-shadowing.rs:20:3 + --> $DIR/derive-helper-shadowing.rs:22:3 | LL | #[empty_helper] | ^^^^^^^^^^^^ ambiguous name | = note: ambiguous because of a name conflict with a derive helper attribute note: `empty_helper` could refer to the derive helper attribute defined here - --> $DIR/derive-helper-shadowing.rs:23:10 + --> $DIR/derive-helper-shadowing.rs:25:10 | LL | #[derive(Empty)] | ^^^^^ note: `empty_helper` could also refer to the attribute macro imported here - --> $DIR/derive-helper-shadowing.rs:11:5 + --> $DIR/derive-helper-shadowing.rs:13:5 | LL | use test_macros::empty_attr as empty_helper; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: use `crate::empty_helper` to refer to this attribute macro unambiguously error: derive helper attribute is used before it is introduced - --> $DIR/derive-helper-shadowing.rs:20:3 + --> $DIR/derive-helper-shadowing.rs:22:3 | LL | #[empty_helper] | ^^^^^^^^^^^^ @@ -76,7 +76,7 @@ error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0659`. Future incompatibility report: Future breakage diagnostic: error: derive helper attribute is used before it is introduced - --> $DIR/derive-helper-shadowing.rs:20:3 + --> $DIR/derive-helper-shadowing.rs:22:3 | LL | #[empty_helper] | ^^^^^^^^^^^^ diff --git a/tests/ui/proc-macro/derive-helper-shadowing.rs b/tests/ui/proc-macro/derive-helper-shadowing.rs index 5ddd914d1026c..324d2477869e2 100644 --- a/tests/ui/proc-macro/derive-helper-shadowing.rs +++ b/tests/ui/proc-macro/derive-helper-shadowing.rs @@ -1,4 +1,6 @@ -//@ edition:2018 +//@revisions: edition2015 edition2018 +//@[edition2015] edition:2015 +//@[edition2018] edition:2018 //@ proc-macro: test-macros.rs //@ proc-macro: derive-helper-shadowing.rs //@ ignore-backends: gcc @@ -40,7 +42,7 @@ struct S { struct Owo; use empty_helper as renamed; - #[renamed] //~ ERROR cannot use a derive helper attribute through an import + #[renamed] //[edition2018]~ ERROR cannot use a derive helper attribute through an import struct Wow; } diff --git a/tests/ui/proc-macro/generate-mod.rs b/tests/ui/proc-macro/generate-mod.rs index 0a1629e75ec17..23f231047e7fd 100644 --- a/tests/ui/proc-macro/generate-mod.rs +++ b/tests/ui/proc-macro/generate-mod.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Modules generated by transparent proc macros still acts as barriers for names (issue #50504). //@ proc-macro: generate-mod.rs diff --git a/tests/ui/proc-macro/generate-mod.stderr b/tests/ui/proc-macro/generate-mod.stderr index 03cf8c35188ac..47210c63c2b29 100644 --- a/tests/ui/proc-macro/generate-mod.stderr +++ b/tests/ui/proc-macro/generate-mod.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `FromOutside` in this scope - --> $DIR/generate-mod.rs:10:1 + --> $DIR/generate-mod.rs:11:1 | LL | generate_mod::check!(); | ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope @@ -9,7 +9,7 @@ LL | generate_mod::check!(); = note: this error originates in the macro `generate_mod::check` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Outer` in this scope - --> $DIR/generate-mod.rs:10:1 + --> $DIR/generate-mod.rs:11:1 | LL | generate_mod::check!(); | ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope @@ -19,7 +19,7 @@ LL | generate_mod::check!(); = note: this error originates in the macro `generate_mod::check` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `FromOutside` in this scope - --> $DIR/generate-mod.rs:13:1 + --> $DIR/generate-mod.rs:14:1 | LL | #[generate_mod::check_attr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope @@ -29,7 +29,7 @@ LL | #[generate_mod::check_attr] = note: this error originates in the attribute macro `generate_mod::check_attr` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `OuterAttr` in this scope - --> $DIR/generate-mod.rs:13:1 + --> $DIR/generate-mod.rs:14:1 | LL | #[generate_mod::check_attr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope @@ -39,7 +39,7 @@ LL | #[generate_mod::check_attr] = note: this error originates in the attribute macro `generate_mod::check_attr` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find type `FromOutside` in this scope - --> $DIR/generate-mod.rs:17:10 + --> $DIR/generate-mod.rs:18:10 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -50,7 +50,7 @@ LL | #[derive(generate_mod::CheckDerive)] = note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find type `OuterDerive` in this scope - --> $DIR/generate-mod.rs:17:10 + --> $DIR/generate-mod.rs:18:10 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -60,7 +60,7 @@ LL | #[derive(generate_mod::CheckDerive)] = note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find type `FromOutside` in this scope - --> $DIR/generate-mod.rs:24:14 + --> $DIR/generate-mod.rs:25:14 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -70,7 +70,7 @@ LL | #[derive(generate_mod::CheckDerive)] = note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find type `OuterDerive` in this scope - --> $DIR/generate-mod.rs:24:14 + --> $DIR/generate-mod.rs:25:14 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -84,7 +84,7 @@ error: aborting due to 8 previous errors For more information about this error, try `rustc --explain E0412`. Future incompatibility report: Future breakage diagnostic: error: cannot find type `FromOutside` in this scope - --> $DIR/generate-mod.rs:17:10 + --> $DIR/generate-mod.rs:18:10 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -96,7 +96,7 @@ LL | #[derive(generate_mod::CheckDerive)] Future breakage diagnostic: error: cannot find type `OuterDerive` in this scope - --> $DIR/generate-mod.rs:17:10 + --> $DIR/generate-mod.rs:18:10 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -108,7 +108,7 @@ LL | #[derive(generate_mod::CheckDerive)] Future breakage diagnostic: error: cannot find type `FromOutside` in this scope - --> $DIR/generate-mod.rs:24:14 + --> $DIR/generate-mod.rs:25:14 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -120,7 +120,7 @@ LL | #[derive(generate_mod::CheckDerive)] Future breakage diagnostic: error: cannot find type `OuterDerive` in this scope - --> $DIR/generate-mod.rs:24:14 + --> $DIR/generate-mod.rs:25:14 | LL | #[derive(generate_mod::CheckDerive)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -132,7 +132,7 @@ LL | #[derive(generate_mod::CheckDerive)] Future breakage diagnostic: warning: cannot find type `FromOutside` in this scope - --> $DIR/generate-mod.rs:31:10 + --> $DIR/generate-mod.rs:32:10 | LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import @@ -143,7 +143,7 @@ LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed Future breakage diagnostic: warning: cannot find type `OuterDeriveLint` in this scope - --> $DIR/generate-mod.rs:31:10 + --> $DIR/generate-mod.rs:32:10 | LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import diff --git a/tests/ui/proc-macro/macro-crate-multi-decorator.rs b/tests/ui/proc-macro/macro-crate-multi-decorator.rs index e247c9526a4c9..68d4c8369382f 100644 --- a/tests/ui/proc-macro/macro-crate-multi-decorator.rs +++ b/tests/ui/proc-macro/macro-crate-multi-decorator.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // The duplicate macro will create a copy of the item with the given identifier. //@ check-pass diff --git a/tests/ui/proc-macro/mixed-site-span.rs b/tests/ui/proc-macro/mixed-site-span.rs index 98a022632cd59..b61cfe4bd8b88 100644 --- a/tests/ui/proc-macro/mixed-site-span.rs +++ b/tests/ui/proc-macro/mixed-site-span.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Proc macros using `mixed_site` spans exhibit usual properties of `macro_rules` hygiene. //@ aux-build: token-site-span.rs diff --git a/tests/ui/proc-macro/mixed-site-span.stderr b/tests/ui/proc-macro/mixed-site-span.stderr index 2d2d55fe148d5..9e255548c6bd4 100644 --- a/tests/ui/proc-macro/mixed-site-span.stderr +++ b/tests/ui/proc-macro/mixed-site-span.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:48:5 + --> $DIR/mixed-site-span.rs:49:5 | LL | invoke_with_crate!{input proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -7,7 +7,7 @@ LL | invoke_with_crate!{input proc_macro_item} = note: this error originates in the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:49:5 + --> $DIR/mixed-site-span.rs:50:5 | LL | invoke_with_ident!{input proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -15,7 +15,7 @@ LL | invoke_with_ident!{input proc_macro_item} = note: this error originates in the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:50:5 + --> $DIR/mixed-site-span.rs:51:5 | LL | invoke_with_crate!{call proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -23,7 +23,7 @@ LL | invoke_with_crate!{call proc_macro_item} = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:51:5 + --> $DIR/mixed-site-span.rs:52:5 | LL | invoke_with_ident!{call proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -31,7 +31,7 @@ LL | invoke_with_ident!{call proc_macro_item} = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:52:5 + --> $DIR/mixed-site-span.rs:53:5 | LL | invoke_with_ident!{hello call proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -39,7 +39,7 @@ LL | invoke_with_ident!{hello call proc_macro_item} = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate::proc_macro_item` - --> $DIR/mixed-site-span.rs:55:5 + --> $DIR/mixed-site-span.rs:56:5 | LL | invoke_with_ident!{krate input proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------^ @@ -50,7 +50,7 @@ LL | invoke_with_ident!{krate input proc_macro_item} = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate::proc_macro_item` - --> $DIR/mixed-site-span.rs:56:5 + --> $DIR/mixed-site-span.rs:57:5 | LL | with_crate!{krate input proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^---------------^ @@ -61,7 +61,7 @@ LL | with_crate!{krate input proc_macro_item} = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:57:5 + --> $DIR/mixed-site-span.rs:58:5 | LL | with_crate!{krate call proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^---------------^ @@ -72,7 +72,7 @@ LL | with_crate!{krate call proc_macro_item} = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:61:28 + --> $DIR/mixed-site-span.rs:62:28 | LL | invoke_with_ident!{$crate input proc_macro_item} | ^^^^^^ --------------- help: a similar name exists in the module: `proc_macro_rules` @@ -85,7 +85,7 @@ LL | test!(); = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:62:21 + --> $DIR/mixed-site-span.rs:63:21 | LL | with_crate!{$crate input proc_macro_item} | ^^^^^^ --------------- help: a similar name exists in the module: `proc_macro_rules` @@ -98,7 +98,7 @@ LL | test!(); = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:63:9 + --> $DIR/mixed-site-span.rs:64:9 | LL | with_crate!{$crate call proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^---------------^ @@ -112,7 +112,7 @@ LL | test!(); = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:68:5 + --> $DIR/mixed-site-span.rs:69:5 | LL | test!(); | ^^^^^^^ no `proc_macro_item` in the root @@ -120,33 +120,33 @@ LL | test!(); = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate::TokenItem` - --> $DIR/mixed-site-span.rs:88:5 + --> $DIR/mixed-site-span.rs:89:5 | LL | invoke_with_ident!{krate input TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/mixed-site-span.rs:59:34 + --> $DIR/auxiliary/mixed-site-span.rs:60:34 | LL | quote!(use $krate::$ident as token_site_span::TokenItem as _;) | +++++++++++++++++++++++++++++ error[E0432]: unresolved import `$crate::TokenItem` - --> $DIR/mixed-site-span.rs:89:5 + --> $DIR/mixed-site-span.rs:90:5 | LL | with_crate!{krate input TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/mixed-site-span.rs:59:34 + --> $DIR/auxiliary/mixed-site-span.rs:60:34 | LL | quote!(use $krate::$ident as token_site_span::TokenItem as _;) | +++++++++++++++++++++++++++++ error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:90:5 + --> $DIR/mixed-site-span.rs:91:5 | LL | with_crate!{krate call TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root @@ -159,49 +159,49 @@ LL + token_site_span::TokenItem as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:93:5 + --> $DIR/mixed-site-span.rs:94:5 | LL | invoke_with_crate!{mixed TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:13:30 + --> $DIR/auxiliary/token-site-span.rs:14:30 | LL - ($s:ident $i:ident) => { with_crate!{$crate $s $i} }; LL + ($s:ident $i:ident) => { token_site_span::TokenItem as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:94:5 + --> $DIR/mixed-site-span.rs:95:5 | LL | invoke_with_ident!{mixed TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:18:30 + --> $DIR/auxiliary/token-site-span.rs:19:30 | LL - ($s:ident $i:ident) => { with_crate!{krate $s $i} }; LL + ($s:ident $i:ident) => { token_site_span::TokenItem as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:95:5 + --> $DIR/mixed-site-span.rs:96:5 | LL | invoke_with_ident!{krate mixed TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:19:39 + --> $DIR/auxiliary/token-site-span.rs:20:39 | LL - ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} }; LL + ($m:ident $s:ident $i:ident) => { token_site_span::TokenItem as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:96:5 + --> $DIR/mixed-site-span.rs:97:5 | LL | with_crate!{krate mixed TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root @@ -214,7 +214,7 @@ LL + token_site_span::TokenItem as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:100:28 + --> $DIR/mixed-site-span.rs:101:28 | LL | invoke_with_ident!{$crate input TokenItem} | ^^^^^^ no `TokenItem` in the root @@ -230,7 +230,7 @@ LL + invoke_with_ident!{token_site_span::TokenItem as _ input TokenItem} | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:101:21 + --> $DIR/mixed-site-span.rs:102:21 | LL | with_crate!{$crate input TokenItem} | ^^^^^^ no `TokenItem` in the root @@ -246,7 +246,7 @@ LL + with_crate!{token_site_span::TokenItem as _ input TokenItem} | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:102:9 + --> $DIR/mixed-site-span.rs:103:9 | LL | with_crate!{$crate call TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root @@ -262,21 +262,21 @@ LL + token_site_span::TokenItem as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:109:5 + --> $DIR/mixed-site-span.rs:110:5 | LL | test!(); | ^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:19:39 + --> $DIR/auxiliary/token-site-span.rs:20:39 | LL - ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} }; LL + ($m:ident $s:ident $i:ident) => { token_site_span::TokenItem as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:106:9 + --> $DIR/mixed-site-span.rs:107:9 | LL | with_crate!{$crate mixed TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root @@ -292,77 +292,77 @@ LL + token_site_span::TokenItem as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:130:5 + --> $DIR/mixed-site-span.rs:131:5 | LL | invoke_with_crate!{input ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:13:42 + --> $DIR/auxiliary/token-site-span.rs:14:42 | LL - ($s:ident $i:ident) => { with_crate!{$crate $s $i} }; LL + ($s:ident $i:ident) => { with_crate!{ItemUse as _ $s $i} }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:131:5 + --> $DIR/mixed-site-span.rs:132:5 | LL | invoke_with_ident!{input ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:18:42 + --> $DIR/auxiliary/token-site-span.rs:19:42 | LL - ($s:ident $i:ident) => { with_crate!{krate $s $i} }; LL + ($s:ident $i:ident) => { with_crate!{ItemUse as _ $s $i} }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:134:5 + --> $DIR/mixed-site-span.rs:135:5 | LL | invoke_with_crate!{mixed ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:13:30 + --> $DIR/auxiliary/token-site-span.rs:14:30 | LL - ($s:ident $i:ident) => { with_crate!{$crate $s $i} }; LL + ($s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:135:5 + --> $DIR/mixed-site-span.rs:136:5 | LL | invoke_with_ident!{mixed ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:18:30 + --> $DIR/auxiliary/token-site-span.rs:19:30 | LL - ($s:ident $i:ident) => { with_crate!{krate $s $i} }; LL + ($s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:136:5 + --> $DIR/mixed-site-span.rs:137:5 | LL | invoke_with_ident!{krate mixed ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:19:39 + --> $DIR/auxiliary/token-site-span.rs:20:39 | LL - ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} }; LL + ($m:ident $s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:137:5 + --> $DIR/mixed-site-span.rs:138:5 | LL | with_crate!{krate mixed ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -375,63 +375,63 @@ LL + ItemUse as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:139:5 + --> $DIR/mixed-site-span.rs:140:5 | LL | invoke_with_crate!{call ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:13:30 + --> $DIR/auxiliary/token-site-span.rs:14:30 | LL - ($s:ident $i:ident) => { with_crate!{$crate $s $i} }; LL + ($s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:140:5 + --> $DIR/mixed-site-span.rs:141:5 | LL | invoke_with_ident!{call ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:18:30 + --> $DIR/auxiliary/token-site-span.rs:19:30 | LL - ($s:ident $i:ident) => { with_crate!{krate $s $i} }; LL + ($s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:141:5 + --> $DIR/mixed-site-span.rs:142:5 | LL | invoke_with_ident!{hello call ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:19:39 + --> $DIR/auxiliary/token-site-span.rs:20:39 | LL - ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} }; LL + ($m:ident $s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:149:5 + --> $DIR/mixed-site-span.rs:150:5 | LL | test!(); | ^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:19:39 + --> $DIR/auxiliary/token-site-span.rs:20:39 | LL - ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} }; LL + ($m:ident $s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:145:9 + --> $DIR/mixed-site-span.rs:146:9 | LL | with_crate!{$crate mixed ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -447,21 +447,21 @@ LL + ItemUse as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:149:5 + --> $DIR/mixed-site-span.rs:150:5 | LL | test!(); | ^^^^^^^ no `ItemUse` in the root | = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:19:39 + --> $DIR/auxiliary/token-site-span.rs:20:39 | LL - ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} }; LL + ($m:ident $s:ident $i:ident) => { ItemUse as _ }; | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:154:1 + --> $DIR/mixed-site-span.rs:155:1 | LL | use_input_crate!{proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -469,7 +469,7 @@ LL | use_input_crate!{proc_macro_item} = note: this error originates in the macro `use_input_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:155:1 + --> $DIR/mixed-site-span.rs:156:1 | LL | use_input_krate!{proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -477,7 +477,7 @@ LL | use_input_krate!{proc_macro_item} = note: this error originates in the macro `use_input_krate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:158:1 + --> $DIR/mixed-site-span.rs:159:1 | LL | use_call_crate!{proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -485,7 +485,7 @@ LL | use_call_crate!{proc_macro_item} = note: this error originates in the macro `use_call_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:159:1 + --> $DIR/mixed-site-span.rs:160:1 | LL | use_call_krate!{proc_macro_item} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root @@ -493,35 +493,35 @@ LL | use_call_krate!{proc_macro_item} = note: this error originates in the macro `use_call_krate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:164:1 + --> $DIR/mixed-site-span.rs:165:1 | LL | use_mixed_crate!{TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `use_mixed_crate` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:24:5 + --> $DIR/auxiliary/token-site-span.rs:25:5 | LL - declare_macro!{$crate mixed use_mixed_crate} LL + token_site_span::TokenItem as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:165:1 + --> $DIR/mixed-site-span.rs:166:1 | LL | use_mixed_krate!{TokenItem} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root | = note: this error originates in the macro `use_mixed_krate` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this struct instead - --> $DIR/auxiliary/token-site-span.rs:29:1 + --> $DIR/auxiliary/token-site-span.rs:30:1 | LL - declare_macro!{krate mixed use_mixed_krate} LL + token_site_span::TokenItem as _ | error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:170:1 + --> $DIR/mixed-site-span.rs:171:1 | LL | use_input_crate!{ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -529,7 +529,7 @@ LL | use_input_crate!{ItemUse} = note: this error originates in the macro `use_input_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:171:1 + --> $DIR/mixed-site-span.rs:172:1 | LL | use_input_krate!{ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -537,7 +537,7 @@ LL | use_input_krate!{ItemUse} = note: this error originates in the macro `use_input_krate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:172:1 + --> $DIR/mixed-site-span.rs:173:1 | LL | use_mixed_crate!{ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -545,7 +545,7 @@ LL | use_mixed_crate!{ItemUse} = note: this error originates in the macro `use_mixed_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:173:1 + --> $DIR/mixed-site-span.rs:174:1 | LL | use_mixed_krate!{ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -553,7 +553,7 @@ LL | use_mixed_krate!{ItemUse} = note: this error originates in the macro `use_mixed_krate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:174:1 + --> $DIR/mixed-site-span.rs:175:1 | LL | use_call_crate!{ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -561,7 +561,7 @@ LL | use_call_crate!{ItemUse} = note: this error originates in the macro `use_call_crate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `$crate` - --> $DIR/mixed-site-span.rs:175:1 + --> $DIR/mixed-site-span.rs:176:1 | LL | use_call_krate!{ItemUse} | ^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root @@ -569,7 +569,7 @@ LL | use_call_krate!{ItemUse} = note: this error originates in the macro `use_call_krate` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0426]: use of undeclared label `'label_use` - --> $DIR/mixed-site-span.rs:22:9 + --> $DIR/mixed-site-span.rs:23:9 | LL | proc_macro_rules!(); | ^^^^^^^^^^^^^^^^^^^ undeclared label `'label_use` @@ -577,7 +577,7 @@ LL | proc_macro_rules!(); = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `ItemUse` in crate `$crate` - --> $DIR/mixed-site-span.rs:22:9 + --> $DIR/mixed-site-span.rs:23:9 | LL | proc_macro_rules!(); | ^^^^^^^^^^^^^^^^^^^ not found in `$crate` @@ -589,7 +589,7 @@ LL + use ItemUse; | error[E0425]: cannot find value `local_use` in this scope - --> $DIR/mixed-site-span.rs:22:9 + --> $DIR/mixed-site-span.rs:23:9 | LL | proc_macro_rules!(); | ^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def` @@ -597,7 +597,7 @@ LL | proc_macro_rules!(); = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `local_def` in this scope - --> $DIR/mixed-site-span.rs:27:9 + --> $DIR/mixed-site-span.rs:28:9 | LL | local_def; | ^^^^^^^^^ help: a local variable with a similar name exists: `local_use` diff --git a/tests/ui/range/range-inclusive-pattern-precedence.fixed b/tests/ui/range/range-inclusive-pattern-precedence.fixed index e08d8a025b5d0..06cff01aa9783 100644 --- a/tests/ui/range/range-inclusive-pattern-precedence.fixed +++ b/tests/ui/range/range-inclusive-pattern-precedence.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 // In expression, `&a..=b` is treated as `(&a)..=(b)` and `box a..=b` is // `(box a)..=(b)`. In a pattern, however, `&a..=b` means `&(a..=b)`. This may // lead to confusion. diff --git a/tests/ui/range/range-inclusive-pattern-precedence.rs b/tests/ui/range/range-inclusive-pattern-precedence.rs index 47e484442e989..87193d9cc5070 100644 --- a/tests/ui/range/range-inclusive-pattern-precedence.rs +++ b/tests/ui/range/range-inclusive-pattern-precedence.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // In expression, `&a..=b` is treated as `(&a)..=(b)` and `box a..=b` is // `(box a)..=(b)`. In a pattern, however, `&a..=b` means `&(a..=b)`. This may // lead to confusion. diff --git a/tests/ui/range/range-inclusive-pattern-precedence.stderr b/tests/ui/range/range-inclusive-pattern-precedence.stderr index 15237b0a499c1..a37b259c50760 100644 --- a/tests/ui/range/range-inclusive-pattern-precedence.stderr +++ b/tests/ui/range/range-inclusive-pattern-precedence.stderr @@ -1,5 +1,5 @@ error: the range pattern here has ambiguous interpretation - --> $DIR/range-inclusive-pattern-precedence.rs:15:10 + --> $DIR/range-inclusive-pattern-precedence.rs:16:10 | LL | &10..=15 => {} | ^^^^^^^ @@ -10,7 +10,7 @@ LL | &(10..=15) => {} | + + warning: `...` range patterns are deprecated - --> $DIR/range-inclusive-pattern-precedence.rs:11:9 + --> $DIR/range-inclusive-pattern-precedence.rs:12:9 | LL | &0...9 => {} | ^^^^^^ help: use `..=` for an inclusive range: `&(0..=9)` @@ -18,7 +18,7 @@ LL | &0...9 => {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/range-inclusive-pattern-precedence.rs:7:9 + --> $DIR/range-inclusive-pattern-precedence.rs:8:9 | LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/range/range-inclusive-pattern-precedence2.rs b/tests/ui/range/range-inclusive-pattern-precedence2.rs index bede9c579766f..39f026201bf54 100644 --- a/tests/ui/range/range-inclusive-pattern-precedence2.rs +++ b/tests/ui/range/range-inclusive-pattern-precedence2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // We are going to disallow `&a..=b` and `box a..=b` in a pattern. However, the // older ... syntax is still allowed as a stability guarantee. diff --git a/tests/ui/range/range-inclusive-pattern-precedence2.stderr b/tests/ui/range/range-inclusive-pattern-precedence2.stderr index 4c5016b8ae45d..2415ef0572dc1 100644 --- a/tests/ui/range/range-inclusive-pattern-precedence2.stderr +++ b/tests/ui/range/range-inclusive-pattern-precedence2.stderr @@ -1,5 +1,5 @@ error: the range pattern here has ambiguous interpretation - --> $DIR/range-inclusive-pattern-precedence2.rs:14:13 + --> $DIR/range-inclusive-pattern-precedence2.rs:15:13 | LL | box 10..=15 => {} | ^^^^^^^ @@ -10,7 +10,7 @@ LL | box (10..=15) => {} | + + warning: `...` range patterns are deprecated - --> $DIR/range-inclusive-pattern-precedence2.rs:10:14 + --> $DIR/range-inclusive-pattern-precedence2.rs:11:14 | LL | box 0...9 => {} | ^^^ help: use `..=` for an inclusive range @@ -18,7 +18,7 @@ LL | box 0...9 => {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/range-inclusive-pattern-precedence2.rs:5:9 + --> $DIR/range-inclusive-pattern-precedence2.rs:6:9 | LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/resolve/112590-2.fixed b/tests/ui/resolve/112590-2.fixed index d88bc4b47e204..bbc8d4b2954a1 100644 --- a/tests/ui/resolve/112590-2.fixed +++ b/tests/ui/resolve/112590-2.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix use std::vec; diff --git a/tests/ui/resolve/112590-2.rs b/tests/ui/resolve/112590-2.rs index d8aaa5a6cc121..97d0b0bf2a947 100644 --- a/tests/ui/resolve/112590-2.rs +++ b/tests/ui/resolve/112590-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix mod foo { pub mod bar { diff --git a/tests/ui/resolve/112590-2.stderr b/tests/ui/resolve/112590-2.stderr index b39b44396d730..28d23ccf85375 100644 --- a/tests/ui/resolve/112590-2.stderr +++ b/tests/ui/resolve/112590-2.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: could not find `baf` in `foo` - --> $DIR/112590-2.rs:12:39 + --> $DIR/112590-2.rs:13:39 | LL | let _: Vec = super::foo::baf::baz::MyVec::new(); | ^^^ could not find `baf` in `foo` @@ -15,7 +15,7 @@ LL + let _: Vec = MyVec::new(); | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fox` - --> $DIR/112590-2.rs:18:27 + --> $DIR/112590-2.rs:19:27 | LL | let _: Vec = fox::bar::baz::MyVec::new(); | ^^^ use of unresolved module or unlinked crate `fox` @@ -32,7 +32,7 @@ LL + let _: Vec = MyVec::new(); | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec` - --> $DIR/112590-2.rs:24:15 + --> $DIR/112590-2.rs:25:15 | LL | type _B = vec::Vec::; | ^^^ use of unresolved module or unlinked crate `vec` @@ -44,7 +44,7 @@ LL + use std::vec; | error[E0433]: failed to resolve: could not find `sync_error` in `std` - --> $DIR/112590-2.rs:25:19 + --> $DIR/112590-2.rs:26:19 | LL | let _t = std::sync_error::atomic::AtomicBool::new(true); | ^^^^^^^^^^ could not find `sync_error` in `std` @@ -60,7 +60,7 @@ LL + let _t = AtomicBool::new(true); | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec` - --> $DIR/112590-2.rs:23:24 + --> $DIR/112590-2.rs:24:24 | LL | let _t: Vec = vec::new(); | ^^^ diff --git a/tests/ui/resolve/crate-called-as-function.rs b/tests/ui/resolve/crate-called-as-function.rs index 30922d923f48b..747a41312987d 100644 --- a/tests/ui/resolve/crate-called-as-function.rs +++ b/tests/ui/resolve/crate-called-as-function.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn main() { ::foo() //~ ERROR cannot find external crate `foo` in the crate root } diff --git a/tests/ui/resolve/crate-called-as-function.stderr b/tests/ui/resolve/crate-called-as-function.stderr index 1d6eb8ad6f5e0..a7522eb1aebbd 100644 --- a/tests/ui/resolve/crate-called-as-function.stderr +++ b/tests/ui/resolve/crate-called-as-function.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find external crate `foo` in the crate root - --> $DIR/crate-called-as-function.rs:2:7 + --> $DIR/crate-called-as-function.rs:3:7 | LL | ::foo() | ^^^ not found in the crate root diff --git a/tests/ui/resolve/enum-expected-value-suggest-variants.rs b/tests/ui/resolve/enum-expected-value-suggest-variants.rs index 9f86a0a1ecc76..c0965ce5e147d 100644 --- a/tests/ui/resolve/enum-expected-value-suggest-variants.rs +++ b/tests/ui/resolve/enum-expected-value-suggest-variants.rs @@ -1,3 +1,4 @@ +//@ edition:2015 enum Foo { //~^ HELP consider importing this tuple variant A(u32), diff --git a/tests/ui/resolve/enum-expected-value-suggest-variants.stderr b/tests/ui/resolve/enum-expected-value-suggest-variants.stderr index 548a4c0e59320..4b0f291a0fc2d 100644 --- a/tests/ui/resolve/enum-expected-value-suggest-variants.stderr +++ b/tests/ui/resolve/enum-expected-value-suggest-variants.stderr @@ -1,11 +1,11 @@ error[E0423]: expected value, found enum `Foo` - --> $DIR/enum-expected-value-suggest-variants.rs:19:18 + --> $DIR/enum-expected-value-suggest-variants.rs:20:18 | LL | let _: Foo = Foo.A(0); | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:1:1 + --> $DIR/enum-expected-value-suggest-variants.rs:2:1 | LL | / enum Foo { LL | | @@ -20,13 +20,13 @@ LL + let _: Foo = Foo::A(0); | error[E0423]: expected value, found enum `Foo` - --> $DIR/enum-expected-value-suggest-variants.rs:23:18 + --> $DIR/enum-expected-value-suggest-variants.rs:24:18 | LL | let _: Foo = Foo.Bad(0); | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:1:1 + --> $DIR/enum-expected-value-suggest-variants.rs:2:1 | LL | / enum Foo { LL | | @@ -44,13 +44,13 @@ LL + let _: Foo = (Foo::B(/* fields */)).Bad(0); | error[E0423]: expected value, found enum `Bar` - --> $DIR/enum-expected-value-suggest-variants.rs:32:18 + --> $DIR/enum-expected-value-suggest-variants.rs:33:18 | LL | let _: Bar = Bar.C(0); | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:7:1 + --> $DIR/enum-expected-value-suggest-variants.rs:8:1 | LL | / enum Bar { LL | | C(u32), @@ -66,13 +66,13 @@ LL + let _: Bar = Bar::C(0); | error[E0423]: expected value, found enum `Bar` - --> $DIR/enum-expected-value-suggest-variants.rs:36:18 + --> $DIR/enum-expected-value-suggest-variants.rs:37:18 | LL | let _: Bar = Bar.E; | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:7:1 + --> $DIR/enum-expected-value-suggest-variants.rs:8:1 | LL | / enum Bar { LL | | C(u32), @@ -88,13 +88,13 @@ LL + let _: Bar = Bar::E; | error[E0423]: expected value, found enum `Bar` - --> $DIR/enum-expected-value-suggest-variants.rs:40:18 + --> $DIR/enum-expected-value-suggest-variants.rs:41:18 | LL | let _: Bar = Bar.Bad(0); | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:7:1 + --> $DIR/enum-expected-value-suggest-variants.rs:8:1 | LL | / enum Bar { LL | | C(u32), @@ -119,13 +119,13 @@ LL + let _: Bar = (Bar::D(/* fields */)).Bad(0); | error[E0423]: expected value, found enum `Bar` - --> $DIR/enum-expected-value-suggest-variants.rs:45:18 + --> $DIR/enum-expected-value-suggest-variants.rs:46:18 | LL | let _: Bar = Bar.Bad; | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:7:1 + --> $DIR/enum-expected-value-suggest-variants.rs:8:1 | LL | / enum Bar { LL | | C(u32), @@ -150,7 +150,7 @@ LL + let _: Bar = (Bar::D(/* fields */)).Bad; | error[E0531]: cannot find tuple struct or tuple variant `A` in this scope - --> $DIR/enum-expected-value-suggest-variants.rs:51:9 + --> $DIR/enum-expected-value-suggest-variants.rs:52:9 | LL | A(..) => {} | ^ not found in this scope @@ -161,13 +161,13 @@ LL + use Foo::A; | error[E0532]: expected tuple struct or tuple variant, found enum `Foo` - --> $DIR/enum-expected-value-suggest-variants.rs:53:9 + --> $DIR/enum-expected-value-suggest-variants.rs:54:9 | LL | Foo(..) => {} | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:1:1 + --> $DIR/enum-expected-value-suggest-variants.rs:2:1 | LL | / enum Foo { LL | | @@ -183,13 +183,13 @@ LL | Foo::B(..) => {} | +++ error[E0423]: expected function, tuple struct or tuple variant, found enum `Foo` - --> $DIR/enum-expected-value-suggest-variants.rs:15:18 + --> $DIR/enum-expected-value-suggest-variants.rs:16:18 | LL | let _: Foo = Foo(0); | ^^^ | note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:1:1 + --> $DIR/enum-expected-value-suggest-variants.rs:2:1 | LL | / enum Foo { LL | | @@ -205,14 +205,14 @@ LL | let _: Foo = Foo::B(0); | +++ error[E0423]: expected function, tuple struct or tuple variant, found enum `Bar` - --> $DIR/enum-expected-value-suggest-variants.rs:27:18 + --> $DIR/enum-expected-value-suggest-variants.rs:28:18 | LL | let _: Bar = Bar(0); | ^^^ | = help: you might have meant to construct one of the enum's non-tuple variants note: the enum is defined here - --> $DIR/enum-expected-value-suggest-variants.rs:7:1 + --> $DIR/enum-expected-value-suggest-variants.rs:8:1 | LL | / enum Bar { LL | | C(u32), diff --git a/tests/ui/resolve/global-scope-resolution.rs b/tests/ui/resolve/global-scope-resolution.rs index 176bab36da7cd..becdacd4d9790 100644 --- a/tests/ui/resolve/global-scope-resolution.rs +++ b/tests/ui/resolve/global-scope-resolution.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //! Test global scope resolution with :: operator //@ run-pass diff --git a/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs index 431213e25e462..07012000238ca 100644 --- a/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs +++ b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![deny(ambiguous_glob_reexports)] pub mod foo { diff --git a/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr index 07e61dd8643d4..0ab2289dc41af 100644 --- a/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr +++ b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr @@ -1,25 +1,25 @@ error[E0659]: `A` is ambiguous - --> $DIR/issue-107563-ambiguous-glob-reexports.rs:25:24 + --> $DIR/issue-107563-ambiguous-glob-reexports.rs:26:24 | LL | pub use ambiguous::A; | ^ ambiguous name | = note: ambiguous because of multiple glob imports of a name in the same module note: `A` could refer to the type alias imported here - --> $DIR/issue-107563-ambiguous-glob-reexports.rs:19:13 + --> $DIR/issue-107563-ambiguous-glob-reexports.rs:20:13 | LL | pub use self::m1::*; | ^^^^^^^^^^^ = help: consider adding an explicit import of `A` to disambiguate note: `A` could also refer to the type alias imported here - --> $DIR/issue-107563-ambiguous-glob-reexports.rs:21:13 + --> $DIR/issue-107563-ambiguous-glob-reexports.rs:22:13 | LL | pub use self::m2::*; | ^^^^^^^^^^^ = help: consider adding an explicit import of `A` to disambiguate error: ambiguous glob re-exports - --> $DIR/issue-107563-ambiguous-glob-reexports.rs:12:9 + --> $DIR/issue-107563-ambiguous-glob-reexports.rs:13:9 | LL | pub use foo::*; | ^^^^^^ the name `X` in the type namespace is first re-exported here @@ -28,13 +28,13 @@ LL | pub use bar::*; | ------ but the name `X` in the type namespace is also re-exported here | note: the lint level is defined here - --> $DIR/issue-107563-ambiguous-glob-reexports.rs:1:9 + --> $DIR/issue-107563-ambiguous-glob-reexports.rs:2:9 | LL | #![deny(ambiguous_glob_reexports)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: ambiguous glob re-exports - --> $DIR/issue-107563-ambiguous-glob-reexports.rs:19:13 + --> $DIR/issue-107563-ambiguous-glob-reexports.rs:20:13 | LL | pub use self::m1::*; | ^^^^^^^^^^^ the name `A` in the type namespace is first re-exported here diff --git a/tests/ui/resolve/issue-116164.rs b/tests/ui/resolve/issue-116164.rs index d30c8f514b3d6..3ec643a1c9008 100644 --- a/tests/ui/resolve/issue-116164.rs +++ b/tests/ui/resolve/issue-116164.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![allow(unused_imports)] mod inner { diff --git a/tests/ui/resolve/issue-116164.stderr b/tests/ui/resolve/issue-116164.stderr index 8880242c19561..2f75cf179125b 100644 --- a/tests/ui/resolve/issue-116164.stderr +++ b/tests/ui/resolve/issue-116164.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `ExOne` in this scope - --> $DIR/issue-116164.rs:17:5 + --> $DIR/issue-116164.rs:18:5 | LL | ExOne; | ^^^^^ not found in this scope diff --git a/tests/ui/resolve/issue-16058.rs b/tests/ui/resolve/issue-16058.rs index 608edb82f025e..04f2e44c4500d 100644 --- a/tests/ui/resolve/issue-16058.rs +++ b/tests/ui/resolve/issue-16058.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ ignore-sgx std::os::fortanix_sgx::usercalls::raw::Result changes compiler suggestions pub struct GslResult { diff --git a/tests/ui/resolve/issue-16058.stderr b/tests/ui/resolve/issue-16058.stderr index 12b1ac8a5fb44..a7244693c841d 100644 --- a/tests/ui/resolve/issue-16058.stderr +++ b/tests/ui/resolve/issue-16058.stderr @@ -1,5 +1,5 @@ error[E0574]: expected struct, variant or union type, found enum `Result` - --> $DIR/issue-16058.rs:10:9 + --> $DIR/issue-16058.rs:11:9 | LL | Result { | ^^^^^^ not a struct, variant or union type diff --git a/tests/ui/resolve/issue-17518.rs b/tests/ui/resolve/issue-17518.rs index edaebc8122c19..f0bbf93456ded 100644 --- a/tests/ui/resolve/issue-17518.rs +++ b/tests/ui/resolve/issue-17518.rs @@ -1,3 +1,4 @@ +//@ edition:2015 enum SomeEnum { E } diff --git a/tests/ui/resolve/issue-17518.stderr b/tests/ui/resolve/issue-17518.stderr index 3eba715188b40..0aafa00c7e6c2 100644 --- a/tests/ui/resolve/issue-17518.stderr +++ b/tests/ui/resolve/issue-17518.stderr @@ -1,5 +1,5 @@ error[E0422]: cannot find struct, variant or union type `E` in this scope - --> $DIR/issue-17518.rs:6:5 + --> $DIR/issue-17518.rs:7:5 | LL | E { name: "foobar" }; | ^ not found in this scope diff --git a/tests/ui/resolve/issue-21221-1.rs b/tests/ui/resolve/issue-21221-1.rs index b180624d2f491..690feab2b2e13 100644 --- a/tests/ui/resolve/issue-21221-1.rs +++ b/tests/ui/resolve/issue-21221-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod mul1 { pub trait Mul {} } diff --git a/tests/ui/resolve/issue-21221-1.stderr b/tests/ui/resolve/issue-21221-1.stderr index dafa41bf312f5..7537d91fe8dc1 100644 --- a/tests/ui/resolve/issue-21221-1.stderr +++ b/tests/ui/resolve/issue-21221-1.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `Mul` in this scope - --> $DIR/issue-21221-1.rs:43:6 + --> $DIR/issue-21221-1.rs:44:6 | LL | impl Mul for Foo { | ^^^ not found in this scope @@ -14,13 +14,13 @@ LL + use mul2::Mul; | error[E0412]: cannot find type `Mul` in this scope - --> $DIR/issue-21221-1.rs:58:16 + --> $DIR/issue-21221-1.rs:59:16 | LL | fn getMul() -> Mul { | ^^^ not found in this scope | note: these items exist but are inaccessible - --> $DIR/issue-21221-1.rs:10:5 + --> $DIR/issue-21221-1.rs:11:5 | LL | enum Mul { | ^^^^^^^^ `mul3::Mul`: not accessible @@ -40,13 +40,13 @@ LL + use mul2::Mul; | error[E0405]: cannot find trait `ThisTraitReallyDoesntExistInAnyModuleReally` in this scope - --> $DIR/issue-21221-1.rs:63:6 + --> $DIR/issue-21221-1.rs:64:6 | LL | impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope error[E0405]: cannot find trait `Div` in this scope - --> $DIR/issue-21221-1.rs:68:6 + --> $DIR/issue-21221-1.rs:69:6 | LL | impl Div for Foo { | ^^^ not found in this scope diff --git a/tests/ui/resolve/issue-21221-2.rs b/tests/ui/resolve/issue-21221-2.rs index dc13e46cb489f..a2c0089a5923a 100644 --- a/tests/ui/resolve/issue-21221-2.rs +++ b/tests/ui/resolve/issue-21221-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015 pub mod foo { pub mod bar { // note: trait T is not public, but being in the current diff --git a/tests/ui/resolve/issue-21221-2.stderr b/tests/ui/resolve/issue-21221-2.stderr index 5db327955eb10..9f70d09203b0f 100644 --- a/tests/ui/resolve/issue-21221-2.stderr +++ b/tests/ui/resolve/issue-21221-2.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `T` in this scope - --> $DIR/issue-21221-2.rs:18:6 + --> $DIR/issue-21221-2.rs:19:6 | LL | impl T for Foo { } | ^ not found in this scope diff --git a/tests/ui/resolve/issue-26545.rs b/tests/ui/resolve/issue-26545.rs index 5652ee7470605..e42ce5e9a92b2 100644 --- a/tests/ui/resolve/issue-26545.rs +++ b/tests/ui/resolve/issue-26545.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod foo { pub struct B(pub ()); } diff --git a/tests/ui/resolve/issue-26545.stderr b/tests/ui/resolve/issue-26545.stderr index ced19ea1819cd..bfc05aa017b7b 100644 --- a/tests/ui/resolve/issue-26545.stderr +++ b/tests/ui/resolve/issue-26545.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find function, tuple struct or tuple variant `B` in this scope - --> $DIR/issue-26545.rs:7:9 + --> $DIR/issue-26545.rs:8:9 | LL | B(()); | ^ not found in this scope diff --git a/tests/ui/resolve/issue-30535.rs b/tests/ui/resolve/issue-30535.rs index a971ce12362ec..acb2772cc6b08 100644 --- a/tests/ui/resolve/issue-30535.rs +++ b/tests/ui/resolve/issue-30535.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:issue-30535.rs extern crate issue_30535 as foo; diff --git a/tests/ui/resolve/issue-30535.stderr b/tests/ui/resolve/issue-30535.stderr index 0fa96a87482cc..b51f8ed319329 100644 --- a/tests/ui/resolve/issue-30535.stderr +++ b/tests/ui/resolve/issue-30535.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `foo::Foo::FooV` - --> $DIR/issue-30535.rs:6:8 + --> $DIR/issue-30535.rs:7:8 | LL | _: foo::Foo::FooV | ^^^^^^^^^^^^^^ diff --git a/tests/ui/resolve/issue-35675.rs b/tests/ui/resolve/issue-35675.rs index 683761667d40a..88d6d2ddf22f8 100644 --- a/tests/ui/resolve/issue-35675.rs +++ b/tests/ui/resolve/issue-35675.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // these two HELPs are actually in a new line between this line and the `enum Fruit` line enum Fruit { Apple(i64), diff --git a/tests/ui/resolve/issue-35675.stderr b/tests/ui/resolve/issue-35675.stderr index 83d92ea7bf1ac..994d0fa6a7553 100644 --- a/tests/ui/resolve/issue-35675.stderr +++ b/tests/ui/resolve/issue-35675.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Apple` in this scope - --> $DIR/issue-35675.rs:7:29 + --> $DIR/issue-35675.rs:8:29 | LL | fn should_return_fruit() -> Apple { | ^^^^^ not found in this scope @@ -11,7 +11,7 @@ LL + fn should_return_fruit() -> Fruit { | error[E0425]: cannot find function, tuple struct or tuple variant `Apple` in this scope - --> $DIR/issue-35675.rs:9:5 + --> $DIR/issue-35675.rs:10:5 | LL | Apple(5) | ^^^^^ not found in this scope @@ -22,7 +22,7 @@ LL + use Fruit::Apple; | error[E0573]: expected type, found variant `Fruit::Apple` - --> $DIR/issue-35675.rs:13:33 + --> $DIR/issue-35675.rs:14:33 | LL | fn should_return_fruit_too() -> Fruit::Apple { | ^^^^^^^^^^^^ @@ -31,7 +31,7 @@ LL | fn should_return_fruit_too() -> Fruit::Apple { | help: try using the variant's enum: `Fruit` error[E0425]: cannot find function, tuple struct or tuple variant `Apple` in this scope - --> $DIR/issue-35675.rs:15:5 + --> $DIR/issue-35675.rs:16:5 | LL | Apple(5) | ^^^^^ not found in this scope @@ -42,7 +42,7 @@ LL + use Fruit::Apple; | error[E0573]: expected type, found variant `Ok` - --> $DIR/issue-35675.rs:19:13 + --> $DIR/issue-35675.rs:20:13 | LL | fn foo() -> Ok { | ^^ @@ -51,7 +51,7 @@ LL | fn foo() -> Ok { | help: try using the variant's enum: `std::result::Result` error[E0412]: cannot find type `Variant3` in this scope - --> $DIR/issue-35675.rs:24:13 + --> $DIR/issue-35675.rs:25:13 | LL | fn bar() -> Variant3 { | ^^^^^^^^ not found in this scope @@ -63,7 +63,7 @@ LL + fn bar() -> x::Enum { | error[E0573]: expected type, found variant `Some` - --> $DIR/issue-35675.rs:28:13 + --> $DIR/issue-35675.rs:29:13 | LL | fn qux() -> Some { | ^^^^ diff --git a/tests/ui/resolve/issue-42944.rs b/tests/ui/resolve/issue-42944.rs index 24aa110329b27..c3f78286cbebf 100644 --- a/tests/ui/resolve/issue-42944.rs +++ b/tests/ui/resolve/issue-42944.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod foo { pub struct Bx(pub(in crate::foo) ()); } diff --git a/tests/ui/resolve/issue-42944.stderr b/tests/ui/resolve/issue-42944.stderr index 53c155d8f1302..a528cde61e6f5 100644 --- a/tests/ui/resolve/issue-42944.stderr +++ b/tests/ui/resolve/issue-42944.stderr @@ -1,23 +1,23 @@ error[E0425]: cannot find function, tuple struct or tuple variant `Bx` in this scope - --> $DIR/issue-42944.rs:16:9 + --> $DIR/issue-42944.rs:17:9 | LL | Bx(()); | ^^ not found in this scope | note: tuple struct `foo::Bx` exists but is inaccessible - --> $DIR/issue-42944.rs:2:5 + --> $DIR/issue-42944.rs:3:5 | LL | pub struct Bx(pub(in crate::foo) ()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0423]: cannot initialize a tuple struct which contains private fields - --> $DIR/issue-42944.rs:9:9 + --> $DIR/issue-42944.rs:10:9 | LL | Bx(()); | ^^ | note: constructor is not visible here due to private fields - --> $DIR/issue-42944.rs:2:19 + --> $DIR/issue-42944.rs:3:19 | LL | pub struct Bx(pub(in crate::foo) ()); | ^^^^^^^^^^^^^^^^^^^^^ private field diff --git a/tests/ui/resolve/issue-82865.rs b/tests/ui/resolve/issue-82865.rs index 4dc12f2f58956..30084b133e0f6 100644 --- a/tests/ui/resolve/issue-82865.rs +++ b/tests/ui/resolve/issue-82865.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Regression test for #82865. #![feature(decl_macro)] diff --git a/tests/ui/resolve/issue-82865.stderr b/tests/ui/resolve/issue-82865.stderr index 090085460b07b..c9184bafd4c9e 100644 --- a/tests/ui/resolve/issue-82865.stderr +++ b/tests/ui/resolve/issue-82865.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `x` - --> $DIR/issue-82865.rs:5:5 + --> $DIR/issue-82865.rs:6:5 | LL | use x::y::z; | ^ use of unresolved module or unlinked crate `x` @@ -10,7 +10,7 @@ LL + extern crate x; | error[E0599]: no function or associated item named `z` found for struct `Box<_, _>` in the current scope - --> $DIR/issue-82865.rs:8:10 + --> $DIR/issue-82865.rs:9:10 | LL | Box::z | ^ function or associated item not found in `Box<_, _>` diff --git a/tests/ui/resolve/issue-88472.rs b/tests/ui/resolve/issue-88472.rs index 6bf7caeddbfcd..df20252b2b408 100644 --- a/tests/ui/resolve/issue-88472.rs +++ b/tests/ui/resolve/issue-88472.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Regression test for #88472, where a suggestion was issued to // import an inaccessible struct. diff --git a/tests/ui/resolve/issue-88472.stderr b/tests/ui/resolve/issue-88472.stderr index 8431fc97766f7..cfcc0a95cc38c 100644 --- a/tests/ui/resolve/issue-88472.stderr +++ b/tests/ui/resolve/issue-88472.stderr @@ -1,23 +1,23 @@ error[E0412]: cannot find type `Foo` in this scope - --> $DIR/issue-88472.rs:16:16 + --> $DIR/issue-88472.rs:17:16 | LL | type Bar = Foo; | ^^^ not found in this scope | note: struct `a::Foo` exists but is inaccessible - --> $DIR/issue-88472.rs:8:5 + --> $DIR/issue-88472.rs:9:5 | LL | struct Foo; | ^^^^^^^^^^^ not accessible error[E0412]: cannot find type `Eee` in this scope - --> $DIR/issue-88472.rs:33:16 + --> $DIR/issue-88472.rs:34:16 | LL | type Baz = Eee; | ^^^ not found in this scope | note: these enums exist but are inaccessible - --> $DIR/issue-88472.rs:22:5 + --> $DIR/issue-88472.rs:23:5 | LL | enum Eee {} | ^^^^^^^^ `c::Eee`: not accessible @@ -26,13 +26,13 @@ LL | enum Eee {} | ^^^^^^^^ `c::d::Eee`: not accessible warning: unused import: `crate::a::*` - --> $DIR/issue-88472.rs:14:9 + --> $DIR/issue-88472.rs:15:9 | LL | use crate::a::*; | ^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/issue-88472.rs:4:9 + --> $DIR/issue-88472.rs:5:9 | LL | #![warn(unused_imports)] | ^^^^^^^^^^^^^^ diff --git a/tests/ui/resolve/issue-90113.rs b/tests/ui/resolve/issue-90113.rs index f6658b45ed1a6..300b7cf578ce6 100644 --- a/tests/ui/resolve/issue-90113.rs +++ b/tests/ui/resolve/issue-90113.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod list { pub use self::List::Cons; diff --git a/tests/ui/resolve/issue-90113.stderr b/tests/ui/resolve/issue-90113.stderr index d25c67825e3a1..6bfdfa13bbfdc 100644 --- a/tests/ui/resolve/issue-90113.stderr +++ b/tests/ui/resolve/issue-90113.stderr @@ -1,5 +1,5 @@ error[E0531]: cannot find tuple struct or tuple variant `Cons` in this scope - --> $DIR/issue-90113.rs:17:9 + --> $DIR/issue-90113.rs:18:9 | LL | Cons(..) => {} | ^^^^ not found in this scope diff --git a/tests/ui/resolve/privacy-enum-ctor.rs b/tests/ui/resolve/privacy-enum-ctor.rs index 3f79b12a267b8..a2e35db4436aa 100644 --- a/tests/ui/resolve/privacy-enum-ctor.rs +++ b/tests/ui/resolve/privacy-enum-ctor.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod m { pub enum E { Fn(u8), diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr index 4ec1b6b97bd32..3082674941fd7 100644 --- a/tests/ui/resolve/privacy-enum-ctor.stderr +++ b/tests/ui/resolve/privacy-enum-ctor.stderr @@ -1,11 +1,11 @@ error[E0423]: expected value, found enum `n::Z` - --> $DIR/privacy-enum-ctor.rs:23:9 + --> $DIR/privacy-enum-ctor.rs:24:9 | LL | n::Z; | ^^^^ | note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | / pub(in crate::m) enum Z { LL | | Fn(u8), @@ -27,13 +27,13 @@ LL + (m::Z::Fn(/* fields */)); | error[E0423]: expected value, found enum `Z` - --> $DIR/privacy-enum-ctor.rs:25:9 + --> $DIR/privacy-enum-ctor.rs:26:9 | LL | Z; | ^ | note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | / pub(in crate::m) enum Z { LL | | Fn(u8), @@ -55,7 +55,7 @@ LL + (m::Z::Fn(/* fields */)); | error[E0423]: expected value, found enum `m::E` - --> $DIR/privacy-enum-ctor.rs:41:16 + --> $DIR/privacy-enum-ctor.rs:42:16 | LL | fn f() { | ------ similarly named function `f` defined here @@ -64,7 +64,7 @@ LL | let _: E = m::E; | ^^^^ | note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:2:5 + --> $DIR/privacy-enum-ctor.rs:3:5 | LL | / pub enum E { LL | | Fn(u8), @@ -106,13 +106,13 @@ LL + let _: E = E; | error[E0423]: expected value, found enum `E` - --> $DIR/privacy-enum-ctor.rs:49:16 + --> $DIR/privacy-enum-ctor.rs:50:16 | LL | let _: E = E; | ^ | note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:2:5 + --> $DIR/privacy-enum-ctor.rs:3:5 | LL | / pub enum E { LL | | Fn(u8), @@ -143,7 +143,7 @@ LL + use std::f64::consts::E; | error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:57:12 + --> $DIR/privacy-enum-ctor.rs:58:12 | LL | pub enum E { | ---------- similarly named enum `E` defined here @@ -152,19 +152,19 @@ LL | let _: Z = m::n::Z; | ^ help: an enum with a similar name exists: `E` | note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0423]: expected value, found enum `m::n::Z` - --> $DIR/privacy-enum-ctor.rs:57:16 + --> $DIR/privacy-enum-ctor.rs:58:16 | LL | let _: Z = m::n::Z; | ^^^^^^^ | note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | / pub(in crate::m) enum Z { LL | | Fn(u8), @@ -186,7 +186,7 @@ LL + let _: Z = (m::Z::Fn(/* fields */)); | error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:61:12 + --> $DIR/privacy-enum-ctor.rs:62:12 | LL | pub enum E { | ---------- similarly named enum `E` defined here @@ -195,13 +195,13 @@ LL | let _: Z = m::n::Z::Fn; | ^ help: an enum with a similar name exists: `E` | note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:64:12 + --> $DIR/privacy-enum-ctor.rs:65:12 | LL | pub enum E { | ---------- similarly named enum `E` defined here @@ -210,13 +210,13 @@ LL | let _: Z = m::n::Z::Struct; | ^ help: an enum with a similar name exists: `E` | note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:68:12 + --> $DIR/privacy-enum-ctor.rs:69:12 | LL | pub enum E { | ---------- similarly named enum `E` defined here @@ -225,25 +225,25 @@ LL | let _: Z = m::n::Z::Unit {}; | ^ help: an enum with a similar name exists: `E` | note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:57:22 + --> $DIR/privacy-enum-ctor.rs:58:22 | LL | let _: Z = m::n::Z; | ^ private enum | note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:61:22 + --> $DIR/privacy-enum-ctor.rs:62:22 | LL | let _: Z = m::n::Z::Fn; | ^ -- tuple variant `Fn` is not publicly re-exported @@ -251,25 +251,25 @@ LL | let _: Z = m::n::Z::Fn; | private enum | note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:64:22 + --> $DIR/privacy-enum-ctor.rs:65:22 | LL | let _: Z = m::n::Z::Struct; | ^ private enum | note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:68:22 + --> $DIR/privacy-enum-ctor.rs:69:22 | LL | let _: Z = m::n::Z::Unit {}; | ^ ---- variant `Unit` is not publicly re-exported @@ -277,13 +277,13 @@ LL | let _: Z = m::n::Z::Unit {}; | private enum | note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 + --> $DIR/privacy-enum-ctor.rs:12:9 | LL | pub(in crate::m) enum Z { | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/privacy-enum-ctor.rs:27:20 + --> $DIR/privacy-enum-ctor.rs:28:20 | LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called @@ -301,7 +301,7 @@ LL | let _: Z = Z::Fn(/* u8 */); | ++++++++++ error[E0533]: expected value, found struct variant `Z::Struct` - --> $DIR/privacy-enum-ctor.rs:29:20 + --> $DIR/privacy-enum-ctor.rs:30:20 | LL | let _: Z = Z::Struct; | ^^^^^^^^^ not a value @@ -312,7 +312,7 @@ LL | let _: Z = Z::Struct { s: /* value */ }; | ++++++++++++++++++ error[E0618]: expected function, found enum variant `Z::Unit` - --> $DIR/privacy-enum-ctor.rs:31:17 + --> $DIR/privacy-enum-ctor.rs:32:17 | LL | Unit, | ---- enum variant `Z::Unit` defined here @@ -329,7 +329,7 @@ LL + let _ = Z::Unit; | error[E0308]: mismatched types - --> $DIR/privacy-enum-ctor.rs:43:16 + --> $DIR/privacy-enum-ctor.rs:44:16 | LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called @@ -347,7 +347,7 @@ LL | let _: E = m::E::Fn(/* u8 */); | ++++++++++ error[E0533]: expected value, found struct variant `m::E::Struct` - --> $DIR/privacy-enum-ctor.rs:45:16 + --> $DIR/privacy-enum-ctor.rs:46:16 | LL | let _: E = m::E::Struct; | ^^^^^^^^^^^^ not a value @@ -358,7 +358,7 @@ LL | let _: E = m::E::Struct { s: /* value */ }; | ++++++++++++++++++ error[E0618]: expected function, found enum variant `m::E::Unit` - --> $DIR/privacy-enum-ctor.rs:47:16 + --> $DIR/privacy-enum-ctor.rs:48:16 | LL | Unit, | ---- enum variant `m::E::Unit` defined here @@ -375,7 +375,7 @@ LL + let _: E = m::E::Unit; | error[E0308]: mismatched types - --> $DIR/privacy-enum-ctor.rs:51:16 + --> $DIR/privacy-enum-ctor.rs:52:16 | LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called @@ -393,7 +393,7 @@ LL | let _: E = E::Fn(/* u8 */); | ++++++++++ error[E0533]: expected value, found struct variant `E::Struct` - --> $DIR/privacy-enum-ctor.rs:53:16 + --> $DIR/privacy-enum-ctor.rs:54:16 | LL | let _: E = E::Struct; | ^^^^^^^^^ not a value @@ -404,7 +404,7 @@ LL | let _: E = E::Struct { s: /* value */ }; | ++++++++++++++++++ error[E0618]: expected function, found enum variant `E::Unit` - --> $DIR/privacy-enum-ctor.rs:55:16 + --> $DIR/privacy-enum-ctor.rs:56:16 | LL | Unit, | ---- enum variant `E::Unit` defined here @@ -421,7 +421,7 @@ LL + let _: E = E::Unit; | error[E0533]: expected value, found struct variant `m::n::Z::Struct` - --> $DIR/privacy-enum-ctor.rs:64:16 + --> $DIR/privacy-enum-ctor.rs:65:16 | LL | let _: Z = m::n::Z::Struct; | ^^^^^^^^^^^^^^^ not a value diff --git a/tests/ui/resolve/privacy-struct-ctor.rs b/tests/ui/resolve/privacy-struct-ctor.rs index 70c751999b7d4..95575a6cc7c98 100644 --- a/tests/ui/resolve/privacy-struct-ctor.rs +++ b/tests/ui/resolve/privacy-struct-ctor.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:privacy-struct-ctor.rs extern crate privacy_struct_ctor as xcrate; diff --git a/tests/ui/resolve/privacy-struct-ctor.stderr b/tests/ui/resolve/privacy-struct-ctor.stderr index 0a6b1b46afae7..96c3e6e5122df 100644 --- a/tests/ui/resolve/privacy-struct-ctor.stderr +++ b/tests/ui/resolve/privacy-struct-ctor.stderr @@ -1,5 +1,5 @@ error[E0423]: expected value, found struct `Z` - --> $DIR/privacy-struct-ctor.rs:20:9 + --> $DIR/privacy-struct-ctor.rs:21:9 | LL | pub struct S(u8); | ----------------- similarly named tuple struct `S` defined here @@ -11,13 +11,13 @@ LL | Z; | help: a tuple struct with a similar name exists: `S` error[E0423]: expected value, found struct `S` - --> $DIR/privacy-struct-ctor.rs:33:5 + --> $DIR/privacy-struct-ctor.rs:34:5 | LL | S; | ^ constructor is not visible here due to private fields error[E0423]: expected value, found struct `S2` - --> $DIR/privacy-struct-ctor.rs:38:5 + --> $DIR/privacy-struct-ctor.rs:39:5 | LL | / pub struct S2 { LL | | s: u8 @@ -28,19 +28,19 @@ LL | S2; | ^^ help: use struct literal syntax instead: `S2 { s: val }` error[E0423]: expected value, found struct `xcrate::S` - --> $DIR/privacy-struct-ctor.rs:43:5 + --> $DIR/privacy-struct-ctor.rs:44:5 | LL | xcrate::S; | ^^^^^^^^^ constructor is not visible here due to private fields | note: tuple struct `m::S` exists but is inaccessible - --> $DIR/privacy-struct-ctor.rs:6:5 + --> $DIR/privacy-struct-ctor.rs:7:5 | LL | pub struct S(u8); | ^^^^^^^^^^^^^^^^^ not accessible error[E0603]: tuple struct constructor `Z` is private - --> $DIR/privacy-struct-ctor.rs:18:12 + --> $DIR/privacy-struct-ctor.rs:19:12 | LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); | ---------------------- a constructor is private if any of the fields is private @@ -49,7 +49,7 @@ LL | n::Z; | ^ private tuple struct constructor | note: the tuple struct constructor `Z` is defined here - --> $DIR/privacy-struct-ctor.rs:12:9 + --> $DIR/privacy-struct-ctor.rs:13:9 | LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -60,7 +60,7 @@ LL + pub(in crate::m) struct Z(pub u8); | error[E0603]: tuple struct constructor `S` is private - --> $DIR/privacy-struct-ctor.rs:29:8 + --> $DIR/privacy-struct-ctor.rs:30:8 | LL | pub struct S(u8); | -- a constructor is private if any of the fields is private @@ -69,7 +69,7 @@ LL | m::S; | ^ private tuple struct constructor | note: the tuple struct constructor `S` is defined here - --> $DIR/privacy-struct-ctor.rs:6:5 + --> $DIR/privacy-struct-ctor.rs:7:5 | LL | pub struct S(u8); | ^^^^^^^^^^^^^^^^^ @@ -79,7 +79,7 @@ LL | pub struct S(pub u8); | +++ error[E0603]: tuple struct constructor `S` is private - --> $DIR/privacy-struct-ctor.rs:31:19 + --> $DIR/privacy-struct-ctor.rs:32:19 | LL | pub struct S(u8); | -- a constructor is private if any of the fields is private @@ -88,7 +88,7 @@ LL | let _: S = m::S(2); | ^ private tuple struct constructor | note: the tuple struct constructor `S` is defined here - --> $DIR/privacy-struct-ctor.rs:6:5 + --> $DIR/privacy-struct-ctor.rs:7:5 | LL | pub struct S(u8); | ^^^^^^^^^^^^^^^^^ @@ -98,7 +98,7 @@ LL | pub struct S(pub u8); | +++ error[E0603]: tuple struct constructor `Z` is private - --> $DIR/privacy-struct-ctor.rs:35:11 + --> $DIR/privacy-struct-ctor.rs:36:11 | LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); | ---------------------- a constructor is private if any of the fields is private @@ -107,7 +107,7 @@ LL | m::n::Z; | ^ private tuple struct constructor | note: the tuple struct constructor `Z` is defined here - --> $DIR/privacy-struct-ctor.rs:12:9 + --> $DIR/privacy-struct-ctor.rs:13:9 | LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -118,7 +118,7 @@ LL + pub(in crate::m) struct Z(pub u8); | error[E0603]: tuple struct constructor `S` is private - --> $DIR/privacy-struct-ctor.rs:41:16 + --> $DIR/privacy-struct-ctor.rs:42:16 | LL | xcrate::m::S; | ^ private tuple struct constructor @@ -135,7 +135,7 @@ LL | pub struct S(u8); | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `Z` is private - --> $DIR/privacy-struct-ctor.rs:45:19 + --> $DIR/privacy-struct-ctor.rs:46:19 | LL | xcrate::m::n::Z; | ^ private tuple struct constructor diff --git a/tests/ui/resolve/resolve-bad-import-prefix.rs b/tests/ui/resolve/resolve-bad-import-prefix.rs index 325c69b43c1be..290330bee818c 100644 --- a/tests/ui/resolve/resolve-bad-import-prefix.rs +++ b/tests/ui/resolve/resolve-bad-import-prefix.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod m {} enum E {} struct S; diff --git a/tests/ui/resolve/resolve-bad-import-prefix.stderr b/tests/ui/resolve/resolve-bad-import-prefix.stderr index 36eb3148ab510..b532d3a4a6e3b 100644 --- a/tests/ui/resolve/resolve-bad-import-prefix.stderr +++ b/tests/ui/resolve/resolve-bad-import-prefix.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `Nonexistent` - --> $DIR/resolve-bad-import-prefix.rs:12:5 + --> $DIR/resolve-bad-import-prefix.rs:13:5 | LL | use Nonexistent::{}; | ^^^^^^^^^^^^^^^ no `Nonexistent` in the root diff --git a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs index 3cb6ab52e0a2c..0149356f1f2f8 100644 --- a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs +++ b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs @@ -1,3 +1,4 @@ +//@ edition:2015 extern crate std; //~^ ERROR the name `std` is defined multiple times diff --git a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr index f53e9e3b478c5..7d4b9919414b1 100644 --- a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr +++ b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr @@ -1,8 +1,11 @@ error[E0259]: the name `std` is defined multiple times + --> $DIR/resolve-conflict-extern-crate-vs-extern-crate.rs:2:1 + | +LL | extern crate std; + | ^^^^^^^^^^^^^^^^^ `std` reimported here | = note: `std` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import - --> $DIR/resolve-conflict-extern-crate-vs-extern-crate.rs:1:17 | LL | extern crate std as other_std; | ++++++++++++ diff --git a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.rs b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.rs index 10772e7a43a76..6d52a5a973a9c 100644 --- a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.rs +++ b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use std::slice as std; //~ ERROR the name `std` is defined multiple times fn main() { diff --git a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr index ef8723408dae8..497c4831971c8 100644 --- a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr +++ b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr @@ -1,5 +1,5 @@ error[E0254]: the name `std` is defined multiple times - --> $DIR/resolve-conflict-import-vs-extern-crate.rs:1:5 + --> $DIR/resolve-conflict-import-vs-extern-crate.rs:2:5 | LL | use std::slice as std; | ^^^^^^^^^^^^^^^^^ `std` reimported here diff --git a/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.rs b/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.rs index 1226062493549..98503ab7457b4 100644 --- a/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.rs +++ b/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn std() {} mod std {} //~ ERROR the name `std` is defined multiple times diff --git a/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr index 1097dab415ed2..724e37e063a42 100644 --- a/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr +++ b/tests/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr @@ -1,5 +1,5 @@ error[E0260]: the name `std` is defined multiple times - --> $DIR/resolve-conflict-item-vs-extern-crate.rs:2:1 + --> $DIR/resolve-conflict-item-vs-extern-crate.rs:3:1 | LL | mod std {} | ^^^^^^^ `std` redefined here diff --git a/tests/ui/resolve/resolve-inconsistent-names.rs b/tests/ui/resolve/resolve-inconsistent-names.rs index 96504720e8395..9d1c45eb56d6c 100644 --- a/tests/ui/resolve/resolve-inconsistent-names.rs +++ b/tests/ui/resolve/resolve-inconsistent-names.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![allow(non_camel_case_types)] enum E { A, B, c } diff --git a/tests/ui/resolve/resolve-inconsistent-names.stderr b/tests/ui/resolve/resolve-inconsistent-names.stderr index d2333150961ac..cd9ca1419ceda 100644 --- a/tests/ui/resolve/resolve-inconsistent-names.stderr +++ b/tests/ui/resolve/resolve-inconsistent-names.stderr @@ -1,5 +1,5 @@ error[E0408]: variable `b` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:13:9 + --> $DIR/resolve-inconsistent-names.rs:14:9 | LL | a | b => {} | ^ - variable not in all patterns @@ -7,7 +7,7 @@ LL | a | b => {} | pattern doesn't bind `b` error[E0408]: variable `a` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:13:13 + --> $DIR/resolve-inconsistent-names.rs:14:13 | LL | a | b => {} | - ^ pattern doesn't bind `a` @@ -15,7 +15,7 @@ LL | a | b => {} | variable not in all patterns error[E0408]: variable `c` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:19:9 + --> $DIR/resolve-inconsistent-names.rs:20:9 | LL | (A, B) | (ref B, c) | (c, A) => () | ^^^^^^ - - variable not in all patterns @@ -24,7 +24,7 @@ LL | (A, B) | (ref B, c) | (c, A) => () | pattern doesn't bind `c` error[E0408]: variable `A` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:19:18 + --> $DIR/resolve-inconsistent-names.rs:20:18 | LL | (A, B) | (ref B, c) | (c, A) => () | - ^^^^^^^^^^ - variable not in all patterns @@ -38,7 +38,7 @@ LL | (E::A, B) | (ref B, c) | (c, A) => () | +++ error[E0408]: variable `B` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:19:31 + --> $DIR/resolve-inconsistent-names.rs:20:31 | LL | (A, B) | (ref B, c) | (c, A) => () | - - ^^^^^^ pattern doesn't bind `B` @@ -47,7 +47,7 @@ LL | (A, B) | (ref B, c) | (c, A) => () | variable not in all patterns error[E0409]: variable `B` is bound inconsistently across alternatives separated by `|` - --> $DIR/resolve-inconsistent-names.rs:19:23 + --> $DIR/resolve-inconsistent-names.rs:20:23 | LL | (A, B) | (ref B, c) | (c, A) => () | - ^ bound in different ways @@ -55,7 +55,7 @@ LL | (A, B) | (ref B, c) | (c, A) => () | first binding error[E0408]: variable `Const2` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:31:9 + --> $DIR/resolve-inconsistent-names.rs:32:9 | LL | (CONST1, _) | (_, Const2) => () | ^^^^^^^^^^^ ------ variable not in all patterns @@ -68,7 +68,7 @@ LL | (CONST1, _) | (_, m::Const2) => () | +++ error[E0408]: variable `CONST1` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:31:23 + --> $DIR/resolve-inconsistent-names.rs:32:23 | LL | (CONST1, _) | (_, Const2) => () | ------ ^^^^^^^^^^^ pattern doesn't bind `CONST1` @@ -76,13 +76,13 @@ LL | (CONST1, _) | (_, Const2) => () | variable not in all patterns | note: you might have meant to match on constant `m::CONST1`, which exists but is inaccessible - --> $DIR/resolve-inconsistent-names.rs:6:5 + --> $DIR/resolve-inconsistent-names.rs:7:5 | LL | const CONST1: usize = 10; | ^^^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0308]: mismatched types - --> $DIR/resolve-inconsistent-names.rs:19:19 + --> $DIR/resolve-inconsistent-names.rs:20:19 | LL | match x { | - this expression has type `(E, E)` diff --git a/tests/ui/resolve/resolve-primitive-fallback.rs b/tests/ui/resolve/resolve-primitive-fallback.rs index 05cabd9e3cd01..ce30f4e0e42f6 100644 --- a/tests/ui/resolve/resolve-primitive-fallback.rs +++ b/tests/ui/resolve/resolve-primitive-fallback.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn main() { // Make sure primitive type fallback doesn't work in value namespace std::mem::size_of(u16); diff --git a/tests/ui/resolve/resolve-primitive-fallback.stderr b/tests/ui/resolve/resolve-primitive-fallback.stderr index d0583966459be..f9ab55913d148 100644 --- a/tests/ui/resolve/resolve-primitive-fallback.stderr +++ b/tests/ui/resolve/resolve-primitive-fallback.stderr @@ -1,11 +1,11 @@ error[E0423]: expected value, found builtin type `u16` - --> $DIR/resolve-primitive-fallback.rs:3:23 + --> $DIR/resolve-primitive-fallback.rs:4:23 | LL | std::mem::size_of(u16); | ^^^ not a value error[E0412]: cannot find type `u8` in the crate root - --> $DIR/resolve-primitive-fallback.rs:8:14 + --> $DIR/resolve-primitive-fallback.rs:9:14 | LL | let _: ::u8; | ^^ not found in the crate root @@ -21,7 +21,7 @@ LL + let _: u8; | error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/resolve-primitive-fallback.rs:3:5 + --> $DIR/resolve-primitive-fallback.rs:4:5 | LL | std::mem::size_of(u16); | ^^^^^^^^^^^^^^^^^ --- unexpected argument diff --git a/tests/ui/resolve/resolve-variant-assoc-item.rs b/tests/ui/resolve/resolve-variant-assoc-item.rs index db4fedfb0bdf8..7671dddc819bc 100644 --- a/tests/ui/resolve/resolve-variant-assoc-item.rs +++ b/tests/ui/resolve/resolve-variant-assoc-item.rs @@ -1,3 +1,4 @@ +//@ edition:2015 enum E { V } use E::V; diff --git a/tests/ui/resolve/resolve-variant-assoc-item.stderr b/tests/ui/resolve/resolve-variant-assoc-item.stderr index 4b15114f022a9..5528bb2495b52 100644 --- a/tests/ui/resolve/resolve-variant-assoc-item.stderr +++ b/tests/ui/resolve/resolve-variant-assoc-item.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: `V` is a variant, not a module - --> $DIR/resolve-variant-assoc-item.rs:5:8 + --> $DIR/resolve-variant-assoc-item.rs:6:8 | LL | E::V::associated_item; | ^ `V` is a variant, not a module @@ -11,7 +11,7 @@ LL + E::associated_item; | error[E0433]: failed to resolve: `V` is a variant, not a module - --> $DIR/resolve-variant-assoc-item.rs:6:5 + --> $DIR/resolve-variant-assoc-item.rs:7:5 | LL | V::associated_item; | ^ `V` is a variant, not a module diff --git a/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.fixed b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.fixed index 607c9af492713..cfbf9ef386843 100644 --- a/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.fixed +++ b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix //@ compile-flags: -Aunused diff --git a/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.rs b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.rs index 6cc53fb108658..98be104d8fde6 100644 --- a/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.rs +++ b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix //@ compile-flags: -Aunused diff --git a/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.stderr b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.stderr index de65d695dd23d..725d12ca6d61d 100644 --- a/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.stderr +++ b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find function `z` in this scope - --> $DIR/suggest-import-without-clobbering-attrs.rs:13:5 + --> $DIR/suggest-import-without-clobbering-attrs.rs:14:5 | LL | z(); | ^ not found in this scope diff --git a/tests/ui/resolve/underscore-bindings-disambiguators.rs b/tests/ui/resolve/underscore-bindings-disambiguators.rs index 8c89b39f8590c..13f0271af10ee 100644 --- a/tests/ui/resolve/underscore-bindings-disambiguators.rs +++ b/tests/ui/resolve/underscore-bindings-disambiguators.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Regression test for issue #144168 where some `_` bindings were incorrectly only allowed once per // module, failing with "error[E0428]: the name `_` is defined multiple times". diff --git a/tests/ui/resolve/underscore-bindings-disambiguators.stderr b/tests/ui/resolve/underscore-bindings-disambiguators.stderr index 0c8081a0c5647..ec14ede03e3ff 100644 --- a/tests/ui/resolve/underscore-bindings-disambiguators.stderr +++ b/tests/ui/resolve/underscore-bindings-disambiguators.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `X` - --> $DIR/underscore-bindings-disambiguators.rs:24:5 + --> $DIR/underscore-bindings-disambiguators.rs:25:5 | LL | use X as Y; | -^^^^^ @@ -8,7 +8,7 @@ LL | use X as Y; | help: a similar name exists in the module: `_` error[E0432]: unresolved import `Z` - --> $DIR/underscore-bindings-disambiguators.rs:25:5 + --> $DIR/underscore-bindings-disambiguators.rs:26:5 | LL | use Z as W; | -^^^^^ @@ -17,7 +17,7 @@ LL | use Z as W; | help: a similar name exists in the module: `_` error[E0080]: evaluation panicked: not yet implemented - --> $DIR/underscore-bindings-disambiguators.rs:18:19 + --> $DIR/underscore-bindings-disambiguators.rs:19:19 | LL | const _: () = todo!(); | ^^^^^^^ evaluation of `impls::_` failed here @@ -25,7 +25,7 @@ LL | const _: () = todo!(); = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: not yet implemented - --> $DIR/underscore-bindings-disambiguators.rs:19:19 + --> $DIR/underscore-bindings-disambiguators.rs:20:19 | LL | const _: () = todo!(); | ^^^^^^^ evaluation of `impls::_` failed here @@ -33,7 +33,7 @@ LL | const _: () = todo!(); = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: not yet implemented - --> $DIR/underscore-bindings-disambiguators.rs:20:19 + --> $DIR/underscore-bindings-disambiguators.rs:21:19 | LL | const _: () = todo!(); | ^^^^^^^ evaluation of `impls::_` failed here @@ -41,7 +41,7 @@ LL | const _: () = todo!(); = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: not yet implemented - --> $DIR/underscore-bindings-disambiguators.rs:21:19 + --> $DIR/underscore-bindings-disambiguators.rs:22:19 | LL | const _: () = todo!(); | ^^^^^^^ evaluation of `impls::_` failed here @@ -49,7 +49,7 @@ LL | const _: () = todo!(); = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: not yet implemented - --> $DIR/underscore-bindings-disambiguators.rs:22:19 + --> $DIR/underscore-bindings-disambiguators.rs:23:19 | LL | const _: () = todo!(); | ^^^^^^^ evaluation of `impls::_` failed here @@ -57,7 +57,7 @@ LL | const _: () = todo!(); = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: not yet implemented - --> $DIR/underscore-bindings-disambiguators.rs:27:15 + --> $DIR/underscore-bindings-disambiguators.rs:28:15 | LL | const _: () = todo!(); | ^^^^^^^ evaluation of `_` failed here diff --git a/tests/ui/resolve/use-shadowing-14082.rs b/tests/ui/resolve/use-shadowing-14082.rs index 9d7df5ed1c6c9..e32566b129e52 100644 --- a/tests/ui/resolve/use-shadowing-14082.rs +++ b/tests/ui/resolve/use-shadowing-14082.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //! Regression test for https://github.com/rust-lang/rust/issues/14082 //@ check-pass diff --git a/tests/ui/resolve/use_suggestion_placement.fixed b/tests/ui/resolve/use_suggestion_placement.fixed index de7f946d1d9f5..9ae2eccece0b5 100644 --- a/tests/ui/resolve/use_suggestion_placement.fixed +++ b/tests/ui/resolve/use_suggestion_placement.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(dead_code)] diff --git a/tests/ui/resolve/use_suggestion_placement.rs b/tests/ui/resolve/use_suggestion_placement.rs index f761e9715a027..e18093a3124ac 100644 --- a/tests/ui/resolve/use_suggestion_placement.rs +++ b/tests/ui/resolve/use_suggestion_placement.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![allow(dead_code)] diff --git a/tests/ui/resolve/use_suggestion_placement.stderr b/tests/ui/resolve/use_suggestion_placement.stderr index 3611f9ae6b4ed..e92a230ad7653 100644 --- a/tests/ui/resolve/use_suggestion_placement.stderr +++ b/tests/ui/resolve/use_suggestion_placement.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Path` in this scope - --> $DIR/use_suggestion_placement.rs:18:16 + --> $DIR/use_suggestion_placement.rs:19:16 | LL | type Bar = Path; | ^^^^ not found in this scope @@ -10,7 +10,7 @@ LL + use std::path::Path; | error[E0425]: cannot find value `A` in this scope - --> $DIR/use_suggestion_placement.rs:23:13 + --> $DIR/use_suggestion_placement.rs:24:13 | LL | let _ = A; | ^ not found in this scope @@ -21,7 +21,7 @@ LL + use m::A; | error[E0412]: cannot find type `HashMap` in this scope - --> $DIR/use_suggestion_placement.rs:28:23 + --> $DIR/use_suggestion_placement.rs:29:23 | LL | type Dict = HashMap; | ^^^^^^^ not found in this scope diff --git a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs index 79f6b0dfe34ee..efadddf3ef1dc 100644 --- a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs +++ b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs @@ -1,3 +1,4 @@ +//@ edition:2015 struct S; pub mod m { diff --git a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr index 7e7ee3ce03d77..6cb96e5762ad4 100644 --- a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr +++ b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr @@ -1,11 +1,11 @@ error[E0433]: failed to resolve: `crate` in paths can only be used in start position - --> $DIR/crate-path-non-absolute.rs:5:22 + --> $DIR/crate-path-non-absolute.rs:6:22 | LL | let s = ::m::crate::S; | ^^^^^ `crate` in paths can only be used in start position error[E0433]: failed to resolve: global paths cannot start with `crate` - --> $DIR/crate-path-non-absolute.rs:6:20 + --> $DIR/crate-path-non-absolute.rs:7:20 | LL | let s1 = ::crate::S; | ^^^^^ global paths cannot start with `crate` diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs index c0f17570673ce..14402eaeecac1 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #[cfg(false)] impl S { fn f(#[attr]) {} //~ ERROR expected parameter name, found `)` diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr index 26dff4d4b30bf..2fa03f3cb0bba 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr +++ b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr @@ -1,17 +1,17 @@ error: expected parameter name, found `)` - --> $DIR/attr-without-param.rs:3:17 + --> $DIR/attr-without-param.rs:4:17 | LL | fn f(#[attr]) {} | ^ expected parameter name error: expected parameter name, found `)` - --> $DIR/attr-without-param.rs:8:17 + --> $DIR/attr-without-param.rs:9:17 | LL | fn f(#[attr]) {} | ^ expected parameter name error: expected argument name, found `)` - --> $DIR/attr-without-param.rs:13:17 + --> $DIR/attr-without-param.rs:14:17 | LL | fn f(#[attr]); | ^ expected argument name diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs index 89864348eda0b..358b50f7564bc 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ proc-macro: param-attrs.rs //@ check-pass diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs index 049c5b32cb36c..d96bbee14ca19 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ proc-macro: ident-mac.rs #![feature(c_variadic)] diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr index e74d05d49b8d7..ba3c0e347b186 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr +++ b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr @@ -1,173 +1,173 @@ error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:11:23 + --> $DIR/proc-macro-cannot-be-used.rs:12:23 | LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); } | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:11:40 + --> $DIR/proc-macro-cannot-be-used.rs:12:40 | LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); } | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:15:40 + --> $DIR/proc-macro-cannot-be-used.rs:16:40 | LL | unsafe extern "C" fn cvar(arg1: i32, #[id] mut args: ...) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:18:30 + --> $DIR/proc-macro-cannot-be-used.rs:19:30 | LL | type Alias = extern "C" fn(#[id] u8, #[id] ...); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:18:40 + --> $DIR/proc-macro-cannot-be-used.rs:19:40 | LL | type Alias = extern "C" fn(#[id] u8, #[id] ...); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:22:11 + --> $DIR/proc-macro-cannot-be-used.rs:23:11 | LL | fn free(#[id] arg1: u8) { | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:24:18 + --> $DIR/proc-macro-cannot-be-used.rs:25:18 | LL | let lam = |#[id] W(x), #[id] y: usize| (); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:24:30 + --> $DIR/proc-macro-cannot-be-used.rs:25:30 | LL | let lam = |#[id] W(x), #[id] y: usize| (); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:30:20 + --> $DIR/proc-macro-cannot-be-used.rs:31:20 | LL | fn inherent1(#[id] self, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:30:32 + --> $DIR/proc-macro-cannot-be-used.rs:31:32 | LL | fn inherent1(#[id] self, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:33:20 + --> $DIR/proc-macro-cannot-be-used.rs:34:20 | LL | fn inherent2(#[id] &self, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:33:33 + --> $DIR/proc-macro-cannot-be-used.rs:34:33 | LL | fn inherent2(#[id] &self, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:36:24 + --> $DIR/proc-macro-cannot-be-used.rs:37:24 | LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:36:44 + --> $DIR/proc-macro-cannot-be-used.rs:37:44 | LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:39:24 + --> $DIR/proc-macro-cannot-be-used.rs:40:24 | LL | fn inherent4<'a>(#[id] self: Box, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:39:47 + --> $DIR/proc-macro-cannot-be-used.rs:40:47 | LL | fn inherent4<'a>(#[id] self: Box, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:42:40 + --> $DIR/proc-macro-cannot-be-used.rs:43:40 | LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:42:56 + --> $DIR/proc-macro-cannot-be-used.rs:43:56 | LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:48:17 + --> $DIR/proc-macro-cannot-be-used.rs:49:17 | LL | fn trait1(#[id] self, #[id] arg1: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:48:29 + --> $DIR/proc-macro-cannot-be-used.rs:49:29 | LL | fn trait1(#[id] self, #[id] arg1: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:51:17 + --> $DIR/proc-macro-cannot-be-used.rs:52:17 | LL | fn trait2(#[id] &self, #[id] arg1: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:51:30 + --> $DIR/proc-macro-cannot-be-used.rs:52:30 | LL | fn trait2(#[id] &self, #[id] arg1: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:54:21 + --> $DIR/proc-macro-cannot-be-used.rs:55:21 | LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:54:41 + --> $DIR/proc-macro-cannot-be-used.rs:55:41 | LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:57:21 + --> $DIR/proc-macro-cannot-be-used.rs:58:21 | LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:57:44 + --> $DIR/proc-macro-cannot-be-used.rs:58:44 | LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:57:60 + --> $DIR/proc-macro-cannot-be-used.rs:58:60 | LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:61:40 + --> $DIR/proc-macro-cannot-be-used.rs:62:40 | LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:61:56 + --> $DIR/proc-macro-cannot-be-used.rs:62:56 | LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8); | ^^ not a non-macro attribute diff --git a/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs b/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs index bccde8e8de7ff..203125b3c2dd4 100644 --- a/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs +++ b/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs @@ -1,3 +1,4 @@ +//@ edition:2015 extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/rust-2021/generic-type-collision.fixed b/tests/ui/rust-2021/generic-type-collision.fixed index a0a53e92d26b9..7a6ce117b77d2 100644 --- a/tests/ui/rust-2021/generic-type-collision.fixed +++ b/tests/ui/rust-2021/generic-type-collision.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass //@ run-rustfix //@ edition 2018 diff --git a/tests/ui/rust-2021/generic-type-collision.rs b/tests/ui/rust-2021/generic-type-collision.rs index 16c3967287d24..09077678a228d 100644 --- a/tests/ui/rust-2021/generic-type-collision.rs +++ b/tests/ui/rust-2021/generic-type-collision.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass //@ run-rustfix //@ edition 2018 diff --git a/tests/ui/rust-2021/generic-type-collision.stderr b/tests/ui/rust-2021/generic-type-collision.stderr index c2d296822c043..cd64b491b4a4f 100644 --- a/tests/ui/rust-2021/generic-type-collision.stderr +++ b/tests/ui/rust-2021/generic-type-collision.stderr @@ -1,5 +1,5 @@ warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 - --> $DIR/generic-type-collision.rs:15:5 + --> $DIR/generic-type-collision.rs:16:5 | LL | >::from_iter(None); | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as MyTrait<_>>::from_iter` @@ -7,7 +7,7 @@ LL | >::from_iter(None); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/generic-type-collision.rs:4:9 + --> $DIR/generic-type-collision.rs:5:9 | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/gen-kw.e2015.stderr b/tests/ui/rust-2024/gen-kw.e2015.stderr index ebb80cf221760..f17b3ab5cc84d 100644 --- a/tests/ui/rust-2024/gen-kw.e2015.stderr +++ b/tests/ui/rust-2024/gen-kw.e2015.stderr @@ -1,5 +1,5 @@ error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:6:4 + --> $DIR/gen-kw.rs:7:4 | LL | fn gen() {} | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` @@ -7,14 +7,14 @@ LL | fn gen() {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! = note: for more information, see note: the lint level is defined here - --> $DIR/gen-kw.rs:4:9 + --> $DIR/gen-kw.rs:5:9 | LL | #![deny(rust_2024_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[deny(keyword_idents_2024)]` implied by `#[deny(rust_2024_compatibility)]` error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:12:9 + --> $DIR/gen-kw.rs:13:9 | LL | let gen = r#gen; | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` @@ -23,7 +23,7 @@ LL | let gen = r#gen; = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:19:27 + --> $DIR/gen-kw.rs:20:27 | LL | () => { mod test { fn gen() {} } } | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` @@ -32,7 +32,7 @@ LL | () => { mod test { fn gen() {} } } = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:25:9 + --> $DIR/gen-kw.rs:26:9 | LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -41,7 +41,7 @@ LL | fn test<'gen>(_: &'gen i32) {} = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:25:19 + --> $DIR/gen-kw.rs:26:19 | LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -50,7 +50,7 @@ LL | fn test<'gen>(_: &'gen i32) {} = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:33:13 + --> $DIR/gen-kw.rs:34:13 | LL | struct Test<'gen>(Box>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -59,7 +59,7 @@ LL | struct Test<'gen>(Box>, &'gen ()); = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:33:28 + --> $DIR/gen-kw.rs:34:28 | LL | struct Test<'gen>(Box>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -68,7 +68,7 @@ LL | struct Test<'gen>(Box>, &'gen ()); = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:33:37 + --> $DIR/gen-kw.rs:34:37 | LL | struct Test<'gen>(Box>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` diff --git a/tests/ui/rust-2024/gen-kw.e2018.stderr b/tests/ui/rust-2024/gen-kw.e2018.stderr index e491454d2a6fe..6ec94a2dcd715 100644 --- a/tests/ui/rust-2024/gen-kw.e2018.stderr +++ b/tests/ui/rust-2024/gen-kw.e2018.stderr @@ -1,5 +1,5 @@ error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:6:4 + --> $DIR/gen-kw.rs:7:4 | LL | fn gen() {} | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` @@ -7,14 +7,14 @@ LL | fn gen() {} = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! = note: for more information, see note: the lint level is defined here - --> $DIR/gen-kw.rs:4:9 + --> $DIR/gen-kw.rs:5:9 | LL | #![deny(rust_2024_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[deny(keyword_idents_2024)]` implied by `#[deny(rust_2024_compatibility)]` error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:12:9 + --> $DIR/gen-kw.rs:13:9 | LL | let gen = r#gen; | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` @@ -23,7 +23,7 @@ LL | let gen = r#gen; = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:19:27 + --> $DIR/gen-kw.rs:20:27 | LL | () => { mod test { fn gen() {} } } | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` @@ -32,7 +32,7 @@ LL | () => { mod test { fn gen() {} } } = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:25:9 + --> $DIR/gen-kw.rs:26:9 | LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -41,7 +41,7 @@ LL | fn test<'gen>(_: &'gen i32) {} = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:25:19 + --> $DIR/gen-kw.rs:26:19 | LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -50,7 +50,7 @@ LL | fn test<'gen>(_: &'gen i32) {} = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:33:13 + --> $DIR/gen-kw.rs:34:13 | LL | struct Test<'gen>(Box>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -59,7 +59,7 @@ LL | struct Test<'gen>(Box>, &'gen ()); = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:33:28 + --> $DIR/gen-kw.rs:34:28 | LL | struct Test<'gen>(Box>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` @@ -68,7 +68,7 @@ LL | struct Test<'gen>(Box>, &'gen ()); = note: for more information, see error: `gen` is a keyword in the 2024 edition - --> $DIR/gen-kw.rs:33:37 + --> $DIR/gen-kw.rs:34:37 | LL | struct Test<'gen>(Box>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` diff --git a/tests/ui/rust-2024/gen-kw.rs b/tests/ui/rust-2024/gen-kw.rs index 3c075a4c022a2..d107563c05da2 100644 --- a/tests/ui/rust-2024/gen-kw.rs +++ b/tests/ui/rust-2024/gen-kw.rs @@ -1,4 +1,5 @@ //@ revisions: e2015 e2018 +//@[e2015] edition: 2015 //@[e2018] edition: 2018 #![deny(rust_2024_compatibility)] diff --git a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs index f3b8645abaf89..f9bff43315137 100644 --- a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs +++ b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![deny(rust_2024_compatibility)] #[no_mangle] diff --git a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr index 2b77f6e8e52dc..f3de8d631e422 100644 --- a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr @@ -1,5 +1,5 @@ error: unsafe attribute used without unsafe - --> $DIR/in_2024_compatibility.rs:3:3 + --> $DIR/in_2024_compatibility.rs:4:3 | LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute @@ -7,7 +7,7 @@ LL | #[no_mangle] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! = note: for more information, see note: the lint level is defined here - --> $DIR/in_2024_compatibility.rs:1:9 + --> $DIR/in_2024_compatibility.rs:2:9 | LL | #![deny(rust_2024_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed index cba3d7f1f9f1c..a2f04daa4b859 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![deny(unsafe_attr_outside_unsafe)] diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs index 4bbf9b25de54c..88c9328fd9cd5 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![deny(unsafe_attr_outside_unsafe)] diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr index b97176f5e0d3c..55df60c51d9cd 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr @@ -1,5 +1,5 @@ error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:52:6 + --> $DIR/unsafe-attributes-fix.rs:53:6 | LL | tt!([no_mangle]); | ^^^^^^^^^ usage of unsafe attribute @@ -7,7 +7,7 @@ LL | tt!([no_mangle]); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! = note: for more information, see note: the lint level is defined here - --> $DIR/unsafe-attributes-fix.rs:2:9 + --> $DIR/unsafe-attributes-fix.rs:3:9 | LL | #![deny(unsafe_attr_outside_unsafe)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | tt!([unsafe(no_mangle)]); | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:13:11 + --> $DIR/unsafe-attributes-fix.rs:14:11 | LL | #[$e] | ^^ usage of unsafe attribute @@ -34,7 +34,7 @@ LL | #[unsafe($e)] | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:56:7 + --> $DIR/unsafe-attributes-fix.rs:57:7 | LL | meta!(no_mangle); | ^^^^^^^^^ usage of unsafe attribute @@ -47,7 +47,7 @@ LL | meta!(unsafe(no_mangle)); | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:59:8 + --> $DIR/unsafe-attributes-fix.rs:60:8 | LL | meta2!(export_name = "baw"); | ^^^^^^^^^^^ usage of unsafe attribute @@ -60,7 +60,7 @@ LL | meta2!(unsafe(export_name = "baw")); | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:22:11 + --> $DIR/unsafe-attributes-fix.rs:23:11 | LL | #[$e = $l] | ^^ usage of unsafe attribute @@ -77,7 +77,7 @@ LL | #[unsafe($e = $l)] | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:45:27 + --> $DIR/unsafe-attributes-fix.rs:46:27 | LL | #[cfg_attr(all(), link_section = ".custom_section")] | ^^^^^^^^^^^^ usage of unsafe attribute @@ -94,7 +94,7 @@ LL | #[cfg_attr(all(), unsafe(link_section = ".custom_section"))] | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:66:3 + --> $DIR/unsafe-attributes-fix.rs:67:3 | LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute diff --git a/tests/ui/rust-2024/unsafe-env-suggestion.fixed b/tests/ui/rust-2024/unsafe-env-suggestion.fixed index eba35180ef659..912d082832c41 100644 --- a/tests/ui/rust-2024/unsafe-env-suggestion.fixed +++ b/tests/ui/rust-2024/unsafe-env-suggestion.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![deny(deprecated_safe_2024)] diff --git a/tests/ui/rust-2024/unsafe-env-suggestion.rs b/tests/ui/rust-2024/unsafe-env-suggestion.rs index c039d7f258391..f61f93da65ce9 100644 --- a/tests/ui/rust-2024/unsafe-env-suggestion.rs +++ b/tests/ui/rust-2024/unsafe-env-suggestion.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![deny(deprecated_safe_2024)] diff --git a/tests/ui/rust-2024/unsafe-env-suggestion.stderr b/tests/ui/rust-2024/unsafe-env-suggestion.stderr index 3c5ceaaaf425e..151e80bb5d9e0 100644 --- a/tests/ui/rust-2024/unsafe-env-suggestion.stderr +++ b/tests/ui/rust-2024/unsafe-env-suggestion.stderr @@ -1,5 +1,5 @@ error: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block - --> $DIR/unsafe-env-suggestion.rs:9:5 + --> $DIR/unsafe-env-suggestion.rs:10:5 | LL | env::set_var("FOO", "BAR"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | env::set_var("FOO", "BAR"); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! = note: for more information, see note: the lint level is defined here - --> $DIR/unsafe-env-suggestion.rs:3:9 + --> $DIR/unsafe-env-suggestion.rs:4:9 | LL | #![deny(deprecated_safe_2024)] | ^^^^^^^^^^^^^^^^^^^^ @@ -18,7 +18,7 @@ LL ~ unsafe { env::set_var("FOO", "BAR") }; | error: call to deprecated safe function `std::env::remove_var` is unsafe and requires unsafe block - --> $DIR/unsafe-env-suggestion.rs:12:5 + --> $DIR/unsafe-env-suggestion.rs:13:5 | LL | env::remove_var("FOO"); | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed index f686809615fb0..80ef37ef9c6bd 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![deny(missing_unsafe_on_extern)] diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs index 00f1cbdab54ff..53b3933273d63 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ run-rustfix #![deny(missing_unsafe_on_extern)] diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr index 9a535fbbaf5e4..f27e865db468b 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr @@ -1,5 +1,5 @@ error: extern blocks should be unsafe - --> $DIR/unsafe-extern-suggestion.rs:6:1 + --> $DIR/unsafe-extern-suggestion.rs:7:1 | LL | extern "C" { | ^ @@ -16,7 +16,7 @@ LL | | } = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! = note: for more information, see note: the lint level is defined here - --> $DIR/unsafe-extern-suggestion.rs:3:9 + --> $DIR/unsafe-extern-suggestion.rs:4:9 | LL | #![deny(missing_unsafe_on_extern)] | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/self_type_keyword.rs b/tests/ui/self/self_type_keyword.rs index bd051279a727f..463872585f942 100644 --- a/tests/ui/self/self_type_keyword.rs +++ b/tests/ui/self/self_type_keyword.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod foo { struct Self; //~^ ERROR expected identifier, found keyword `Self` diff --git a/tests/ui/self/self_type_keyword.stderr b/tests/ui/self/self_type_keyword.stderr index f22d04bb227e4..06761bb40c031 100644 --- a/tests/ui/self/self_type_keyword.stderr +++ b/tests/ui/self/self_type_keyword.stderr @@ -1,23 +1,23 @@ error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:2:10 + --> $DIR/self_type_keyword.rs:3:10 | LL | struct Self; | ^^^^ expected identifier, found keyword error: lifetimes cannot use keyword names - --> $DIR/self_type_keyword.rs:6:12 + --> $DIR/self_type_keyword.rs:7:12 | LL | struct Bar<'Self>; | ^^^^^ error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:14:13 + --> $DIR/self_type_keyword.rs:15:13 | LL | ref Self => (), | ^^^^ expected identifier, found keyword error: `mut` must be followed by a named binding - --> $DIR/self_type_keyword.rs:16:9 + --> $DIR/self_type_keyword.rs:17:9 | LL | mut Self => (), | ^^^^ @@ -30,49 +30,49 @@ LL + Self => (), | error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:19:17 + --> $DIR/self_type_keyword.rs:20:17 | LL | ref mut Self => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:21:15 + --> $DIR/self_type_keyword.rs:22:15 | LL | Foo { Self } => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:29:26 + --> $DIR/self_type_keyword.rs:30:26 | LL | extern crate core as Self; | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:34:32 + --> $DIR/self_type_keyword.rs:35:32 | LL | use std::option::Option as Self; | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:39:11 + --> $DIR/self_type_keyword.rs:40:11 | LL | trait Self {} | ^^^^ expected identifier, found keyword error[E0531]: cannot find unit struct, unit variant or constant `Self` in this scope - --> $DIR/self_type_keyword.rs:16:13 + --> $DIR/self_type_keyword.rs:17:13 | LL | mut Self => (), | ^^^^ not found in this scope | note: unit struct `foo::Self` exists but is inaccessible - --> $DIR/self_type_keyword.rs:2:3 + --> $DIR/self_type_keyword.rs:3:3 | LL | struct Self; | ^^^^^^^^^^^^ not accessible error[E0392]: lifetime parameter `'Self` is never used - --> $DIR/self_type_keyword.rs:6:12 + --> $DIR/self_type_keyword.rs:7:12 | LL | struct Bar<'Self>; | ^^^^^ unused lifetime parameter @@ -80,7 +80,7 @@ LL | struct Bar<'Self>; = help: consider removing `'Self`, referring to it in a field, or using a marker such as `PhantomData` error[E0308]: mismatched types - --> $DIR/self_type_keyword.rs:21:9 + --> $DIR/self_type_keyword.rs:22:9 | LL | match 15 { | -- this expression has type `{integer}` @@ -89,7 +89,7 @@ LL | Foo { Self } => (), | ^^^^^^^^^^^^ expected integer, found `Foo` error[E0026]: struct `Foo` does not have a field named `Self` - --> $DIR/self_type_keyword.rs:21:15 + --> $DIR/self_type_keyword.rs:22:15 | LL | Foo { Self } => (), | ^^^^ struct `Foo` does not have this field diff --git a/tests/ui/shadowed/shadowed-trait-methods.rs b/tests/ui/shadowed/shadowed-trait-methods.rs index 6cc5159fd0896..824e39e4056b5 100644 --- a/tests/ui/shadowed/shadowed-trait-methods.rs +++ b/tests/ui/shadowed/shadowed-trait-methods.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Test that methods from shadowed traits cannot be used mod foo { diff --git a/tests/ui/shadowed/shadowed-trait-methods.stderr b/tests/ui/shadowed/shadowed-trait-methods.stderr index 2c990fababf9f..647d2c7c95cb1 100644 --- a/tests/ui/shadowed/shadowed-trait-methods.stderr +++ b/tests/ui/shadowed/shadowed-trait-methods.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `f` found for unit type `()` in the current scope - --> $DIR/shadowed-trait-methods.rs:13:8 + --> $DIR/shadowed-trait-methods.rs:14:8 | LL | pub trait T { fn f(&self) {} } | - the method is available for `()` here diff --git a/tests/ui/simd/portable-intrinsics-arent-exposed.rs b/tests/ui/simd/portable-intrinsics-arent-exposed.rs index 667c8b67b1d46..90aa2cc03ea9b 100644 --- a/tests/ui/simd/portable-intrinsics-arent-exposed.rs +++ b/tests/ui/simd/portable-intrinsics-arent-exposed.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // May not matter, since people can use them with a nightly feature. // However this tests to guarantee they don't leak out via portable_simd, // and thus don't accidentally get stabilized. diff --git a/tests/ui/simd/portable-intrinsics-arent-exposed.stderr b/tests/ui/simd/portable-intrinsics-arent-exposed.stderr index 71b4273fa0630..043a4ca376184 100644 --- a/tests/ui/simd/portable-intrinsics-arent-exposed.stderr +++ b/tests/ui/simd/portable-intrinsics-arent-exposed.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: you might be missing crate `core` - --> $DIR/portable-intrinsics-arent-exposed.rs:4:5 + --> $DIR/portable-intrinsics-arent-exposed.rs:5:5 | LL | use core::simd::intrinsics; | ^^^^ @@ -8,7 +8,7 @@ LL | use core::simd::intrinsics; | help: try using `std` instead of `core`: `std` error[E0432]: unresolved import `std::simd::intrinsics` - --> $DIR/portable-intrinsics-arent-exposed.rs:5:5 + --> $DIR/portable-intrinsics-arent-exposed.rs:6:5 | LL | use std::simd::intrinsics; | ^^^^^^^^^^^^^^^^^^^^^ no `intrinsics` in `simd` diff --git a/tests/ui/stats/input-stats.rs b/tests/ui/stats/input-stats.rs index 4e8e25eb73674..86e904202c1b1 100644 --- a/tests/ui/stats/input-stats.rs +++ b/tests/ui/stats/input-stats.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass //@ compile-flags: -Zinput-stats //@ only-64bit diff --git a/tests/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 a25be862a5daf..d23cd94fd0a24 100644 --- a/tests/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 @@ -1,3 +1,4 @@ +//@ edition:2015 use std::result; impl result { //~ ERROR expected type, found module `result` fn into_future() -> Err {} //~ ERROR expected type, found variant `Err` diff --git a/tests/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 c81ac34aaf49c..112ed6fffd504 100644 --- a/tests/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 @@ -1,5 +1,5 @@ error[E0573]: expected type, found module `result` - --> $DIR/do-not-attempt-to-add-suggestions-with-no-changes.rs:2:6 + --> $DIR/do-not-attempt-to-add-suggestions-with-no-changes.rs:3:6 | LL | impl result { | ^^^^^^ help: an enum with a similar name exists: `Result` @@ -9,7 +9,7 @@ LL | impl result { = 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 + --> $DIR/do-not-attempt-to-add-suggestions-with-no-changes.rs:4:25 | LL | fn into_future() -> Err {} | ^^^ not a type diff --git a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs index a83e496f2703d..d645175eaac96 100644 --- a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs +++ b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ aux-build:hidden-struct.rs extern crate hidden_struct; diff --git a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr index 7036708756d6c..9fb4641065628 100644 --- a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr +++ b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Foo` in this scope - --> $DIR/dont-suggest-foreign-doc-hidden.rs:10:16 + --> $DIR/dont-suggest-foreign-doc-hidden.rs:11:16 | LL | pub fn test(_: Foo) {} | ^^^ not found in this scope @@ -10,13 +10,13 @@ LL + use local::Foo; | error[E0412]: cannot find type `Bar` in this scope - --> $DIR/dont-suggest-foreign-doc-hidden.rs:13:17 + --> $DIR/dont-suggest-foreign-doc-hidden.rs:14:17 | LL | pub fn test2(_: Bar) {} | ^^^ not found in this scope error[E0412]: cannot find type `Baz` in this scope - --> $DIR/dont-suggest-foreign-doc-hidden.rs:16:17 + --> $DIR/dont-suggest-foreign-doc-hidden.rs:17:17 | LL | pub fn test3(_: Baz) {} | ^^^ not found in this scope @@ -27,7 +27,7 @@ LL + use hidden_struct::Baz; | error[E0412]: cannot find type `Quux` in this scope - --> $DIR/dont-suggest-foreign-doc-hidden.rs:19:17 + --> $DIR/dont-suggest-foreign-doc-hidden.rs:20:17 | LL | pub fn test4(_: Quux) {} | ^^^^ not found in this scope @@ -38,7 +38,7 @@ LL + use hidden_struct::Quux; | error[E0277]: the trait bound `i32: Marker` is not satisfied - --> $DIR/dont-suggest-foreign-doc-hidden.rs:25:13 + --> $DIR/dont-suggest-foreign-doc-hidden.rs:26:13 | LL | test5::(); | ^^^ the trait `Marker` is not implemented for `i32` @@ -48,7 +48,7 @@ LL | test5::(); Option Quux note: required by a bound in `test5` - --> $DIR/dont-suggest-foreign-doc-hidden.rs:22:13 + --> $DIR/dont-suggest-foreign-doc-hidden.rs:23:13 | LL | fn test5() {} | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test5` diff --git a/tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs index 06aed9ac98f4b..1a42ae9f6a1ad 100644 --- a/tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs +++ b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod banana { //~^ HELP the following traits which provide `pick` are implemented but not in scope pub struct Chaenomeles; diff --git a/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr index 41ca7d0f8ea34..9adbf754c70e7 100644 --- a/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr +++ b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `pick` found for struct `Chaenomeles` in the current scope - --> $DIR/dont-wrap-ambiguous-receivers.rs:18:25 + --> $DIR/dont-wrap-ambiguous-receivers.rs:19:25 | LL | pub struct Chaenomeles; | ---------------------- method `pick` not found for this struct diff --git a/tests/ui/suggestions/raw-name-use-suggestion.rs b/tests/ui/suggestions/raw-name-use-suggestion.rs index 0a8073c0be2ea..6a86e71173824 100644 --- a/tests/ui/suggestions/raw-name-use-suggestion.rs +++ b/tests/ui/suggestions/raw-name-use-suggestion.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod foo { pub fn r#let() {} pub fn break() {} //~ ERROR expected identifier, found keyword `break` diff --git a/tests/ui/suggestions/raw-name-use-suggestion.stderr b/tests/ui/suggestions/raw-name-use-suggestion.stderr index fb070ffc33230..935a0aa2948b5 100644 --- a/tests/ui/suggestions/raw-name-use-suggestion.stderr +++ b/tests/ui/suggestions/raw-name-use-suggestion.stderr @@ -1,5 +1,5 @@ error: expected identifier, found keyword `break` - --> $DIR/raw-name-use-suggestion.rs:3:12 + --> $DIR/raw-name-use-suggestion.rs:4:12 | LL | pub fn break() {} | ^^^^^ expected identifier, found keyword @@ -10,7 +10,7 @@ LL | pub fn r#break() {} | ++ error: expected identifier, found keyword `let` - --> $DIR/raw-name-use-suggestion.rs:7:10 + --> $DIR/raw-name-use-suggestion.rs:8:10 | LL | foo::let(); | ^^^ expected identifier, found keyword @@ -21,7 +21,7 @@ LL | foo::r#let(); | ++ error[E0425]: cannot find function `r#break` in this scope - --> $DIR/raw-name-use-suggestion.rs:8:5 + --> $DIR/raw-name-use-suggestion.rs:9:5 | LL | r#break(); | ^^^^^^^ not found in this scope diff --git a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.rs b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.rs index 951e7313f0a58..84ecee55325d7 100644 --- a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.rs +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.rs @@ -1,3 +1,4 @@ +//@ edition:2015 pub trait Trait<'a, T> {} pub struct Struct; diff --git a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr index 72ac7209bdf40..dc8cb05721e4f 100644 --- a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr @@ -1,5 +1,5 @@ error[E0404]: expected trait, found struct `Struct` - --> $DIR/suggest-swapping-self-ty-and-trait.rs:13:13 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:14:13 | LL | impl<'a, T> Struct for Trait<'a, T> {} | ^^^^^^^^^ not a trait @@ -11,7 +11,7 @@ LL + impl<'a, T> Trait<'a, T> for Struct {} | error[E0404]: expected trait, found enum `Enum` - --> $DIR/suggest-swapping-self-ty-and-trait.rs:18:13 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:19:13 | LL | impl<'a, T> Enum for Trait<'a, T> {} | ^^^^^^^ not a trait @@ -23,7 +23,7 @@ LL + impl<'a, T> Trait<'a, T> for Enum {} | error[E0404]: expected trait, found union `Union` - --> $DIR/suggest-swapping-self-ty-and-trait.rs:23:13 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:24:13 | LL | impl<'a, T> Union for Trait<'a, T> {} | ^^^^^^^^ not a trait @@ -35,7 +35,7 @@ LL + impl<'a, T> Trait<'a, T> for Union {} | error[E0392]: type parameter `T` is never used - --> $DIR/suggest-swapping-self-ty-and-trait.rs:3:19 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:4:19 | LL | pub struct Struct; | ^ unused type parameter @@ -44,7 +44,7 @@ LL | pub struct Struct; = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead error[E0392]: type parameter `T` is never used - --> $DIR/suggest-swapping-self-ty-and-trait.rs:5:15 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:6:15 | LL | pub enum Enum {} | ^ unused type parameter @@ -53,7 +53,7 @@ LL | pub enum Enum {} = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead error[E0392]: type parameter `T` is never used - --> $DIR/suggest-swapping-self-ty-and-trait.rs:8:17 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:9:17 | LL | pub union Union { | ^ unused type parameter @@ -62,7 +62,7 @@ LL | pub union Union { = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/suggest-swapping-self-ty-and-trait.rs:13:27 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:14:27 | LL | impl<'a, T> Struct for Trait<'a, T> {} | ^^^^^^^^^^^^ @@ -76,7 +76,7 @@ LL | impl<'a, T> Struct for dyn Trait<'a, T> {} | +++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/suggest-swapping-self-ty-and-trait.rs:18:25 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:19:25 | LL | impl<'a, T> Enum for Trait<'a, T> {} | ^^^^^^^^^^^^ @@ -89,7 +89,7 @@ LL | impl<'a, T> Enum for dyn Trait<'a, T> {} | +++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/suggest-swapping-self-ty-and-trait.rs:23:26 + --> $DIR/suggest-swapping-self-ty-and-trait.rs:24:26 | LL | impl<'a, T> Union for Trait<'a, T> {} | ^^^^^^^^^^^^ diff --git a/tests/ui/suggestions/use-placement-typeck.fixed b/tests/ui/suggestions/use-placement-typeck.fixed index 74949495cc32e..753e47ba6b4d1 100644 --- a/tests/ui/suggestions/use-placement-typeck.fixed +++ b/tests/ui/suggestions/use-placement-typeck.fixed @@ -1,3 +1,4 @@ +//@ edition:2015 //@ compile-flags: --test //@ run-rustfix // Checks that the `use` suggestion appears *below* this inner attribute. diff --git a/tests/ui/suggestions/use-placement-typeck.rs b/tests/ui/suggestions/use-placement-typeck.rs index 74e9edafe8163..05e2abe7b4d96 100644 --- a/tests/ui/suggestions/use-placement-typeck.rs +++ b/tests/ui/suggestions/use-placement-typeck.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ compile-flags: --test //@ run-rustfix // Checks that the `use` suggestion appears *below* this inner attribute. diff --git a/tests/ui/suggestions/use-placement-typeck.stderr b/tests/ui/suggestions/use-placement-typeck.stderr index dc2bd96bb21e7..a5eb8ac7d0aa9 100644 --- a/tests/ui/suggestions/use-placement-typeck.stderr +++ b/tests/ui/suggestions/use-placement-typeck.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `abc` found for struct `S` in the current scope - --> $DIR/use-placement-typeck.rs:11:7 + --> $DIR/use-placement-typeck.rs:12:7 | LL | s.abc(); | ^^^ method not found in `S` diff --git a/tests/ui/test-attrs/inaccessible-test-modules.rs b/tests/ui/test-attrs/inaccessible-test-modules.rs index c9237bf2d4d09..9c63ae8dea159 100644 --- a/tests/ui/test-attrs/inaccessible-test-modules.rs +++ b/tests/ui/test-attrs/inaccessible-test-modules.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ compile-flags:--test // the `--test` harness creates modules with these textual names, but diff --git a/tests/ui/test-attrs/inaccessible-test-modules.stderr b/tests/ui/test-attrs/inaccessible-test-modules.stderr index c66dc0d0fc26c..8059506eb27c8 100644 --- a/tests/ui/test-attrs/inaccessible-test-modules.stderr +++ b/tests/ui/test-attrs/inaccessible-test-modules.stderr @@ -1,11 +1,11 @@ error[E0432]: unresolved import `main` - --> $DIR/inaccessible-test-modules.rs:5:5 + --> $DIR/inaccessible-test-modules.rs:6:5 | LL | use main as x; | ^^^^^^^^^ no `main` in the root error[E0432]: unresolved import `test` - --> $DIR/inaccessible-test-modules.rs:6:5 + --> $DIR/inaccessible-test-modules.rs:7:5 | LL | use test as y; | ^^^^^^^^^ no `test` in the root diff --git a/tests/ui/traits/bound/not-on-bare-trait.rs b/tests/ui/traits/bound/not-on-bare-trait.rs index 9e717f3c045e3..0d0194473354b 100644 --- a/tests/ui/traits/bound/not-on-bare-trait.rs +++ b/tests/ui/traits/bound/not-on-bare-trait.rs @@ -1,3 +1,4 @@ +//@ edition:2015 trait Foo { fn dummy(&self) {} } diff --git a/tests/ui/traits/bound/not-on-bare-trait.stderr b/tests/ui/traits/bound/not-on-bare-trait.stderr index fa2c531d53584..72226391f583d 100644 --- a/tests/ui/traits/bound/not-on-bare-trait.stderr +++ b/tests/ui/traits/bound/not-on-bare-trait.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/not-on-bare-trait.rs:7:12 + --> $DIR/not-on-bare-trait.rs:8:12 | LL | fn foo(_x: Foo + Send) { | ^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | fn foo(_x: dyn Foo + Send) { | +++ error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time - --> $DIR/not-on-bare-trait.rs:7:12 + --> $DIR/not-on-bare-trait.rs:8:12 | LL | fn foo(_x: Foo + Send) { | ^^^^^^^^^^ doesn't have a size known at compile-time @@ -30,7 +30,7 @@ LL | fn foo(_x: &(dyn Foo + Send)) { | +++++ + error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time - --> $DIR/not-on-bare-trait.rs:12:12 + --> $DIR/not-on-bare-trait.rs:13:12 | LL | fn bar(_x: (dyn Foo + Send)) { | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/tests/ui/traits/const-traits/issue-102156.rs b/tests/ui/traits/const-traits/issue-102156.rs index fe4e910813013..bd9fdff3e4271 100644 --- a/tests/ui/traits/const-traits/issue-102156.rs +++ b/tests/ui/traits/const-traits/issue-102156.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(allocator_api)] #![feature(const_trait_impl)] diff --git a/tests/ui/traits/const-traits/issue-102156.stderr b/tests/ui/traits/const-traits/issue-102156.stderr index 0c836a614f8ba..20505b685f309 100644 --- a/tests/ui/traits/const-traits/issue-102156.stderr +++ b/tests/ui/traits/const-traits/issue-102156.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: you might be missing crate `core` - --> $DIR/issue-102156.rs:4:5 + --> $DIR/issue-102156.rs:5:5 | LL | use core::convert::{From, TryFrom}; | ^^^^ @@ -8,7 +8,7 @@ LL | use core::convert::{From, TryFrom}; | help: try using `std` instead of `core`: `std` error[E0433]: failed to resolve: you might be missing crate `core` - --> $DIR/issue-102156.rs:4:5 + --> $DIR/issue-102156.rs:5:5 | LL | use core::convert::{From, TryFrom}; | ^^^^ diff --git a/tests/ui/traits/item-privacy.rs b/tests/ui/traits/item-privacy.rs index b8724399e327b..44ba87642371a 100644 --- a/tests/ui/traits/item-privacy.rs +++ b/tests/ui/traits/item-privacy.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![feature(associated_type_defaults)] struct S; diff --git a/tests/ui/traits/item-privacy.stderr b/tests/ui/traits/item-privacy.stderr index bf59cd079a5a9..eb72b307ed0f3 100644 --- a/tests/ui/traits/item-privacy.stderr +++ b/tests/ui/traits/item-privacy.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `a` found for struct `S` in the current scope - --> $DIR/item-privacy.rs:67:7 + --> $DIR/item-privacy.rs:68:7 | LL | struct S; | -------- method `a` not found for this struct @@ -16,7 +16,7 @@ LL + S.b(); | error[E0599]: no method named `b` found for struct `S` in the current scope - --> $DIR/item-privacy.rs:68:7 + --> $DIR/item-privacy.rs:69:7 | LL | struct S; | -------- method `b` not found for this struct @@ -39,7 +39,7 @@ LL + S.c(); | error[E0624]: method `a` is private - --> $DIR/item-privacy.rs:72:7 + --> $DIR/item-privacy.rs:73:7 | LL | fn a(&self) { } | ----------- private method defined here @@ -48,7 +48,7 @@ LL | c.a(); | ^ private method error[E0599]: no function or associated item named `a` found for struct `S` in the current scope - --> $DIR/item-privacy.rs:78:8 + --> $DIR/item-privacy.rs:79:8 | LL | struct S; | -------- function or associated item `a` not found for this struct @@ -59,13 +59,13 @@ LL | S::a(&S); = help: items from traits can only be used if the trait is implemented and in scope = help: trait `method::A` which provides `a` is implemented but not reachable help: there is an associated constant `B` with a similar name - --> $DIR/item-privacy.rs:29:9 + --> $DIR/item-privacy.rs:30:9 | LL | const B: u8 = 0; | ^^^^^^^^^^^ error[E0599]: no function or associated item named `b` found for struct `S` in the current scope - --> $DIR/item-privacy.rs:80:8 + --> $DIR/item-privacy.rs:81:8 | LL | struct S; | -------- function or associated item `b` not found for this struct @@ -75,7 +75,7 @@ LL | S::b(&S); | = help: items from traits can only be used if the trait is in scope help: there is an associated constant `B` with a similar name - --> $DIR/item-privacy.rs:29:9 + --> $DIR/item-privacy.rs:30:9 | LL | const B: u8 = 0; | ^^^^^^^^^^^ @@ -85,7 +85,7 @@ LL + use method::B; | error[E0624]: method `a` is private - --> $DIR/item-privacy.rs:84:14 + --> $DIR/item-privacy.rs:85:14 | LL | fn a(&self) { } | ----------- private method defined here @@ -94,7 +94,7 @@ LL | ::a(&S); | ^ private method error[E0599]: no associated item named `A` found for struct `S` in the current scope - --> $DIR/item-privacy.rs:97:8 + --> $DIR/item-privacy.rs:98:8 | LL | struct S; | -------- associated item `A` not found for this struct @@ -111,7 +111,7 @@ LL + S::B; | error[E0599]: no associated item named `B` found for struct `S` in the current scope - --> $DIR/item-privacy.rs:98:8 + --> $DIR/item-privacy.rs:99:8 | LL | struct S; | -------- associated item `B` not found for this struct @@ -121,7 +121,7 @@ LL | S::B; | = help: items from traits can only be used if the trait is in scope help: there is a method `b` with a similar name - --> $DIR/item-privacy.rs:11:9 + --> $DIR/item-privacy.rs:12:9 | LL | fn b(&self) { } | ^^^^^^^^^^^ @@ -131,14 +131,14 @@ LL + use assoc_const::B; | error[E0038]: the trait `assoc_const::C` is not dyn compatible - --> $DIR/item-privacy.rs:101:10 + --> $DIR/item-privacy.rs:102:10 | LL | ::A; | ^ `assoc_const::C` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/item-privacy.rs:25:15 + --> $DIR/item-privacy.rs:26:15 | LL | const A: u8 = 0; | ^ ...because it contains this associated `const` @@ -156,14 +156,14 @@ LL | const C: u8 = 0; = help: only type `S` implements `assoc_const::C`; consider using it directly instead. error[E0038]: the trait `assoc_const::C` is not dyn compatible - --> $DIR/item-privacy.rs:103:10 + --> $DIR/item-privacy.rs:104:10 | LL | ::B; | ^ `assoc_const::C` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/item-privacy.rs:25:15 + --> $DIR/item-privacy.rs:26:15 | LL | const A: u8 = 0; | ^ ...because it contains this associated `const` @@ -181,7 +181,7 @@ LL | const C: u8 = 0; = help: only type `S` implements `assoc_const::C`; consider using it directly instead. error[E0223]: ambiguous associated type - --> $DIR/item-privacy.rs:116:12 + --> $DIR/item-privacy.rs:117:12 | LL | let _: S::A; | ^^^^ @@ -193,7 +193,7 @@ LL + let _: ::A; | error[E0223]: ambiguous associated type - --> $DIR/item-privacy.rs:117:12 + --> $DIR/item-privacy.rs:118:12 | LL | let _: S::B; | ^^^^ @@ -205,7 +205,7 @@ LL + let _: ::B; | error[E0223]: ambiguous associated type - --> $DIR/item-privacy.rs:118:12 + --> $DIR/item-privacy.rs:119:12 | LL | let _: S::C; | ^^^^ @@ -217,7 +217,7 @@ LL + let _: ::C; | error[E0624]: associated type `A` is private - --> $DIR/item-privacy.rs:120:12 + --> $DIR/item-privacy.rs:121:12 | LL | type A = u8; | ------ the associated type is defined here @@ -226,7 +226,7 @@ LL | let _: T::A; | ^^^^ private associated type error[E0624]: associated type `A` is private - --> $DIR/item-privacy.rs:129:9 + --> $DIR/item-privacy.rs:130:9 | LL | type A = u8; | ------ the associated type is defined here diff --git a/tests/ui/traits/method-private.rs b/tests/ui/traits/method-private.rs index 4cd184854eccc..fe30cf85d2302 100644 --- a/tests/ui/traits/method-private.rs +++ b/tests/ui/traits/method-private.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod inner { pub trait Bar { fn method(&self); diff --git a/tests/ui/traits/method-private.stderr b/tests/ui/traits/method-private.stderr index 274767331bd9e..6e9b57bb69e1e 100644 --- a/tests/ui/traits/method-private.stderr +++ b/tests/ui/traits/method-private.stderr @@ -1,5 +1,5 @@ error[E0624]: method `method` is private - --> $DIR/method-private.rs:19:9 + --> $DIR/method-private.rs:20:9 | LL | fn method(&self) {} | ---------------- private method defined here diff --git a/tests/ui/traits/missing-for-type-in-impl.e2015.stderr b/tests/ui/traits/missing-for-type-in-impl.e2015.stderr index 40ebf8f36af27..1dc351eb9e730 100644 --- a/tests/ui/traits/missing-for-type-in-impl.e2015.stderr +++ b/tests/ui/traits/missing-for-type-in-impl.e2015.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/missing-for-type-in-impl.rs:8:6 + --> $DIR/missing-for-type-in-impl.rs:9:6 | LL | impl Foo { | ^^^^^^^^ @@ -17,7 +17,7 @@ LL | impl Foo for /* Type */ { | ++++++++++++++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/missing-for-type-in-impl.rs:8:6 + --> $DIR/missing-for-type-in-impl.rs:9:6 | LL | impl Foo { | ^^^^^^^^ @@ -35,14 +35,14 @@ LL | impl Foo for /* Type */ { | ++++++++++++++ error[E0038]: the trait `Foo` is not dyn compatible - --> $DIR/missing-for-type-in-impl.rs:8:6 + --> $DIR/missing-for-type-in-impl.rs:9:6 | LL | impl Foo { | ^^^^^^^^ `Foo` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/missing-for-type-in-impl.rs:4:8 + --> $DIR/missing-for-type-in-impl.rs:5:8 | LL | trait Foo { | --- this trait is not dyn compatible... @@ -58,13 +58,13 @@ LL | fn id(me: T) -> T where Self: Sized; | +++++++++++++++++ error[E0277]: the trait bound `i64: Foo` is not satisfied - --> $DIR/missing-for-type-in-impl.rs:19:19 + --> $DIR/missing-for-type-in-impl.rs:20:19 | LL | let x: i64 = >::id(10); | ^^^ the trait `Foo` is not implemented for `i64` | help: this trait has no implementations, consider adding one - --> $DIR/missing-for-type-in-impl.rs:3:1 + --> $DIR/missing-for-type-in-impl.rs:4:1 | LL | trait Foo { | ^^^^^^^^^^^^ diff --git a/tests/ui/traits/missing-for-type-in-impl.e2021.stderr b/tests/ui/traits/missing-for-type-in-impl.e2021.stderr index e79bb0524e93a..359163ac017dc 100644 --- a/tests/ui/traits/missing-for-type-in-impl.e2021.stderr +++ b/tests/ui/traits/missing-for-type-in-impl.e2021.stderr @@ -1,5 +1,5 @@ error[E0782]: expected a type, found a trait - --> $DIR/missing-for-type-in-impl.rs:8:6 + --> $DIR/missing-for-type-in-impl.rs:9:6 | LL | impl Foo { | ^^^^^^^^ @@ -14,13 +14,13 @@ LL | impl Foo for /* Type */ { | ++++++++++++++ error[E0277]: the trait bound `i64: Foo` is not satisfied - --> $DIR/missing-for-type-in-impl.rs:19:19 + --> $DIR/missing-for-type-in-impl.rs:20:19 | LL | let x: i64 = >::id(10); | ^^^ the trait `Foo` is not implemented for `i64` | help: this trait has no implementations, consider adding one - --> $DIR/missing-for-type-in-impl.rs:3:1 + --> $DIR/missing-for-type-in-impl.rs:4:1 | LL | trait Foo { | ^^^^^^^^^^^^ diff --git a/tests/ui/traits/missing-for-type-in-impl.rs b/tests/ui/traits/missing-for-type-in-impl.rs index e8163954274f2..a75e45a103d35 100644 --- a/tests/ui/traits/missing-for-type-in-impl.rs +++ b/tests/ui/traits/missing-for-type-in-impl.rs @@ -1,5 +1,6 @@ //@revisions: e2021 e2015 //@[e2021]edition: 2021 +//@[e2015]edition: 2015 trait Foo { fn id(me: T) -> T; } diff --git a/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.rs b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.rs index d5a500900ff03..9f7048fc756d0 100644 --- a/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.rs +++ b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //! Regression test for https://github.com/rust-lang/rust/issues/10465 pub mod a { diff --git a/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.stderr b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.stderr index ffd8fd39250d1..f08febe8cc5e8 100644 --- a/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.stderr +++ b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `foo` found for reference `&B` in the current scope - --> $DIR/nested-mod-trait-method-lookup-leak-10465.rs:19:15 + --> $DIR/nested-mod-trait-method-lookup-leak-10465.rs:20:15 | LL | b.foo(); | ^^^ method not found in `&B` diff --git a/tests/ui/traits/unspecified-self-in-trait-ref.rs b/tests/ui/traits/unspecified-self-in-trait-ref.rs index 158b5a9855752..f175a8e6dbdfc 100644 --- a/tests/ui/traits/unspecified-self-in-trait-ref.rs +++ b/tests/ui/traits/unspecified-self-in-trait-ref.rs @@ -1,3 +1,4 @@ +//@ edition:2015 pub trait Foo { fn foo(&self); } diff --git a/tests/ui/traits/unspecified-self-in-trait-ref.stderr b/tests/ui/traits/unspecified-self-in-trait-ref.stderr index 3fa74d79adc32..86b77193155d7 100644 --- a/tests/ui/traits/unspecified-self-in-trait-ref.stderr +++ b/tests/ui/traits/unspecified-self-in-trait-ref.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/unspecified-self-in-trait-ref.rs:10:13 + --> $DIR/unspecified-self-in-trait-ref.rs:11:13 | LL | let a = Foo::lol(); | ^^^ @@ -13,13 +13,13 @@ LL | let a = ::lol(); | ++++ + error[E0599]: no function or associated item named `lol` found for trait object `dyn Foo<_>` in the current scope - --> $DIR/unspecified-self-in-trait-ref.rs:10:18 + --> $DIR/unspecified-self-in-trait-ref.rs:11:18 | LL | let a = Foo::lol(); | ^^^ function or associated item not found in `dyn Foo<_>` warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/unspecified-self-in-trait-ref.rs:14:13 + --> $DIR/unspecified-self-in-trait-ref.rs:15:13 | LL | let b = Foo::<_>::lol(); | ^^^^^^^^ @@ -32,13 +32,13 @@ LL | let b = >::lol(); | ++++ + error[E0599]: no function or associated item named `lol` found for trait object `dyn Foo<_>` in the current scope - --> $DIR/unspecified-self-in-trait-ref.rs:14:23 + --> $DIR/unspecified-self-in-trait-ref.rs:15:23 | LL | let b = Foo::<_>::lol(); | ^^^ function or associated item not found in `dyn Foo<_>` warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/unspecified-self-in-trait-ref.rs:18:13 + --> $DIR/unspecified-self-in-trait-ref.rs:19:13 | LL | let c = Bar::lol(); | ^^^ @@ -51,13 +51,13 @@ LL | let c = ::lol(); | ++++ + error[E0599]: no function or associated item named `lol` found for trait object `dyn Bar<_, _>` in the current scope - --> $DIR/unspecified-self-in-trait-ref.rs:18:18 + --> $DIR/unspecified-self-in-trait-ref.rs:19:18 | LL | let c = Bar::lol(); | ^^^ function or associated item not found in `dyn Bar<_, _>` warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/unspecified-self-in-trait-ref.rs:22:13 + --> $DIR/unspecified-self-in-trait-ref.rs:23:13 | LL | let d = Bar::::lol(); | ^^^^^^^^^^^^^^^ @@ -70,13 +70,13 @@ LL | let d = >::lol(); | ++++ + error[E0599]: no function or associated item named `lol` found for trait object `dyn Bar` in the current scope - --> $DIR/unspecified-self-in-trait-ref.rs:22:30 + --> $DIR/unspecified-self-in-trait-ref.rs:23:30 | LL | let d = Bar::::lol(); | ^^^ function or associated item not found in `dyn Bar` warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/unspecified-self-in-trait-ref.rs:26:13 + --> $DIR/unspecified-self-in-trait-ref.rs:27:13 | LL | let e = Bar::::lol(); | ^^^^^^^^^^^^ @@ -89,7 +89,7 @@ LL | let e = >::lol(); | ++++ + error[E0393]: the type parameter `A` must be explicitly specified - --> $DIR/unspecified-self-in-trait-ref.rs:26:13 + --> $DIR/unspecified-self-in-trait-ref.rs:27:13 | LL | pub trait Bar { | ------------------------------ type parameter `A` must be specified for this diff --git a/tests/ui/typeck/issue-43189.rs b/tests/ui/typeck/issue-43189.rs index ee0fe15eebace..25ab607a859df 100644 --- a/tests/ui/typeck/issue-43189.rs +++ b/tests/ui/typeck/issue-43189.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Issue 46112: An extern crate pub re-exporting libcore was causing // paths rooted from `std` to be misrendered in the diagnostic output. diff --git a/tests/ui/typeck/issue-43189.stderr b/tests/ui/typeck/issue-43189.stderr index 3cc1ba9ddfe18..8432cbeca2a4b 100644 --- a/tests/ui/typeck/issue-43189.stderr +++ b/tests/ui/typeck/issue-43189.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `a` found for unit type `()` in the current scope - --> $DIR/issue-43189.rs:9:8 + --> $DIR/issue-43189.rs:10:8 | LL | ().a(); | ^ method not found in `()` diff --git a/tests/ui/unresolved/unresolved-asterisk-imports.rs b/tests/ui/unresolved/unresolved-asterisk-imports.rs index 2d853a66c8d06..1ec5f35157c52 100644 --- a/tests/ui/unresolved/unresolved-asterisk-imports.rs +++ b/tests/ui/unresolved/unresolved-asterisk-imports.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use not_existing_crate::*; //~ ERROR unresolved import `not_existing_crate use std as foo; diff --git a/tests/ui/unresolved/unresolved-asterisk-imports.stderr b/tests/ui/unresolved/unresolved-asterisk-imports.stderr index e84f1975112b0..2c783cf523dfa 100644 --- a/tests/ui/unresolved/unresolved-asterisk-imports.stderr +++ b/tests/ui/unresolved/unresolved-asterisk-imports.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `not_existing_crate` - --> $DIR/unresolved-asterisk-imports.rs:1:5 + --> $DIR/unresolved-asterisk-imports.rs:2:5 | LL | use not_existing_crate::*; | ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `not_existing_crate` diff --git a/tests/ui/unresolved/unresolved-candidates.rs b/tests/ui/unresolved/unresolved-candidates.rs index 38b227f609b26..95cc1d92609cf 100644 --- a/tests/ui/unresolved/unresolved-candidates.rs +++ b/tests/ui/unresolved/unresolved-candidates.rs @@ -1,3 +1,4 @@ +//@ edition:2015 mod a { pub trait Trait {} } diff --git a/tests/ui/unresolved/unresolved-candidates.stderr b/tests/ui/unresolved/unresolved-candidates.stderr index 7be1bcd38de59..55b9d8ec6e8fc 100644 --- a/tests/ui/unresolved/unresolved-candidates.stderr +++ b/tests/ui/unresolved/unresolved-candidates.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `Trait` - --> $DIR/unresolved-candidates.rs:6:9 + --> $DIR/unresolved-candidates.rs:7:9 | LL | use Trait; | ^^^^^ no `Trait` in the root @@ -10,7 +10,7 @@ LL | use a::Trait; | +++ error[E0405]: cannot find trait `Trait` in this scope - --> $DIR/unresolved-candidates.rs:10:10 + --> $DIR/unresolved-candidates.rs:11:10 | LL | impl Trait for () {} | ^^^^^ not found in this scope diff --git a/tests/ui/unresolved/unresolved-import.rs b/tests/ui/unresolved/unresolved-import.rs index b0fdcf970155b..8795a5342b2fd 100644 --- a/tests/ui/unresolved/unresolved-import.rs +++ b/tests/ui/unresolved/unresolved-import.rs @@ -1,3 +1,4 @@ +//@ edition:2015 use foo::bar; //~^ ERROR unresolved import `foo` [E0432] //~| NOTE use of unresolved module or unlinked crate `foo` diff --git a/tests/ui/unresolved/unresolved-import.stderr b/tests/ui/unresolved/unresolved-import.stderr index 4001695459a90..690aa5e551e6d 100644 --- a/tests/ui/unresolved/unresolved-import.stderr +++ b/tests/ui/unresolved/unresolved-import.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `foo` - --> $DIR/unresolved-import.rs:1:5 + --> $DIR/unresolved-import.rs:2:5 | LL | use foo::bar; | ^^^ use of unresolved module or unlinked crate `foo` @@ -10,7 +10,7 @@ LL + extern crate foo; | error[E0432]: unresolved import `bar::Baz` - --> $DIR/unresolved-import.rs:7:5 + --> $DIR/unresolved-import.rs:8:5 | LL | use bar::Baz as x; | ^^^^^---^^^^^ @@ -19,7 +19,7 @@ LL | use bar::Baz as x; | no `Baz` in `bar` error[E0432]: unresolved import `food::baz` - --> $DIR/unresolved-import.rs:13:5 + --> $DIR/unresolved-import.rs:14:5 | LL | use food::baz; | ^^^^^^--- @@ -28,13 +28,13 @@ LL | use food::baz; | no `baz` in `food` | note: module `food::zug::baz` exists but is inaccessible - --> $DIR/unresolved-import.rs:33:9 + --> $DIR/unresolved-import.rs:34:9 | LL | pub mod baz { | ^^^^^^^^^^^ not accessible error[E0432]: unresolved import `food::beens` - --> $DIR/unresolved-import.rs:19:12 + --> $DIR/unresolved-import.rs:20:12 | LL | use food::{beens as Foo}; | -----^^^^^^^ @@ -43,13 +43,13 @@ LL | use food::{beens as Foo}; | help: a similar name exists in the module: `beans` error[E0432]: unresolved import `MyEnum` - --> $DIR/unresolved-import.rs:46:9 + --> $DIR/unresolved-import.rs:47:9 | LL | use MyEnum::*; | ^^^^^^ help: a similar path exists: `self::MyEnum` error[E0432]: unresolved import `Enum` - --> $DIR/unresolved-import.rs:57:9 + --> $DIR/unresolved-import.rs:58:9 | LL | use Enum::*; | ^^^^ help: a similar path exists: `self::Enum` diff --git a/tests/ui/variants/variant-used-as-type.rs b/tests/ui/variants/variant-used-as-type.rs index f27db1024760a..0108d1b2ba842 100644 --- a/tests/ui/variants/variant-used-as-type.rs +++ b/tests/ui/variants/variant-used-as-type.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Test error message when enum variants are used as types diff --git a/tests/ui/variants/variant-used-as-type.stderr b/tests/ui/variants/variant-used-as-type.stderr index 1857c10a8e9ba..328db2bb70887 100644 --- a/tests/ui/variants/variant-used-as-type.stderr +++ b/tests/ui/variants/variant-used-as-type.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `Ty::A` - --> $DIR/variant-used-as-type.rs:7:7 + --> $DIR/variant-used-as-type.rs:8:7 | LL | B(Ty::A), | ^^^^^ not a type @@ -14,7 +14,7 @@ LL + B(Ty), | error[E0573]: expected type, found variant `E::A` - --> $DIR/variant-used-as-type.rs:17:6 + --> $DIR/variant-used-as-type.rs:18:6 | LL | impl E::A {} | ^^^^ not a type diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs index 89e4b77b6cd42..519e913480ec3 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs @@ -1,3 +1,4 @@ +//@ edition:2015 // Regression test for ICE #122989 trait Foo> { //~^ WARN trait objects without an explicit `dyn` are deprecated diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr index a0b443ec85011..0ecb3e74eb571 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:20 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:3:20 | LL | trait Foo> { | ^^^^^^ @@ -13,7 +13,7 @@ LL | trait Foo> { | +++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:10:20 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:20 | LL | trait Bar> {} | ^^^^^^ @@ -26,38 +26,38 @@ LL | trait Bar> {} | +++ error[E0391]: cycle detected when computing type of `Foo::N` - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:11 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:3:11 | LL | trait Foo> { | ^^^^^^^^^^^^^^^ | note: ...which requires computing type of `Bar::M`... - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:10:11 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:11 | LL | trait Bar> {} | ^^^^^^^^^^^^^^^ = note: ...which again requires computing type of `Foo::N`, completing the cycle note: cycle used when checking that `Foo` is well-formed - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:1 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:3:1 | LL | trait Foo> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error[E0391]: cycle detected when computing type of `Foo::N` - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:11 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:3:11 | LL | trait Foo> { | ^^^^^^^^^^^^^^^ | note: ...which requires computing type of `Bar::M`... - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:10:11 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:11 | LL | trait Bar> {} | ^^^^^^^^^^^^^^^ = note: ...which again requires computing type of `Foo::N`, completing the cycle note: cycle used when checking that `Foo` is well-formed - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:1 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:3:1 | LL | trait Foo> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ From 6e1b054809c7321d759ca7e34fd0f577e2cbf05a Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Fri, 5 Sep 2025 14:54:43 -0500 Subject: [PATCH 2/2] Gate 2018 UI tests --- .../argument-suggestions/extra_arguments.rs | 1 + .../extra_arguments.stderr | 88 ++++----- .../associated-const-range-match-patterns.rs | 1 + .../overlaping-bound-suggestion.rs | 1 + .../overlaping-bound-suggestion.stderr | 2 +- tests/ui/associated-types/issue-43924.rs | 1 + tests/ui/associated-types/issue-43924.stderr | 6 +- tests/ui/block-result/issue-5500.rs | 1 + tests/ui/block-result/issue-5500.stderr | 2 +- .../borrowck/borrowck-closures-mut-and-imm.rs | 1 + .../borrowck-closures-mut-and-imm.stderr | 16 +- .../borrowck/borrowck-closures-mut-of-imm.rs | 1 + .../borrowck-closures-mut-of-imm.stderr | 6 +- .../borrowck/borrowck-closures-mut-of-mut.rs | 1 + .../borrowck-closures-mut-of-mut.stderr | 2 +- .../borrowck-closures-slice-patterns.rs | 1 + .../borrowck-closures-slice-patterns.stderr | 16 +- .../borrowck-closures-two-mut-fail.rs | 1 + .../borrowck-closures-two-mut-fail.stderr | 10 +- .../ui/borrowck/borrowck-closures-two-mut.rs | 1 + .../borrowck/borrowck-closures-two-mut.stderr | 10 +- .../borrowck/borrowck-closures-unique-imm.rs | 1 + .../borrowck-closures-unique-imm.stderr | 2 +- tests/ui/borrowck/borrowck-closures-unique.rs | 1 + .../borrowck/borrowck-closures-unique.stderr | 8 +- .../borrowck/borrowck-insert-during-each.rs | 1 + .../borrowck-insert-during-each.stderr | 4 +- tests/ui/borrowck/borrowck-loan-rcvr.rs | 1 + tests/ui/borrowck/borrowck-loan-rcvr.stderr | 4 +- ...ue-55492-borrowck-migrate-scans-parents.rs | 1 + ...5492-borrowck-migrate-scans-parents.stderr | 12 +- .../suggest-lt-on-ty-alias-w-generics.rs | 1 + .../suggest-lt-on-ty-alias-w-generics.stderr | 6 +- .../2229_closure_analysis/issue-90465.fixed | 1 + .../2229_closure_analysis/issue-90465.rs | 1 + .../2229_closure_analysis/issue-90465.stderr | 4 +- .../migrations/auto_traits.fixed | 1 + .../migrations/auto_traits.rs | 1 + .../migrations/auto_traits.stderr | 8 +- .../insignificant_drop_attr_migrations.fixed | 1 + .../insignificant_drop_attr_migrations.rs | 1 + .../insignificant_drop_attr_migrations.stderr | 6 +- .../migrations/macro.fixed | 1 + .../2229_closure_analysis/migrations/macro.rs | 1 + .../migrations/macro.stderr | 4 +- .../migrations/migrations_rustfix.fixed | 1 + .../migrations/migrations_rustfix.rs | 1 + .../migrations/migrations_rustfix.stderr | 6 +- .../migrations/mir_calls_to_shims.fixed | 1 + .../migrations/mir_calls_to_shims.rs | 1 + .../migrations/mir_calls_to_shims.stderr | 4 +- .../migrations/multi_diagnostics.fixed | 1 + .../migrations/multi_diagnostics.rs | 1 + .../migrations/multi_diagnostics.stderr | 12 +- .../migrations/precise.fixed | 1 + .../migrations/precise.rs | 1 + .../migrations/precise.stderr | 6 +- .../migrations/significant_drop.fixed | 1 + .../migrations/significant_drop.rs | 1 + .../migrations/significant_drop.stderr | 22 +-- ...ure-bounds-static-cant-capture-borrowed.rs | 1 + ...bounds-static-cant-capture-borrowed.stderr | 6 +- .../closure-clone-requires-captured-clone.rs | 1 + ...osure-clone-requires-captured-clone.stderr | 10 +- .../closure-referencing-itself-issue-25954.rs | 1 + ...sure-referencing-itself-issue-25954.stderr | 2 +- tests/ui/closures/issue-6801.rs | 1 + tests/ui/closures/issue-6801.stderr | 2 +- tests/ui/closures/issue-81700-mut-borrow.rs | 1 + .../ui/closures/issue-81700-mut-borrow.stderr | 2 +- .../closures/print/closure-print-generic-1.rs | 1 + .../print/closure-print-generic-1.stderr | 6 +- .../print/closure-print-generic-verbose-1.rs | 1 + .../closure-print-generic-verbose-1.stderr | 4 +- tests/ui/consts/const-eval/const_panic.rs | 1 + tests/ui/consts/const-eval/const_panic.stderr | 24 +-- tests/ui/consts/const-eval/issue-85907.rs | 1 + tests/ui/consts/const-eval/issue-85907.stderr | 2 +- .../consts/const-eval/ub-upvars.32bit.stderr | 2 +- .../consts/const-eval/ub-upvars.64bit.stderr | 2 +- tests/ui/consts/const-eval/ub-upvars.rs | 1 + .../consts/issue-66693-panic-in-array-len.rs | 1 + .../issue-66693-panic-in-array-len.stderr | 4 +- tests/ui/consts/issue-66693.rs | 1 + tests/ui/consts/issue-66693.stderr | 10 +- .../contract-captures-via-closure-noncopy.rs | 1 + ...ntract-captures-via-closure-noncopy.stderr | 14 +- tests/ui/coroutine/dropck.rs | 1 + tests/ui/coroutine/dropck.stderr | 4 +- .../coroutine/yield-while-ref-reborrowed.rs | 1 + .../yield-while-ref-reborrowed.stderr | 2 +- tests/ui/drop/dynamic-drop.rs | 1 + tests/ui/editions/edition-cstr-2015-2018.rs | 1 + .../ui/editions/edition-cstr-2015-2018.stderr | 12 +- .../ergonomic-clones/closure/print-verbose.rs | 1 + .../closure/print-verbose.stderr | 4 +- tests/ui/ergonomic-clones/closure/print.rs | 1 + .../ui/ergonomic-clones/closure/print.stderr | 6 +- tests/ui/error-codes/E0501.rs | 1 + tests/ui/error-codes/E0501.stderr | 4 +- tests/ui/error-codes/E0504.rs | 1 + tests/ui/error-codes/E0504.stderr | 4 +- tests/ui/fmt/format-args-capture.rs | 1 + .../gat-trait-path-parenthesised-args.rs | 1 + .../gat-trait-path-parenthesised-args.stderr | 52 +++--- ...inherent_impl_on_rigid_type.current.stderr | 4 +- ...on_inherent_impl_on_rigid_type.next.stderr | 2 +- ...l_method_on_inherent_impl_on_rigid_type.rs | 1 + ...plicit-hrtb-without-dyn.edition2021.stderr | 4 +- ...h-implicit-hrtb-without-dyn.pre2021.stderr | 9 + .../generic-with-implicit-hrtb-without-dyn.rs | 5 +- .../would-constrain-opaque.current.stderr | 8 +- .../method/would-constrain-opaque.next.stderr | 4 +- .../method/would-constrain-opaque.rs | 1 + tests/ui/impl-trait/where-allowed-2.rs | 1 + tests/ui/impl-trait/where-allowed-2.stderr | 2 +- tests/ui/impl-trait/where-allowed.rs | 1 + tests/ui/impl-trait/where-allowed.stderr | 102 +++++------ tests/ui/issues/issue-16966.rs | 1 + tests/ui/issues/issue-16966.stderr | 2 +- .../iterators/generator_returned_from_fn.rs | 1 + .../generator_returned_from_fn.stderr | 14 +- .../iterators/into-iter-on-arrays-lint.fixed | 1 + .../ui/iterators/into-iter-on-arrays-lint.rs | 1 + .../iterators/into-iter-on-arrays-lint.stderr | 24 +-- .../fulfilled_expectation_early_lints.rs | 1 + .../issue-54538-unused-parens-lint.fixed | 1 + .../unused/issue-54538-unused-parens-lint.rs | 1 + .../issue-54538-unused-parens-lint.stderr | 60 +++---- tests/ui/macros/assert-macro-owned.rs | 1 + tests/ui/macros/assert-trailing-junk.rs | 1 + ...rt-trailing-junk.with-generic-asset.stderr | 14 +- ...trailing-junk.without-generic-asset.stderr | 14 +- .../auxiliary/borrowck-error-in-macro.rs | 1 + tests/ui/macros/auxiliary/fancy-panic.rs | 1 + tests/ui/macros/auxiliary/or-pattern.rs | 1 + tests/ui/macros/borrowck-error-in-macro.rs | 1 + .../ui/macros/borrowck-error-in-macro.stderr | 4 +- tests/ui/macros/macro-comma-behavior-rpass.rs | 1 + tests/ui/macros/macro-follow-rpass.rs | 1 + tests/ui/macros/macro-follow.rs | 1 + tests/ui/macros/macro-follow.stderr | 170 +++++++++--------- .../ui/macros/macro-input-future-proofing.rs | 1 + .../macros/macro-input-future-proofing.stderr | 18 +- .../macro-pat-pattern-followed-by-or.rs | 1 + tests/ui/macros/no-matching-rule.rs | 1 + tests/ui/macros/no-matching-rule.stderr | 2 +- tests/ui/macros/non-fmt-panic.fixed | 1 + tests/ui/macros/non-fmt-panic.rs | 1 + tests/ui/macros/non-fmt-panic.stderr | 70 ++++---- ...option-result-type-param-mismatch-13466.rs | 1 + ...on-result-type-param-mismatch-13466.stderr | 4 +- .../missing-method-on-type-parameter.rs | 1 + .../missing-method-on-type-parameter.stderr | 2 +- tests/ui/mir/mir_calls_to_shims.rs | 1 + .../never_type/diverging-tuple-parts-39485.rs | 1 + .../diverging-tuple-parts-39485.stderr | 4 +- tests/ui/never_type/impl_trait_fallback2.rs | 1 + .../ui/never_type/impl_trait_fallback2.stderr | 4 +- tests/ui/never_type/impl_trait_fallback3.rs | 1 + .../ui/never_type/impl_trait_fallback3.stderr | 4 +- tests/ui/never_type/impl_trait_fallback4.rs | 1 + .../ui/never_type/impl_trait_fallback4.stderr | 4 +- tests/ui/never_type/issue-5500-1.rs | 1 + tests/ui/nll/closure-access-spans.rs | 1 + tests/ui/nll/closure-access-spans.stderr | 18 +- tests/ui/nll/closure-borrow-spans.rs | 1 + tests/ui/nll/closure-borrow-spans.stderr | 28 +-- tests/ui/nll/closure-captures.rs | 1 + tests/ui/nll/closure-captures.stderr | 24 +-- tests/ui/nll/closures-in-loops.rs | 1 + tests/ui/nll/closures-in-loops.stderr | 6 +- ...sue-27282-mutate-before-diverging-arm-1.rs | 1 + ...27282-mutate-before-diverging-arm-1.stderr | 2 +- ...sue-27282-mutate-before-diverging-arm-2.rs | 1 + ...27282-mutate-before-diverging-arm-2.stderr | 2 +- ...sue-27282-mutate-before-diverging-arm-3.rs | 1 + ...27282-mutate-before-diverging-arm-3.stderr | 2 +- .../issue-27282-reborrow-ref-mut-in-guard.rs | 1 + ...sue-27282-reborrow-ref-mut-in-guard.stderr | 4 +- tests/ui/nll/issue-27583.rs | 1 + ...ssue-42574-diagnostic-in-nested-closure.rs | 1 + ...-42574-diagnostic-in-nested-closure.stderr | 4 +- tests/ui/nll/issue-51268.rs | 1 + tests/ui/nll/issue-51268.stderr | 2 +- ...issue-52663-span-decl-captured-variable.rs | 1 + ...e-52663-span-decl-captured-variable.stderr | 4 +- ...param-closure-outlives-from-return-type.rs | 1 + ...m-closure-outlives-from-return-type.stderr | 8 +- tests/ui/nll/ty-outlives/ty-param-fn.rs | 1 + tests/ui/nll/ty-outlives/ty-param-fn.stderr | 4 +- tests/ui/or-patterns/binding-typo-2.rs | 4 +- tests/ui/panics/explicit-panic-msg.rs | 1 + .../ui/panics/issue-47429-short-backtraces.rs | 1 + .../issue-47429-short-backtraces.run.stderr | 2 +- tests/ui/panics/panic-macro-any-wrapped.rs | 1 + tests/ui/panics/panic-macro-any.rs | 1 + tests/ui/panics/runtime-switch.rs | 1 + tests/ui/panics/runtime-switch.run.stderr | 2 +- .../short-ice-remove-middle-frames-2.rs | 1 + ...hort-ice-remove-middle-frames-2.run.stderr | 2 +- .../panics/short-ice-remove-middle-frames.rs | 1 + .../short-ice-remove-middle-frames.run.stderr | 2 +- .../attribute/attr-stmt-expr-attr-bad.rs | 1 + .../attribute/attr-stmt-expr-attr-bad.stderr | 106 +++++------ .../ui/parser/help-set-edition-ice-122130.rs | 1 + .../parser/help-set-edition-ice-122130.stderr | 4 +- .../issue-63115-range-pat-interpolated.rs | 1 + tests/ui/parser/trait-object-bad-parens.rs | 1 + .../ui/parser/trait-object-bad-parens.stderr | 8 +- .../parser/trait-object-polytrait-priority.rs | 1 + .../trait-object-polytrait-priority.stderr | 2 +- tests/ui/pattern/inc-range-pat.rs | 1 + .../borrowck-move-ref-pattern.rs | 1 + .../borrowck-move-ref-pattern.stderr | 36 ++-- ...ve-ref-patterns-closure-captures-inside.rs | 1 + ...ef-patterns-closure-captures-inside.stderr | 72 ++++---- .../move-ref-patterns-closure-captures.rs | 1 + .../move-ref-patterns-closure-captures.stderr | 12 +- tests/ui/print_type_sizes/coroutine.rs | 1 + tests/ui/print_type_sizes/coroutine.stdout | 2 +- tests/ui/proc-macro/auxiliary/issue-83510.rs | 1 + tests/ui/proc-macro/issue-83510.rs | 1 + tests/ui/proc-macro/issue-83510.stderr | 8 +- .../ui/regions/regions-addr-of-upvar-self.rs | 1 + .../regions/regions-addr-of-upvar-self.stderr | 6 +- .../regions-close-object-into-object-1.rs | 1 + .../regions-close-object-into-object-1.stderr | 2 +- .../regions-close-object-into-object-3.rs | 1 + .../regions-close-object-into-object-3.stderr | 2 +- .../regions-close-object-into-object-5.rs | 1 + .../regions-close-object-into-object-5.stderr | 10 +- tests/ui/span/dropck_misc_variants.rs | 1 + tests/ui/span/dropck_misc_variants.stderr | 4 +- tests/ui/span/issue-25199.rs | 1 + tests/ui/span/issue-25199.stderr | 2 +- .../dont-suggest-ref/move-into-closure.rs | 1 + .../dont-suggest-ref/move-into-closure.stderr | 164 ++++++++--------- ...ssue-105761-suggest-self-for-closure.fixed | 1 + .../issue-105761-suggest-self-for-closure.rs | 1 + ...sue-105761-suggest-self-for-closure.stderr | 4 +- ...-suggestion-in-proper-span-issue-121267.rs | 1 + ...gestion-in-proper-span-issue-121267.stderr | 4 +- .../test-should-panic-failed-show-span.rs | 1 + ...t-should-panic-failed-show-span.run.stderr | 8 +- ...t-should-panic-failed-show-span.run.stdout | 4 +- .../suggest-trait-alias-instead-of-type.fixed | 1 + .../suggest-trait-alias-instead-of-type.rs | 1 + ...suggest-trait-alias-instead-of-type.stderr | 2 +- tests/ui/traits/bound/not-on-struct.rs | 1 + tests/ui/traits/bound/not-on-struct.stderr | 38 ++-- ...ures-infer-fn-once-move-from-projection.rs | 1 + ...-infer-fn-once-move-from-projection.stderr | 4 +- 253 files changed, 955 insertions(+), 806 deletions(-) create mode 100644 tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.pre2021.stderr diff --git a/tests/ui/argument-suggestions/extra_arguments.rs b/tests/ui/argument-suggestions/extra_arguments.rs index 4f2f3517ddd79..d8d3339d2ddf6 100644 --- a/tests/ui/argument-suggestions/extra_arguments.rs +++ b/tests/ui/argument-suggestions/extra_arguments.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn empty() {} fn one_arg(_a: T) {} fn two_arg_same(_a: i32, _b: i32) {} diff --git a/tests/ui/argument-suggestions/extra_arguments.stderr b/tests/ui/argument-suggestions/extra_arguments.stderr index 5ed42a9ddd218..0c80ae8acc433 100644 --- a/tests/ui/argument-suggestions/extra_arguments.stderr +++ b/tests/ui/argument-suggestions/extra_arguments.stderr @@ -1,11 +1,11 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/extra_arguments.rs:19:3 + --> $DIR/extra_arguments.rs:20:3 | LL | empty(""); | ^^^^^ -- unexpected argument of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:1:4 + --> $DIR/extra_arguments.rs:2:4 | LL | fn empty() {} | ^^^^^ @@ -16,7 +16,7 @@ LL + empty(); | error[E0061]: this function takes 0 arguments but 2 arguments were supplied - --> $DIR/extra_arguments.rs:20:3 + --> $DIR/extra_arguments.rs:21:3 | LL | empty(1, 1); | ^^^^^ - - unexpected argument #2 of type `{integer}` @@ -24,7 +24,7 @@ LL | empty(1, 1); | unexpected argument #1 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:1:4 + --> $DIR/extra_arguments.rs:2:4 | LL | fn empty() {} | ^^^^^ @@ -35,13 +35,13 @@ LL + empty(); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:22:3 + --> $DIR/extra_arguments.rs:23:3 | LL | one_arg(1, 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:3:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -52,13 +52,13 @@ LL + one_arg(1); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:23:3 + --> $DIR/extra_arguments.rs:24:3 | LL | one_arg(1, ""); | ^^^^^^^ -- unexpected argument #2 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:3:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -69,7 +69,7 @@ LL + one_arg(1); | error[E0061]: this function takes 1 argument but 3 arguments were supplied - --> $DIR/extra_arguments.rs:24:3 + --> $DIR/extra_arguments.rs:25:3 | LL | one_arg(1, "", 1.0); | ^^^^^^^ -- --- unexpected argument #3 of type `{float}` @@ -77,7 +77,7 @@ LL | one_arg(1, "", 1.0); | unexpected argument #2 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:3:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -88,13 +88,13 @@ LL + one_arg(1); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:26:3 + --> $DIR/extra_arguments.rs:27:3 | LL | two_arg_same(1, 1, 1); | ^^^^^^^^^^^^ - unexpected argument #3 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:4:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -105,13 +105,13 @@ LL + two_arg_same(1, 1); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:27:3 + --> $DIR/extra_arguments.rs:28:3 | LL | two_arg_same(1, 1, 1.0); | ^^^^^^^^^^^^ --- unexpected argument #3 of type `{float}` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:4:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -122,13 +122,13 @@ LL + two_arg_same(1, 1); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:29:3 + --> $DIR/extra_arguments.rs:30:3 | LL | two_arg_diff(1, 1, ""); | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:5:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -139,13 +139,13 @@ LL + two_arg_diff(1, ""); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:30:3 + --> $DIR/extra_arguments.rs:31:3 | LL | two_arg_diff(1, "", ""); | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:5:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -156,7 +156,7 @@ LL + two_arg_diff(1, ""); | error[E0061]: this function takes 2 arguments but 4 arguments were supplied - --> $DIR/extra_arguments.rs:31:3 + --> $DIR/extra_arguments.rs:32:3 | LL | two_arg_diff(1, 1, "", ""); | ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str` @@ -164,7 +164,7 @@ LL | two_arg_diff(1, 1, "", ""); | unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:5:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -175,7 +175,7 @@ LL + two_arg_diff(1, ""); | error[E0061]: this function takes 2 arguments but 4 arguments were supplied - --> $DIR/extra_arguments.rs:32:3 + --> $DIR/extra_arguments.rs:33:3 | LL | two_arg_diff(1, "", 1, ""); | ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str` @@ -183,7 +183,7 @@ LL | two_arg_diff(1, "", 1, ""); | unexpected argument #3 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:5:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -194,13 +194,13 @@ LL + two_arg_diff(1, ""); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:35:3 + --> $DIR/extra_arguments.rs:36:3 | LL | two_arg_same(1, 1, ""); | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:4:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -211,13 +211,13 @@ LL + two_arg_same(1, 1); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:36:3 + --> $DIR/extra_arguments.rs:37:3 | LL | two_arg_diff(1, 1, ""); | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:5:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -228,7 +228,7 @@ LL + two_arg_diff(1, ""); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:37:3 + --> $DIR/extra_arguments.rs:38:3 | LL | two_arg_same( | ^^^^^^^^^^^^ @@ -237,7 +237,7 @@ LL | "" | -- unexpected argument #3 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:4:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -249,7 +249,7 @@ LL + 1 | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:43:3 + --> $DIR/extra_arguments.rs:44:3 | LL | two_arg_diff( | ^^^^^^^^^^^^ @@ -258,7 +258,7 @@ LL | 1, | - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:5:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -268,7 +268,7 @@ LL - 1, | error[E0061]: this function takes 0 arguments but 2 arguments were supplied - --> $DIR/extra_arguments.rs:8:9 + --> $DIR/extra_arguments.rs:9:9 | LL | empty($x, 1); | ^^^^^ - unexpected argument #2 of type `{integer}` @@ -280,14 +280,14 @@ LL | foo!(1, ~); | in this macro invocation | note: function defined here - --> $DIR/extra_arguments.rs:1:4 + --> $DIR/extra_arguments.rs:2:4 | LL | fn empty() {} | ^^^^^ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0061]: this function takes 0 arguments but 2 arguments were supplied - --> $DIR/extra_arguments.rs:14:9 + --> $DIR/extra_arguments.rs:15:9 | LL | empty(1, $y); | ^^^^^ - unexpected argument #1 of type `{integer}` @@ -299,14 +299,14 @@ LL | foo!(~, 1); | in this macro invocation | note: function defined here - --> $DIR/extra_arguments.rs:1:4 + --> $DIR/extra_arguments.rs:2:4 | LL | fn empty() {} | ^^^^^ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0061]: this function takes 0 arguments but 2 arguments were supplied - --> $DIR/extra_arguments.rs:11:9 + --> $DIR/extra_arguments.rs:12:9 | LL | empty($x, $y); | ^^^^^ @@ -319,20 +319,20 @@ LL | foo!(1, 1); | in this macro invocation | note: function defined here - --> $DIR/extra_arguments.rs:1:4 + --> $DIR/extra_arguments.rs:2:4 | LL | fn empty() {} | ^^^^^ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:53:3 + --> $DIR/extra_arguments.rs:54:3 | LL | one_arg(1, panic!()); | ^^^^^^^ -------- unexpected argument #2 | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:3:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -343,13 +343,13 @@ LL + one_arg(1); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:54:3 + --> $DIR/extra_arguments.rs:55:3 | LL | one_arg(panic!(), 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:3:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -360,13 +360,13 @@ LL + one_arg(panic!()); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:55:3 + --> $DIR/extra_arguments.rs:56:3 | LL | one_arg(stringify!($e), 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:3:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -377,13 +377,13 @@ LL + one_arg(stringify!($e)); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:60:3 + --> $DIR/extra_arguments.rs:61:3 | LL | one_arg(for _ in 1.. {}, 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:3:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ diff --git a/tests/ui/associated-consts/associated-const-range-match-patterns.rs b/tests/ui/associated-consts/associated-const-range-match-patterns.rs index 84cc4dbca9cf8..6418ace82f2d4 100644 --- a/tests/ui/associated-consts/associated-const-range-match-patterns.rs +++ b/tests/ui/associated-consts/associated-const-range-match-patterns.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass #![allow(dead_code, unreachable_patterns)] #![allow(ellipsis_inclusive_range_patterns)] diff --git a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs index ee75cb96afd3d..32192e1490010 100644 --- a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs +++ b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(bare_trait_objects)] trait Item { type Core; diff --git a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr index c80b32dc3d8fa..ad97df377b75a 100644 --- a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr +++ b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr @@ -1,5 +1,5 @@ error[E0191]: the value of the associated types `Item` and `IntoIter` in `IntoIterator` must be specified - --> $DIR/overlaping-bound-suggestion.rs:6:13 + --> $DIR/overlaping-bound-suggestion.rs:7:13 | LL | inner: >::IntoIterator as Item>::Core, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated types: `IntoIterator, Item = Type, IntoIter = Type>` diff --git a/tests/ui/associated-types/issue-43924.rs b/tests/ui/associated-types/issue-43924.rs index 6a63b3e093674..63ebbddea76ff 100644 --- a/tests/ui/associated-types/issue-43924.rs +++ b/tests/ui/associated-types/issue-43924.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(associated_type_defaults)] // This used to cause an ICE because assoc. type defaults weren't properly diff --git a/tests/ui/associated-types/issue-43924.stderr b/tests/ui/associated-types/issue-43924.stderr index 526f425b21e71..196ad85f084e2 100644 --- a/tests/ui/associated-types/issue-43924.stderr +++ b/tests/ui/associated-types/issue-43924.stderr @@ -1,17 +1,17 @@ error[E0277]: the trait bound `(dyn ToString + 'static): Default` is not satisfied - --> $DIR/issue-43924.rs:7:45 + --> $DIR/issue-43924.rs:8:45 | LL | type Out: Default + ToString + ?Sized = dyn ToString; | ^^^^^^^^^^^^ the trait `Default` is not implemented for `(dyn ToString + 'static)` | note: required by a bound in `Foo::Out` - --> $DIR/issue-43924.rs:7:15 + --> $DIR/issue-43924.rs:8:15 | LL | type Out: Default + ToString + ?Sized = dyn ToString; | ^^^^^^^ required by this bound in `Foo::Out` error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope - --> $DIR/issue-43924.rs:14:39 + --> $DIR/issue-43924.rs:15:39 | LL | assert_eq!(<() as Foo>::Out::default().to_string(), "false"); | ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)` diff --git a/tests/ui/block-result/issue-5500.rs b/tests/ui/block-result/issue-5500.rs index cbad6a27c1dc3..cc5de837f67a0 100644 --- a/tests/ui/block-result/issue-5500.rs +++ b/tests/ui/block-result/issue-5500.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() { //~ NOTE expected `()` because of default return type &panic!() //~^ ERROR mismatched types diff --git a/tests/ui/block-result/issue-5500.stderr b/tests/ui/block-result/issue-5500.stderr index 71ca8ffe2a8e3..1f4a700edcccc 100644 --- a/tests/ui/block-result/issue-5500.stderr +++ b/tests/ui/block-result/issue-5500.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-5500.rs:2:5 + --> $DIR/issue-5500.rs:3:5 | LL | fn main() { | - expected `()` because of default return type diff --git a/tests/ui/borrowck/borrowck-closures-mut-and-imm.rs b/tests/ui/borrowck/borrowck-closures-mut-and-imm.rs index a8225f2faf166..17702ed07723d 100644 --- a/tests/ui/borrowck/borrowck-closures-mut-and-imm.rs +++ b/tests/ui/borrowck/borrowck-closures-mut-and-imm.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Tests that two closures cannot simultaneously have mutable // and immutable access to the variable. Issue #6801. diff --git a/tests/ui/borrowck/borrowck-closures-mut-and-imm.stderr b/tests/ui/borrowck/borrowck-closures-mut-and-imm.stderr index 8a7870e0c44af..165a9b01575c7 100644 --- a/tests/ui/borrowck/borrowck-closures-mut-and-imm.stderr +++ b/tests/ui/borrowck/borrowck-closures-mut-and-imm.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-closures-mut-and-imm.rs:17:14 + --> $DIR/borrowck-closures-mut-and-imm.rs:18:14 | LL | let c1 = || x = 4; | -- - first borrow occurs due to use of `x` in closure @@ -14,7 +14,7 @@ LL | drop(c1); | -- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-closures-mut-and-imm.rs:25:14 + --> $DIR/borrowck-closures-mut-and-imm.rs:26:14 | LL | let c1 = || set(&mut x); | -- - first borrow occurs due to use of `x` in closure @@ -29,7 +29,7 @@ LL | drop(c1); | -- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-closures-mut-and-imm.rs:33:14 + --> $DIR/borrowck-closures-mut-and-imm.rs:34:14 | LL | let c1 = || set(&mut x); | -- - first borrow occurs due to use of `x` in closure @@ -44,7 +44,7 @@ LL | drop(c1); | -- mutable borrow later used here error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/borrowck-closures-mut-and-imm.rs:41:5 + --> $DIR/borrowck-closures-mut-and-imm.rs:42:5 | LL | let c2 = || x * 5; | -- - borrow occurs due to use in closure @@ -57,7 +57,7 @@ LL | drop(c2); | -- borrow later used here error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/borrowck-closures-mut-and-imm.rs:49:5 + --> $DIR/borrowck-closures-mut-and-imm.rs:50:5 | LL | let c1 = || get(&x); | -- - borrow occurs due to use in closure @@ -70,7 +70,7 @@ LL | drop(c1); | -- borrow later used here error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/borrowck-closures-mut-and-imm.rs:57:5 + --> $DIR/borrowck-closures-mut-and-imm.rs:58:5 | LL | let c1 = || get(&*x); | -- -- borrow occurs due to use in closure @@ -83,7 +83,7 @@ LL | drop(c1); | -- borrow later used here error[E0506]: cannot assign to `*x.f` because it is borrowed - --> $DIR/borrowck-closures-mut-and-imm.rs:69:5 + --> $DIR/borrowck-closures-mut-and-imm.rs:70:5 | LL | let c1 = || get(&*x.f); | -- ---- borrow occurs due to use in closure @@ -96,7 +96,7 @@ LL | drop(c1); | -- borrow later used here error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-closures-mut-and-imm.rs:81:14 + --> $DIR/borrowck-closures-mut-and-imm.rs:82:14 | LL | let c1 = || get(&*x.f); | -- ---- first borrow occurs due to use of `x` in closure diff --git a/tests/ui/borrowck/borrowck-closures-mut-of-imm.rs b/tests/ui/borrowck/borrowck-closures-mut-of-imm.rs index d7e187a2b3958..4229982b7f432 100644 --- a/tests/ui/borrowck/borrowck-closures-mut-of-imm.rs +++ b/tests/ui/borrowck/borrowck-closures-mut-of-imm.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Tests that two closures cannot simultaneously have mutable // and immutable access to the variable. Issue #6801. diff --git a/tests/ui/borrowck/borrowck-closures-mut-of-imm.stderr b/tests/ui/borrowck/borrowck-closures-mut-of-imm.stderr index 537ec9895e106..46b41a0c8194b 100644 --- a/tests/ui/borrowck/borrowck-closures-mut-of-imm.stderr +++ b/tests/ui/borrowck/borrowck-closures-mut-of-imm.stderr @@ -1,17 +1,17 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference - --> $DIR/borrowck-closures-mut-of-imm.rs:9:25 + --> $DIR/borrowck-closures-mut-of-imm.rs:10:25 | LL | let mut c1 = || set(&mut *x); | ^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference - --> $DIR/borrowck-closures-mut-of-imm.rs:11:25 + --> $DIR/borrowck-closures-mut-of-imm.rs:12:25 | LL | let mut c2 = || set(&mut *x); | ^^^^^^^ cannot borrow as mutable error[E0524]: two closures require unique access to `x` at the same time - --> $DIR/borrowck-closures-mut-of-imm.rs:11:18 + --> $DIR/borrowck-closures-mut-of-imm.rs:12:18 | LL | let mut c1 = || set(&mut *x); | -- -- first borrow occurs due to use of `x` in closure diff --git a/tests/ui/borrowck/borrowck-closures-mut-of-mut.rs b/tests/ui/borrowck/borrowck-closures-mut-of-mut.rs index 50c6f2c585ed9..cf900c1627535 100644 --- a/tests/ui/borrowck/borrowck-closures-mut-of-mut.rs +++ b/tests/ui/borrowck/borrowck-closures-mut-of-mut.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Tests that two closures cannot simultaneously both have mutable // access to the variable. Related to issue #6801. diff --git a/tests/ui/borrowck/borrowck-closures-mut-of-mut.stderr b/tests/ui/borrowck/borrowck-closures-mut-of-mut.stderr index 105a0b05189ed..6f229b9a3a714 100644 --- a/tests/ui/borrowck/borrowck-closures-mut-of-mut.stderr +++ b/tests/ui/borrowck/borrowck-closures-mut-of-mut.stderr @@ -1,5 +1,5 @@ error[E0524]: two closures require unique access to `x` at the same time - --> $DIR/borrowck-closures-mut-of-mut.rs:14:18 + --> $DIR/borrowck-closures-mut-of-mut.rs:15:18 | LL | let mut c1 = || set(&mut *x); | -- -- first borrow occurs due to use of `x` in closure diff --git a/tests/ui/borrowck/borrowck-closures-slice-patterns.rs b/tests/ui/borrowck/borrowck-closures-slice-patterns.rs index 32057d5c126ed..b36df1a4fda7d 100644 --- a/tests/ui/borrowck/borrowck-closures-slice-patterns.rs +++ b/tests/ui/borrowck/borrowck-closures-slice-patterns.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Check that closure captures for slice patterns are inferred correctly fn arr_by_ref(mut x: [String; 3]) { diff --git a/tests/ui/borrowck/borrowck-closures-slice-patterns.stderr b/tests/ui/borrowck/borrowck-closures-slice-patterns.stderr index 9066891d2985f..3764e4391d367 100644 --- a/tests/ui/borrowck/borrowck-closures-slice-patterns.stderr +++ b/tests/ui/borrowck/borrowck-closures-slice-patterns.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-closures-slice-patterns.rs:7:13 + --> $DIR/borrowck-closures-slice-patterns.rs:8:13 | LL | let f = || { | -- immutable borrow occurs here @@ -13,7 +13,7 @@ LL | f(); | - immutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-closures-slice-patterns.rs:16:13 + --> $DIR/borrowck-closures-slice-patterns.rs:17:13 | LL | let mut f = || { | -- mutable borrow occurs here @@ -27,7 +27,7 @@ LL | f(); | - mutable borrow later used here error[E0382]: borrow of moved value: `x` - --> $DIR/borrowck-closures-slice-patterns.rs:25:5 + --> $DIR/borrowck-closures-slice-patterns.rs:26:5 | LL | fn arr_by_move(x: [String; 3]) { | - move occurs because `x` has type `[String; 3]`, which does not implement the `Copy` trait @@ -45,7 +45,7 @@ LL | let [y, z @ ..] = x.clone(); | ++++++++ error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-closures-slice-patterns.rs:33:13 + --> $DIR/borrowck-closures-slice-patterns.rs:34:13 | LL | let f = || { | -- immutable borrow occurs here @@ -59,7 +59,7 @@ LL | f(); | - immutable borrow later used here error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access - --> $DIR/borrowck-closures-slice-patterns.rs:42:13 + --> $DIR/borrowck-closures-slice-patterns.rs:43:13 | LL | let mut f = || { | -- closure construction occurs here @@ -73,7 +73,7 @@ LL | f(); | - first borrow later used here error[E0382]: borrow of moved value: `x` - --> $DIR/borrowck-closures-slice-patterns.rs:51:5 + --> $DIR/borrowck-closures-slice-patterns.rs:52:5 | LL | fn arr_box_by_move(x: Box<[String; 3]>) { | - move occurs because `x` has type `Box<[String; 3]>`, which does not implement the `Copy` trait @@ -92,7 +92,7 @@ LL + let [y, z @ ..] = x.clone(); | error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-closures-slice-patterns.rs:59:13 + --> $DIR/borrowck-closures-slice-patterns.rs:60:13 | LL | let f = || { | -- immutable borrow occurs here @@ -106,7 +106,7 @@ LL | f(); | - immutable borrow later used here error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access - --> $DIR/borrowck-closures-slice-patterns.rs:68:13 + --> $DIR/borrowck-closures-slice-patterns.rs:69:13 | LL | let mut f = || { | -- closure construction occurs here diff --git a/tests/ui/borrowck/borrowck-closures-two-mut-fail.rs b/tests/ui/borrowck/borrowck-closures-two-mut-fail.rs index 63a75cdff42de..644ef1429a47e 100644 --- a/tests/ui/borrowck/borrowck-closures-two-mut-fail.rs +++ b/tests/ui/borrowck/borrowck-closures-two-mut-fail.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Tests that two closures cannot simultaneously have mutable // access to the variable, whether that mutable access be used // for direct assignment or for taking mutable ref. Issue #6801. diff --git a/tests/ui/borrowck/borrowck-closures-two-mut-fail.stderr b/tests/ui/borrowck/borrowck-closures-two-mut-fail.stderr index fe8e7a29e2486..527e246b1f2db 100644 --- a/tests/ui/borrowck/borrowck-closures-two-mut-fail.stderr +++ b/tests/ui/borrowck/borrowck-closures-two-mut-fail.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut-fail.rs:16:24 + --> $DIR/borrowck-closures-two-mut-fail.rs:17:24 | LL | let c1 = to_fn_mut(|| x = 4); | -- - first borrow occurs due to use of `x` in closure @@ -13,7 +13,7 @@ LL | c1; | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut-fail.rs:27:24 + --> $DIR/borrowck-closures-two-mut-fail.rs:28:24 | LL | let c1 = to_fn_mut(|| set(&mut x)); | -- - first borrow occurs due to use of `x` in closure @@ -27,7 +27,7 @@ LL | c1; | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut-fail.rs:34:24 + --> $DIR/borrowck-closures-two-mut-fail.rs:35:24 | LL | let c1 = to_fn_mut(|| x = 5); | -- - first borrow occurs due to use of `x` in closure @@ -41,7 +41,7 @@ LL | c1; | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut-fail.rs:41:24 + --> $DIR/borrowck-closures-two-mut-fail.rs:42:24 | LL | let c1 = to_fn_mut(|| x = 5); | -- - first borrow occurs due to use of `x` in closure @@ -56,7 +56,7 @@ LL | c1; | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut-fail.rs:53:24 + --> $DIR/borrowck-closures-two-mut-fail.rs:54:24 | LL | let c1 = to_fn_mut(|| set(&mut *x.f)); | -- ---- first borrow occurs due to use of `x` in closure diff --git a/tests/ui/borrowck/borrowck-closures-two-mut.rs b/tests/ui/borrowck/borrowck-closures-two-mut.rs index cdff8f9e890c6..13fbe73113282 100644 --- a/tests/ui/borrowck/borrowck-closures-two-mut.rs +++ b/tests/ui/borrowck/borrowck-closures-two-mut.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Tests that two closures cannot simultaneously have mutable // access to the variable, whether that mutable access be used // for direct assignment or for taking mutable ref. Issue #6801. diff --git a/tests/ui/borrowck/borrowck-closures-two-mut.stderr b/tests/ui/borrowck/borrowck-closures-two-mut.stderr index 21e329f432939..11f75b4bd628d 100644 --- a/tests/ui/borrowck/borrowck-closures-two-mut.stderr +++ b/tests/ui/borrowck/borrowck-closures-two-mut.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut.rs:12:24 + --> $DIR/borrowck-closures-two-mut.rs:13:24 | LL | let c1 = to_fn_mut(|| x = 4); | -- - first borrow occurs due to use of `x` in closure @@ -13,7 +13,7 @@ LL | drop((c1, c2)); | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut.rs:23:24 + --> $DIR/borrowck-closures-two-mut.rs:24:24 | LL | let c1 = to_fn_mut(|| set(&mut x)); | -- - first borrow occurs due to use of `x` in closure @@ -27,7 +27,7 @@ LL | drop((c1, c2)); | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut.rs:30:24 + --> $DIR/borrowck-closures-two-mut.rs:31:24 | LL | let c1 = to_fn_mut(|| x = 5); | -- - first borrow occurs due to use of `x` in closure @@ -41,7 +41,7 @@ LL | drop((c1, c2)); | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut.rs:37:24 + --> $DIR/borrowck-closures-two-mut.rs:38:24 | LL | let c1 = to_fn_mut(|| x = 5); | -- - first borrow occurs due to use of `x` in closure @@ -56,7 +56,7 @@ LL | drop((c1, c2)); | -- first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-closures-two-mut.rs:49:24 + --> $DIR/borrowck-closures-two-mut.rs:50:24 | LL | let c1 = to_fn_mut(|| set(&mut *x.f)); | -- ---- first borrow occurs due to use of `x` in closure diff --git a/tests/ui/borrowck/borrowck-closures-unique-imm.rs b/tests/ui/borrowck/borrowck-closures-unique-imm.rs index 0dd004769105a..e53f15b8e9d8d 100644 --- a/tests/ui/borrowck/borrowck-closures-unique-imm.rs +++ b/tests/ui/borrowck/borrowck-closures-unique-imm.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 struct Foo { x: isize, } diff --git a/tests/ui/borrowck/borrowck-closures-unique-imm.stderr b/tests/ui/borrowck/borrowck-closures-unique-imm.stderr index 669dd614f52d1..ca2112cdc62c0 100644 --- a/tests/ui/borrowck/borrowck-closures-unique-imm.stderr +++ b/tests/ui/borrowck/borrowck-closures-unique-imm.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `this.x` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-closures-unique-imm.rs:11:9 + --> $DIR/borrowck-closures-unique-imm.rs:12:9 | LL | let p = &this.x; | ------- immutable borrow occurs here diff --git a/tests/ui/borrowck/borrowck-closures-unique.rs b/tests/ui/borrowck/borrowck-closures-unique.rs index 67f91dfa8420e..039a5db050227 100644 --- a/tests/ui/borrowck/borrowck-closures-unique.rs +++ b/tests/ui/borrowck/borrowck-closures-unique.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Tests that a closure which requires mutable access to the referent // of an `&mut` requires a "unique" borrow -- that is, the variable to // be borrowed (here, `x`) will not be borrowed *mutably*, but diff --git a/tests/ui/borrowck/borrowck-closures-unique.stderr b/tests/ui/borrowck/borrowck-closures-unique.stderr index 613df9f2100c9..792d92f4340d6 100644 --- a/tests/ui/borrowck/borrowck-closures-unique.stderr +++ b/tests/ui/borrowck/borrowck-closures-unique.stderr @@ -1,5 +1,5 @@ error[E0500]: closure requires unique access to `x` but it is already borrowed - --> $DIR/borrowck-closures-unique.rs:26:14 + --> $DIR/borrowck-closures-unique.rs:27:14 | LL | let c1 = || get(x); | -- - first borrow occurs due to use of `x` in closure @@ -13,7 +13,7 @@ LL | c1; | -- first borrow later used here error[E0500]: closure requires unique access to `x` but it is already borrowed - --> $DIR/borrowck-closures-unique.rs:32:14 + --> $DIR/borrowck-closures-unique.rs:33:14 | LL | let c1 = || get(x); | -- - first borrow occurs due to use of `x` in closure @@ -27,7 +27,7 @@ LL | c1; | -- first borrow later used here error[E0524]: two closures require unique access to `x` at the same time - --> $DIR/borrowck-closures-unique.rs:38:14 + --> $DIR/borrowck-closures-unique.rs:39:14 | LL | let c1 = || set(x); | -- - first borrow occurs due to use of `x` in closure @@ -41,7 +41,7 @@ LL | c1; | -- first borrow later used here error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/borrowck-closures-unique.rs:43:38 + --> $DIR/borrowck-closures-unique.rs:44:38 | LL | let c1 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign diff --git a/tests/ui/borrowck/borrowck-insert-during-each.rs b/tests/ui/borrowck/borrowck-insert-during-each.rs index df967e6118932..ee07879c91643 100644 --- a/tests/ui/borrowck/borrowck-insert-during-each.rs +++ b/tests/ui/borrowck/borrowck-insert-during-each.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 use std::collections::HashSet; struct Foo { diff --git a/tests/ui/borrowck/borrowck-insert-during-each.stderr b/tests/ui/borrowck/borrowck-insert-during-each.stderr index a1ac45795fae2..89b9dd4123e6f 100644 --- a/tests/ui/borrowck/borrowck-insert-during-each.stderr +++ b/tests/ui/borrowck/borrowck-insert-during-each.stderr @@ -1,5 +1,5 @@ error[E0501]: cannot borrow `*f` as mutable because previous closure requires unique access - --> $DIR/borrowck-insert-during-each.rs:16:5 + --> $DIR/borrowck-insert-during-each.rs:17:5 | LL | f.foo( | ^ --- first borrow later used by call @@ -14,7 +14,7 @@ LL | | }) | |__________^ second borrow occurs here error[E0500]: closure requires unique access to `f` but it is already borrowed - --> $DIR/borrowck-insert-during-each.rs:18:9 + --> $DIR/borrowck-insert-during-each.rs:19:9 | LL | f.foo( | - --- first borrow later used by call diff --git a/tests/ui/borrowck/borrowck-loan-rcvr.rs b/tests/ui/borrowck/borrowck-loan-rcvr.rs index d2234e17ac75c..a8d02fa09c25c 100644 --- a/tests/ui/borrowck/borrowck-loan-rcvr.rs +++ b/tests/ui/borrowck/borrowck-loan-rcvr.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 struct Point { x: isize, y: isize } trait Methods { diff --git a/tests/ui/borrowck/borrowck-loan-rcvr.stderr b/tests/ui/borrowck/borrowck-loan-rcvr.stderr index 317423ecf61f7..3d0e52d2b1d1c 100644 --- a/tests/ui/borrowck/borrowck-loan-rcvr.stderr +++ b/tests/ui/borrowck/borrowck-loan-rcvr.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-loan-rcvr.rs:23:14 + --> $DIR/borrowck-loan-rcvr.rs:24:14 | LL | p.blockm(|| { | - ------ ^^ mutable borrow occurs here @@ -10,7 +10,7 @@ LL | p.x = 10; | --- second borrow occurs due to use of `p` in closure error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-loan-rcvr.rs:34:5 + --> $DIR/borrowck-loan-rcvr.rs:35:5 | LL | let l = &mut p; | ------ mutable borrow occurs here diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs index e22bf42e02142..81363f0c3f728 100644 --- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs +++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // rust-lang/rust#55492: errors detected during MIR-borrowck's // analysis of a closure body may only be caught when AST-borrowck // looks at some parent. diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr index 6fc8d3a6c35c7..af44eca7e7f13 100644 --- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr +++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:10:46 | LL | let mut c1 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign @@ -10,7 +10,7 @@ LL | pub fn e(mut x: &'static mut isize) { | +++ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:21:50 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:22:50 | LL | let mut c2 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign @@ -21,7 +21,7 @@ LL | pub fn ee(mut x: &'static mut isize) { | +++ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:35:13 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:36:13 | LL | x = (1,); | ^^^^^^^^ cannot assign @@ -32,7 +32,7 @@ LL | pub fn capture_assign_whole(mut x: (i32,)) { | +++ error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:41:13 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:42:13 | LL | x.0 = 1; | ^^^^^^^ cannot assign @@ -43,7 +43,7 @@ LL | pub fn capture_assign_part(mut x: (i32,)) { | +++ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:47:13 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:48:13 | LL | &mut x; | ^^^^^^ cannot borrow as mutable @@ -54,7 +54,7 @@ LL | pub fn capture_reborrow_whole(mut x: (i32,)) { | +++ error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:53:13 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:54:13 | LL | &mut x.0; | ^^^^^^^^ cannot borrow as mutable diff --git a/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.rs b/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.rs index c9e043577ed6d..13c7c3ef61829 100644 --- a/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.rs +++ b/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 type Lazy = Box T + 'static>; fn test(x: &i32) -> Lazy { diff --git a/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr b/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr index 98fb49824ae93..36a69f7d822b3 100644 --- a/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr +++ b/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/suggest-lt-on-ty-alias-w-generics.rs:4:5 + --> $DIR/suggest-lt-on-ty-alias-w-generics.rs:5:5 | LL | fn test(x: &i32) -> Lazy { | - let's call the lifetime of this reference `'1` @@ -17,7 +17,7 @@ LL + type Lazy<'a, T> = Box T + 'a>; | error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function - --> $DIR/suggest-lt-on-ty-alias-w-generics.rs:4:14 + --> $DIR/suggest-lt-on-ty-alias-w-generics.rs:5:14 | LL | Box::new(|| { | ^^ may outlive borrowed value `x` @@ -26,7 +26,7 @@ LL | *x | -- `x` is borrowed here | note: closure is returned here - --> $DIR/suggest-lt-on-ty-alias-w-generics.rs:4:5 + --> $DIR/suggest-lt-on-ty-alias-w-generics.rs:5:5 | LL | / Box::new(|| { LL | | diff --git a/tests/ui/closures/2229_closure_analysis/issue-90465.fixed b/tests/ui/closures/2229_closure_analysis/issue-90465.fixed index 3bbac007b4f84..d4720fc99bdbf 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-90465.fixed +++ b/tests/ui/closures/2229_closure_analysis/issue-90465.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] diff --git a/tests/ui/closures/2229_closure_analysis/issue-90465.rs b/tests/ui/closures/2229_closure_analysis/issue-90465.rs index cb11832d06c80..12b015eaaacd3 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-90465.rs +++ b/tests/ui/closures/2229_closure_analysis/issue-90465.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] diff --git a/tests/ui/closures/2229_closure_analysis/issue-90465.stderr b/tests/ui/closures/2229_closure_analysis/issue-90465.stderr index 94bbd79cbb4f3..a10a8de4872c5 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-90465.stderr +++ b/tests/ui/closures/2229_closure_analysis/issue-90465.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/issue-90465.rs:17:14 + --> $DIR/issue-90465.rs:18:14 | LL | let c0 = move || { | ^^^^^^^ @@ -12,7 +12,7 @@ LL | } | = note: for more information, see note: the lint level is defined here - --> $DIR/issue-90465.rs:3:9 + --> $DIR/issue-90465.rs:4:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed index c1d88cbdf8374..36938c038322b 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs index 6b452fcdaf111..2d9974b301e8f 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr index b981ef69b4fa8..acbac1901c2a6 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect which traits the closure implements - --> $DIR/auto_traits.rs:22:19 + --> $DIR/auto_traits.rs:23:19 | LL | thread::spawn(move || unsafe { | ^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0` does not implement `Send` @@ -9,7 +9,7 @@ LL | *fptr.0 = 20; | = note: for more information, see note: the lint level is defined here - --> $DIR/auto_traits.rs:2:9 + --> $DIR/auto_traits.rs:3:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL ~ } }).join().unwrap(); | error: changes to closure capture in Rust 2021 will affect which traits the closure implements - --> $DIR/auto_traits.rs:42:19 + --> $DIR/auto_traits.rs:43:19 | LL | thread::spawn(move || unsafe { | ^^^^^^^ @@ -45,7 +45,7 @@ LL ~ } }).join().unwrap(); | error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements - --> $DIR/auto_traits.rs:67:13 + --> $DIR/auto_traits.rs:68:13 | LL | let c = || { | ^^ in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f` is not fully captured and `f.1` does not implement `Clone` diff --git a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed index 2784a60364437..44c7858f34813 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] diff --git a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs index e5de7ba3c6233..24f2a72a6d047 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] diff --git a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr index 3381b9e334b47..3518c797be02b 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/insignificant_drop_attr_migrations.rs:39:13 + --> $DIR/insignificant_drop_attr_migrations.rs:40:13 | LL | let c = || { | ^^ @@ -12,7 +12,7 @@ LL | } | = note: for more information, see note: the lint level is defined here - --> $DIR/insignificant_drop_attr_migrations.rs:3:9 + --> $DIR/insignificant_drop_attr_migrations.rs:4:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL + let _ = &t; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/insignificant_drop_attr_migrations.rs:59:13 + --> $DIR/insignificant_drop_attr_migrations.rs:60:13 | LL | let c = move || { | ^^^^^^^ diff --git a/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed b/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed index 8946642892ff1..b91dcc58d80de 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix // See https://github.com/rust-lang/rust/issues/87955 diff --git a/tests/ui/closures/2229_closure_analysis/migrations/macro.rs b/tests/ui/closures/2229_closure_analysis/migrations/macro.rs index f50b985298d7a..5f0f7daf906f9 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/macro.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/macro.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix // See https://github.com/rust-lang/rust/issues/87955 diff --git a/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr b/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr index 7d90b7bf72bd9..ed477b3399e43 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/macro.rs:19:13 + --> $DIR/macro.rs:20:13 | LL | let _ = || dbg!(a.0); | ^^ --- in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0` @@ -9,7 +9,7 @@ LL | } | = note: for more information, see note: the lint level is defined here - --> $DIR/macro.rs:5:9 + --> $DIR/macro.rs:6:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed index b87c398da396d..6b256115d67b5 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs index 5e763b0239ae0..b449947e94b25 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr index 7d937f512493a..956ccea6ed91d 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/migrations_rustfix.rs:19:13 + --> $DIR/migrations_rustfix.rs:20:13 | LL | let c = || { | ^^ @@ -12,7 +12,7 @@ LL | } | = note: for more information, see note: the lint level is defined here - --> $DIR/migrations_rustfix.rs:2:9 + --> $DIR/migrations_rustfix.rs:3:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL + let _ = &t; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/migrations_rustfix.rs:33:13 + --> $DIR/migrations_rustfix.rs:34:13 | LL | let c = || t.0; | ^^ --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed index 3ff73bf4681c0..6b73969d1e9ce 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix //@ needs-unwind diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs index 21f1a9515a6a0..9fdbf7c20a80e 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix //@ needs-unwind diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr index 6a9266ecc544a..f94451bd1fa0f 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect which traits the closure implements - --> $DIR/mir_calls_to_shims.rs:20:38 + --> $DIR/mir_calls_to_shims.rs:21:38 | LL | let result = panic::catch_unwind(move || { | ^^^^^^^ @@ -12,7 +12,7 @@ LL | f.0() | = note: for more information, see note: the lint level is defined here - --> $DIR/mir_calls_to_shims.rs:4:9 + --> $DIR/mir_calls_to_shims.rs:5:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed index 8bbd7fab569c8..8ad71f3825d5f 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs index 62fe1581bac04..3d4e74708f481 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr index 81ffe866c8376..0c9a56473c6eb 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements - --> $DIR/multi_diagnostics.rs:37:13 + --> $DIR/multi_diagnostics.rs:38:13 | LL | let c = || { | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone` @@ -15,7 +15,7 @@ LL | } | = note: for more information, see note: the lint level is defined here - --> $DIR/multi_diagnostics.rs:2:9 + --> $DIR/multi_diagnostics.rs:3:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL + let _ = (&f1, &f2); | error: changes to closure capture in Rust 2021 will affect which traits the closure implements - --> $DIR/multi_diagnostics.rs:56:13 + --> $DIR/multi_diagnostics.rs:57:13 | LL | let c = || { | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone` @@ -42,7 +42,7 @@ LL + let _ = &f1; | error: changes to closure capture in Rust 2021 will affect which traits the closure implements - --> $DIR/multi_diagnostics.rs:81:13 + --> $DIR/multi_diagnostics.rs:82:13 | LL | let c = || { | ^^ @@ -64,7 +64,7 @@ LL + let _ = &f1; | error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements - --> $DIR/multi_diagnostics.rs:100:13 + --> $DIR/multi_diagnostics.rs:101:13 | LL | let c = || { | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone` @@ -89,7 +89,7 @@ LL + let _ = &f1; | error: changes to closure capture in Rust 2021 will affect which traits the closure implements - --> $DIR/multi_diagnostics.rs:133:19 + --> $DIR/multi_diagnostics.rs:134:19 | LL | thread::spawn(move || unsafe { | ^^^^^^^ diff --git a/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed b/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed index 5743f9984be24..072ed468186da 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] diff --git a/tests/ui/closures/2229_closure_analysis/migrations/precise.rs b/tests/ui/closures/2229_closure_analysis/migrations/precise.rs index 2ddd2535c7270..68af3b66734a5 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/precise.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/precise.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] diff --git a/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr b/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr index 5fb7675207f4d..d17f0f6f968e5 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/precise.rs:20:13 + --> $DIR/precise.rs:21:13 | LL | let c = || { | ^^ @@ -12,7 +12,7 @@ LL | } | = note: for more information, see note: the lint level is defined here - --> $DIR/precise.rs:3:9 + --> $DIR/precise.rs:4:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL + let _ = &t; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/precise.rs:45:13 + --> $DIR/precise.rs:46:13 | LL | let c = || { | ^^ diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed index 8aa07cd5442a2..bde9d5ccdbb6e 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs index b53461d14df31..92bf4f5fc8a1d 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr index 3f4d38aefe7a6..7c3308ae16674 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:25:13 + --> $DIR/significant_drop.rs:26:13 | LL | let c = || { | ^^ @@ -22,7 +22,7 @@ LL | } | = note: for more information, see note: the lint level is defined here - --> $DIR/significant_drop.rs:2:9 + --> $DIR/significant_drop.rs:3:9 | LL | #![deny(rust_2021_incompatible_closure_captures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -33,7 +33,7 @@ LL + let _ = (&t, &t1, &t2); | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:50:13 + --> $DIR/significant_drop.rs:51:13 | LL | let c = || { | ^^ @@ -58,7 +58,7 @@ LL + let _ = (&t, &t1); | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:71:13 + --> $DIR/significant_drop.rs:72:13 | LL | let c = || { | ^^ @@ -77,7 +77,7 @@ LL + let _ = &t; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:91:13 + --> $DIR/significant_drop.rs:92:13 | LL | let c = || { | ^^ @@ -96,7 +96,7 @@ LL + let _ = &t; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:109:13 + --> $DIR/significant_drop.rs:110:13 | LL | let c = || { | ^^ @@ -115,7 +115,7 @@ LL + let _ = &t; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:125:13 + --> $DIR/significant_drop.rs:126:13 | LL | let c = || { | ^^ @@ -134,7 +134,7 @@ LL + let _ = &t; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:143:13 + --> $DIR/significant_drop.rs:144:13 | LL | let c = move || { | ^^^^^^^ @@ -158,7 +158,7 @@ LL + let _ = (&t1, &t); | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:163:21 + --> $DIR/significant_drop.rs:164:21 | LL | let c = || { | ^^ @@ -177,7 +177,7 @@ LL + let _ = &tuple; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:181:17 + --> $DIR/significant_drop.rs:182:17 | LL | let c = || { | ^^ @@ -196,7 +196,7 @@ LL + let _ = &tuple; | error: changes to closure capture in Rust 2021 will affect drop order - --> $DIR/significant_drop.rs:201:18 + --> $DIR/significant_drop.rs:202:18 | LL | let _c = || tup.0; | ^^ ----- in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0` diff --git a/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.rs b/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.rs index 7327d8256685d..e54194c1ad68c 100644 --- a/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.rs +++ b/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn bar(blk: F) where F: FnOnce() + 'static { } diff --git a/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr b/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr index 85df5c1e5b3db..798c3bc815696 100644 --- a/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr +++ b/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of function - --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5 + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:6:5 | LL | fn foo(x: &()) { | - - let's call the lifetime of this reference `'1` @@ -16,7 +16,7 @@ LL | | }) | argument requires that `'1` must outlive `'static` error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function - --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:9 + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:6:9 | LL | bar(|| { | ^^ may outlive borrowed value `x` @@ -25,7 +25,7 @@ LL | let _ = x; | - `x` is borrowed here | note: function requires argument type to outlive `'static` - --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5 + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:6:5 | LL | / bar(|| { LL | | diff --git a/tests/ui/closures/closure-clone-requires-captured-clone.rs b/tests/ui/closures/closure-clone-requires-captured-clone.rs index 80938e50b67a7..207b03620b667 100644 --- a/tests/ui/closures/closure-clone-requires-captured-clone.rs +++ b/tests/ui/closures/closure-clone-requires-captured-clone.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //! Test that closures only implement `Clone` if all captured values implement `Clone`. //! //! When a closure captures variables from its environment, it can only be cloned diff --git a/tests/ui/closures/closure-clone-requires-captured-clone.stderr b/tests/ui/closures/closure-clone-requires-captured-clone.stderr index 785cc8a3032e2..9bc5f8ef24126 100644 --- a/tests/ui/closures/closure-clone-requires-captured-clone.stderr +++ b/tests/ui/closures/closure-clone-requires-captured-clone.stderr @@ -1,14 +1,14 @@ -error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}` - --> $DIR/closure-clone-requires-captured-clone.rs:17:13 +error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `{closure@$DIR/closure-clone-requires-captured-clone.rs:14:19: 14:26}` + --> $DIR/closure-clone-requires-captured-clone.rs:18:13 | LL | let closure = move || { - | ------- within this `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}` + | ------- within this `{closure@$DIR/closure-clone-requires-captured-clone.rs:14:19: 14:26}` ... LL | closure.clone(); - | ^^^^^ within `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}`, the trait `Clone` is not implemented for `NonClone` + | ^^^^^ within `{closure@$DIR/closure-clone-requires-captured-clone.rs:14:19: 14:26}`, the trait `Clone` is not implemented for `NonClone` | note: required because it's used within this closure - --> $DIR/closure-clone-requires-captured-clone.rs:13:19 + --> $DIR/closure-clone-requires-captured-clone.rs:14:19 | LL | let closure = move || { | ^^^^^^^ diff --git a/tests/ui/closures/closure-referencing-itself-issue-25954.rs b/tests/ui/closures/closure-referencing-itself-issue-25954.rs index 7dd0e51797d8e..f420fc342cd2d 100644 --- a/tests/ui/closures/closure-referencing-itself-issue-25954.rs +++ b/tests/ui/closures/closure-referencing-itself-issue-25954.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Regression test for #25954: detect and reject a closure type that // references itself. diff --git a/tests/ui/closures/closure-referencing-itself-issue-25954.stderr b/tests/ui/closures/closure-referencing-itself-issue-25954.stderr index 6fe6840b35b3b..22b7be4c729ba 100644 --- a/tests/ui/closures/closure-referencing-itself-issue-25954.stderr +++ b/tests/ui/closures/closure-referencing-itself-issue-25954.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/closure-referencing-itself-issue-25954.rs:15:13 + --> $DIR/closure-referencing-itself-issue-25954.rs:16:13 | LL | let q = || p.b.set(5i32); | ^^^^^^^^^^^^^^^^ cyclic type of infinite size diff --git a/tests/ui/closures/issue-6801.rs b/tests/ui/closures/issue-6801.rs index cecb08f006fde..8b96e1d15ef1b 100644 --- a/tests/ui/closures/issue-6801.rs +++ b/tests/ui/closures/issue-6801.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Creating a stack closure which references a box and then // transferring ownership of the box before invoking the stack // closure results in a crash. diff --git a/tests/ui/closures/issue-6801.stderr b/tests/ui/closures/issue-6801.stderr index aed673fe1ab5d..4141dd91cd33b 100644 --- a/tests/ui/closures/issue-6801.stderr +++ b/tests/ui/closures/issue-6801.stderr @@ -1,5 +1,5 @@ error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/issue-6801.rs:19:13 + --> $DIR/issue-6801.rs:20:13 | LL | let sq = || { *x * *x }; | -- -- borrow occurs due to use in closure diff --git a/tests/ui/closures/issue-81700-mut-borrow.rs b/tests/ui/closures/issue-81700-mut-borrow.rs index a27a6160142ad..260714ed0b24e 100644 --- a/tests/ui/closures/issue-81700-mut-borrow.rs +++ b/tests/ui/closures/issue-81700-mut-borrow.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn foo(x: &mut u32) { let bar = || { foo(x); }; bar(); //~ ERROR cannot borrow diff --git a/tests/ui/closures/issue-81700-mut-borrow.stderr b/tests/ui/closures/issue-81700-mut-borrow.stderr index d050fb60c3db2..0f048deb8c92d 100644 --- a/tests/ui/closures/issue-81700-mut-borrow.stderr +++ b/tests/ui/closures/issue-81700-mut-borrow.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow `bar` as mutable, as it is not declared as mutable - --> $DIR/issue-81700-mut-borrow.rs:3:5 + --> $DIR/issue-81700-mut-borrow.rs:4:5 | LL | let bar = || { foo(x); }; | - calling `bar` requires mutable binding due to mutable borrow of `x` diff --git a/tests/ui/closures/print/closure-print-generic-1.rs b/tests/ui/closures/print/closure-print-generic-1.rs index 504b4adbeb9bc..277e5ef06f34b 100644 --- a/tests/ui/closures/print/closure-print-generic-1.rs +++ b/tests/ui/closures/print/closure-print-generic-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn to_fn_once(f: F) -> F { f } diff --git a/tests/ui/closures/print/closure-print-generic-1.stderr b/tests/ui/closures/print/closure-print-generic-1.stderr index 41cad279f7b9f..a7e7c751b9215 100644 --- a/tests/ui/closures/print/closure-print-generic-1.stderr +++ b/tests/ui/closures/print/closure-print-generic-1.stderr @@ -1,8 +1,8 @@ error[E0382]: use of moved value: `c` - --> $DIR/closure-print-generic-1.rs:17:5 + --> $DIR/closure-print-generic-1.rs:18:5 | LL | let c = to_fn_once(move || { - | - move occurs because `c` has type `{closure@$DIR/closure-print-generic-1.rs:12:24: 12:31}`, which does not implement the `Copy` trait + | - move occurs because `c` has type `{closure@$DIR/closure-print-generic-1.rs:13:24: 13:31}`, which does not implement the `Copy` trait ... LL | c(); | --- `c` moved due to this call @@ -10,7 +10,7 @@ LL | c(); | ^ value used here after move | note: this value implements `FnOnce`, which causes it to be moved when called - --> $DIR/closure-print-generic-1.rs:16:5 + --> $DIR/closure-print-generic-1.rs:17:5 | LL | c(); | ^ diff --git a/tests/ui/closures/print/closure-print-generic-verbose-1.rs b/tests/ui/closures/print/closure-print-generic-verbose-1.rs index e24fc6707098d..fc1c9b7efa7ca 100644 --- a/tests/ui/closures/print/closure-print-generic-verbose-1.rs +++ b/tests/ui/closures/print/closure-print-generic-verbose-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags: -Zverbose-internals fn to_fn_once(f: F) -> F { f } diff --git a/tests/ui/closures/print/closure-print-generic-verbose-1.stderr b/tests/ui/closures/print/closure-print-generic-verbose-1.stderr index 75aa3c9347993..317b0d12eb0c0 100644 --- a/tests/ui/closures/print/closure-print-generic-verbose-1.stderr +++ b/tests/ui/closures/print/closure-print-generic-verbose-1.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `c` - --> $DIR/closure-print-generic-verbose-1.rs:17:5 + --> $DIR/closure-print-generic-verbose-1.rs:18:5 | LL | let c = to_fn_once(move|| { | - move occurs because `c` has type `{f::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'?9 str>, T)}`, which does not implement the `Copy` trait @@ -10,7 +10,7 @@ LL | c(); | ^ value used here after move | note: this value implements `FnOnce`, which causes it to be moved when called - --> $DIR/closure-print-generic-verbose-1.rs:16:5 + --> $DIR/closure-print-generic-verbose-1.rs:17:5 | LL | c(); | ^ diff --git a/tests/ui/consts/const-eval/const_panic.rs b/tests/ui/consts/const-eval/const_panic.rs index 367396bab9462..e4f3a4eec1b1c 100644 --- a/tests/ui/consts/const-eval/const_panic.rs +++ b/tests/ui/consts/const-eval/const_panic.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(non_fmt_panics)] #![crate_type = "lib"] diff --git a/tests/ui/consts/const-eval/const_panic.stderr b/tests/ui/consts/const-eval/const_panic.stderr index 46b36ecfa6a30..a2036e834b0b7 100644 --- a/tests/ui/consts/const-eval/const_panic.stderr +++ b/tests/ui/consts/const-eval/const_panic.stderr @@ -1,23 +1,23 @@ error[E0080]: evaluation panicked: cheese - --> $DIR/const_panic.rs:6:15 + --> $DIR/const_panic.rs:7:15 | LL | const Z: () = std::panic!("cheese"); | ^^^^^^^^^^^^^^^^^^^^^ evaluation of `Z` failed here error[E0080]: evaluation panicked: explicit panic - --> $DIR/const_panic.rs:9:16 + --> $DIR/const_panic.rs:10:16 | LL | const Z2: () = std::panic!(); | ^^^^^^^^^^^^^ evaluation of `Z2` failed here error[E0080]: evaluation panicked: internal error: entered unreachable code - --> $DIR/const_panic.rs:12:15 + --> $DIR/const_panic.rs:13:15 | LL | const Y: () = std::unreachable!(); | ^^^^^^^^^^^^^^^^^^^ evaluation of `Y` failed here error[E0080]: evaluation panicked: not implemented - --> $DIR/const_panic.rs:15:15 + --> $DIR/const_panic.rs:16:15 | LL | const X: () = std::unimplemented!(); | ^^^^^^^^^^^^^^^^^^^^^ evaluation of `X` failed here @@ -25,37 +25,37 @@ LL | const X: () = std::unimplemented!(); = note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: hello - --> $DIR/const_panic.rs:18:15 + --> $DIR/const_panic.rs:19:15 | LL | const W: () = std::panic!(MSG); | ^^^^^^^^^^^^^^^^ evaluation of `W` failed here error[E0080]: evaluation panicked: hello - --> $DIR/const_panic.rs:21:16 + --> $DIR/const_panic.rs:22:16 | LL | const W2: () = std::panic!("{}", MSG); | ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `W2` failed here error[E0080]: evaluation panicked: cheese - --> $DIR/const_panic.rs:24:20 + --> $DIR/const_panic.rs:25:20 | LL | const Z_CORE: () = core::panic!("cheese"); | ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `Z_CORE` failed here error[E0080]: evaluation panicked: explicit panic - --> $DIR/const_panic.rs:27:21 + --> $DIR/const_panic.rs:28:21 | LL | const Z2_CORE: () = core::panic!(); | ^^^^^^^^^^^^^^ evaluation of `Z2_CORE` failed here error[E0080]: evaluation panicked: internal error: entered unreachable code - --> $DIR/const_panic.rs:30:20 + --> $DIR/const_panic.rs:31:20 | LL | const Y_CORE: () = core::unreachable!(); | ^^^^^^^^^^^^^^^^^^^^ evaluation of `Y_CORE` failed here error[E0080]: evaluation panicked: not implemented - --> $DIR/const_panic.rs:33:20 + --> $DIR/const_panic.rs:34:20 | LL | const X_CORE: () = core::unimplemented!(); | ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `X_CORE` failed here @@ -63,13 +63,13 @@ LL | const X_CORE: () = core::unimplemented!(); = note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: hello - --> $DIR/const_panic.rs:36:20 + --> $DIR/const_panic.rs:37:20 | LL | const W_CORE: () = core::panic!(MSG); | ^^^^^^^^^^^^^^^^^ evaluation of `W_CORE` failed here error[E0080]: evaluation panicked: hello - --> $DIR/const_panic.rs:39:21 + --> $DIR/const_panic.rs:40:21 | LL | const W2_CORE: () = core::panic!("{}", MSG); | ^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `W2_CORE` failed here diff --git a/tests/ui/consts/const-eval/issue-85907.rs b/tests/ui/consts/const-eval/issue-85907.rs index 6ae40ae6ddbf6..a5a961658c76c 100644 --- a/tests/ui/consts/const-eval/issue-85907.rs +++ b/tests/ui/consts/const-eval/issue-85907.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 const fn hey() -> usize { panic!(123); //~ ERROR argument to `panic!()` in a const context must have type `&str` } diff --git a/tests/ui/consts/const-eval/issue-85907.stderr b/tests/ui/consts/const-eval/issue-85907.stderr index fa1bbf2187f77..70eae7309a634 100644 --- a/tests/ui/consts/const-eval/issue-85907.stderr +++ b/tests/ui/consts/const-eval/issue-85907.stderr @@ -1,5 +1,5 @@ error: argument to `panic!()` in a const context must have type `&str` - --> $DIR/issue-85907.rs:2:5 + --> $DIR/issue-85907.rs:3:5 | LL | panic!(123); | ^^^^^^^^^^^ diff --git a/tests/ui/consts/const-eval/ub-upvars.32bit.stderr b/tests/ui/consts/const-eval/ub-upvars.32bit.stderr index b434970b67757..89512c03f5e82 100644 --- a/tests/ui/consts/const-eval/ub-upvars.32bit.stderr +++ b/tests/ui/consts/const-eval/ub-upvars.32bit.stderr @@ -1,5 +1,5 @@ error[E0080]: constructing invalid value at ...: encountered a null reference - --> $DIR/ub-upvars.rs:6:1 + --> $DIR/ub-upvars.rs:7:1 | LL | const BAD_UPVAR: &dyn FnOnce() = &{ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value diff --git a/tests/ui/consts/const-eval/ub-upvars.64bit.stderr b/tests/ui/consts/const-eval/ub-upvars.64bit.stderr index de1e1f8a2bea6..bf8de48179633 100644 --- a/tests/ui/consts/const-eval/ub-upvars.64bit.stderr +++ b/tests/ui/consts/const-eval/ub-upvars.64bit.stderr @@ -1,5 +1,5 @@ error[E0080]: constructing invalid value at ...: encountered a null reference - --> $DIR/ub-upvars.rs:6:1 + --> $DIR/ub-upvars.rs:7:1 | LL | const BAD_UPVAR: &dyn FnOnce() = &{ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value diff --git a/tests/ui/consts/const-eval/ub-upvars.rs b/tests/ui/consts/const-eval/ub-upvars.rs index 197222829842c..c5bf074ec4626 100644 --- a/tests/ui/consts/const-eval/ub-upvars.rs +++ b/tests/ui/consts/const-eval/ub-upvars.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ stderr-per-bitwidth #![allow(invalid_value)] // make sure we cannot allow away the errors tested here diff --git a/tests/ui/consts/issue-66693-panic-in-array-len.rs b/tests/ui/consts/issue-66693-panic-in-array-len.rs index 2256970e33746..c775b491a8094 100644 --- a/tests/ui/consts/issue-66693-panic-in-array-len.rs +++ b/tests/ui/consts/issue-66693-panic-in-array-len.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // This is a separate test from `issue-66693.rs` because array lengths are evaluated // in a separate stage before `const`s and `statics` and so the error below is hit and // the compiler exits before generating errors for the others. diff --git a/tests/ui/consts/issue-66693-panic-in-array-len.stderr b/tests/ui/consts/issue-66693-panic-in-array-len.stderr index 241643a83be97..5dfd977a3d39b 100644 --- a/tests/ui/consts/issue-66693-panic-in-array-len.stderr +++ b/tests/ui/consts/issue-66693-panic-in-array-len.stderr @@ -1,11 +1,11 @@ error: argument to `panic!()` in a const context must have type `&str` - --> $DIR/issue-66693-panic-in-array-len.rs:6:20 + --> $DIR/issue-66693-panic-in-array-len.rs:7:20 | LL | let _ = [0i32; panic!(2f32)]; | ^^^^^^^^^^^^ error[E0080]: evaluation panicked: explicit panic - --> $DIR/issue-66693-panic-in-array-len.rs:10:21 + --> $DIR/issue-66693-panic-in-array-len.rs:11:21 | LL | let _ = [false; panic!()]; | ^^^^^^^^ evaluation of `main::{constant#1}` failed here diff --git a/tests/ui/consts/issue-66693.rs b/tests/ui/consts/issue-66693.rs index 9d82d5a42bdbf..d2af174bee1cb 100644 --- a/tests/ui/consts/issue-66693.rs +++ b/tests/ui/consts/issue-66693.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Tests that the compiler does not ICE when const-evaluating a `panic!()` invocation with a // non-`&str` argument. diff --git a/tests/ui/consts/issue-66693.stderr b/tests/ui/consts/issue-66693.stderr index 5540d4f2d222b..6cd791b949c9d 100644 --- a/tests/ui/consts/issue-66693.stderr +++ b/tests/ui/consts/issue-66693.stderr @@ -1,29 +1,29 @@ error: argument to `panic!()` in a const context must have type `&str` - --> $DIR/issue-66693.rs:4:15 + --> $DIR/issue-66693.rs:5:15 | LL | const _: () = panic!(1); | ^^^^^^^^^ error: argument to `panic!()` in a const context must have type `&str` - --> $DIR/issue-66693.rs:7:19 + --> $DIR/issue-66693.rs:8:19 | LL | static _FOO: () = panic!(true); | ^^^^^^^^^^^^ error[E0080]: evaluation panicked: explicit panic - --> $DIR/issue-66693.rs:16:15 + --> $DIR/issue-66693.rs:17:15 | LL | const _: () = panic!(); | ^^^^^^^^ evaluation of `_` failed here error[E0080]: evaluation panicked: panic in static - --> $DIR/issue-66693.rs:18:19 + --> $DIR/issue-66693.rs:19:19 | LL | static _BAR: () = panic!("panic in static"); | ^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_BAR` failed here error: argument to `panic!()` in a const context must have type `&str` - --> $DIR/issue-66693.rs:11:5 + --> $DIR/issue-66693.rs:12:5 | LL | panic!(&1); | ^^^^^^^^^^ diff --git a/tests/ui/contracts/contract-captures-via-closure-noncopy.rs b/tests/ui/contracts/contract-captures-via-closure-noncopy.rs index 976f64c7fd911..1ec2feb045a33 100644 --- a/tests/ui/contracts/contract-captures-via-closure-noncopy.rs +++ b/tests/ui/contracts/contract-captures-via-closure-noncopy.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags: -Zcontract-checks=yes #![feature(contracts)] diff --git a/tests/ui/contracts/contract-captures-via-closure-noncopy.stderr b/tests/ui/contracts/contract-captures-via-closure-noncopy.stderr index b6f2e014e0a86..29adeaec3e167 100644 --- a/tests/ui/contracts/contract-captures-via-closure-noncopy.stderr +++ b/tests/ui/contracts/contract-captures-via-closure-noncopy.stderr @@ -1,5 +1,5 @@ warning: the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/contract-captures-via-closure-noncopy.rs:3:12 + --> $DIR/contract-captures-via-closure-noncopy.rs:4:12 | LL | #![feature(contracts)] | ^^^^^^^^^ @@ -7,20 +7,20 @@ LL | #![feature(contracts)] = note: see issue #128044 for more information = note: `#[warn(incomplete_features)]` on by default -error[E0277]: the trait bound `Baz: std::marker::Copy` is not satisfied in `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}` - --> $DIR/contract-captures-via-closure-noncopy.rs:12:1 +error[E0277]: the trait bound `Baz: std::marker::Copy` is not satisfied in `{closure@$DIR/contract-captures-via-closure-noncopy.rs:13:42: 13:57}` + --> $DIR/contract-captures-via-closure-noncopy.rs:13:1 | LL | #[core::contracts::ensures({let old = x; move |ret:&Baz| ret.baz == old.baz*2 })] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------------^^^^ | | | - | | within this `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}` - | | this tail expression is of type `{closure@contract-captures-via-closure-noncopy.rs:12:42}` + | | within this `{closure@$DIR/contract-captures-via-closure-noncopy.rs:13:42: 13:57}` + | | this tail expression is of type `{closure@contract-captures-via-closure-noncopy.rs:13:42}` | unsatisfied trait bound | required by a bound introduced by this call | - = help: within `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}`, the trait `std::marker::Copy` is not implemented for `Baz` + = help: within `{closure@$DIR/contract-captures-via-closure-noncopy.rs:13:42: 13:57}`, the trait `std::marker::Copy` is not implemented for `Baz` note: required because it's used within this closure - --> $DIR/contract-captures-via-closure-noncopy.rs:12:42 + --> $DIR/contract-captures-via-closure-noncopy.rs:13:42 | LL | #[core::contracts::ensures({let old = x; move |ret:&Baz| ret.baz == old.baz*2 })] | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/coroutine/dropck.rs b/tests/ui/coroutine/dropck.rs index 9331c1fa1d580..ef7508affa81c 100644 --- a/tests/ui/coroutine/dropck.rs +++ b/tests/ui/coroutine/dropck.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] use std::cell::RefCell; diff --git a/tests/ui/coroutine/dropck.stderr b/tests/ui/coroutine/dropck.stderr index 78fdeec972f79..23ef764f1c34b 100644 --- a/tests/ui/coroutine/dropck.stderr +++ b/tests/ui/coroutine/dropck.stderr @@ -1,5 +1,5 @@ error[E0597]: `*cell` does not live long enough - --> $DIR/dropck.rs:10:40 + --> $DIR/dropck.rs:11:40 | LL | let (mut gen, cell); | ---- binding `cell` declared here @@ -16,7 +16,7 @@ LL | } = note: values in a scope are dropped in the opposite order they are defined error[E0597]: `ref_` does not live long enough - --> $DIR/dropck.rs:16:18 + --> $DIR/dropck.rs:17:18 | LL | let ref_ = Box::leak(Box::new(Some(cell.borrow_mut()))); | ---- binding `ref_` declared here diff --git a/tests/ui/coroutine/yield-while-ref-reborrowed.rs b/tests/ui/coroutine/yield-while-ref-reborrowed.rs index 2600d0b4124b1..ed851efda5d2a 100644 --- a/tests/ui/coroutine/yield-while-ref-reborrowed.rs +++ b/tests/ui/coroutine/yield-while-ref-reborrowed.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] use std::cell::Cell; diff --git a/tests/ui/coroutine/yield-while-ref-reborrowed.stderr b/tests/ui/coroutine/yield-while-ref-reborrowed.stderr index 7c9b766457dbf..0b2cc92f4b4af 100644 --- a/tests/ui/coroutine/yield-while-ref-reborrowed.stderr +++ b/tests/ui/coroutine/yield-while-ref-reborrowed.stderr @@ -1,5 +1,5 @@ error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access - --> $DIR/yield-while-ref-reborrowed.rs:39:20 + --> $DIR/yield-while-ref-reborrowed.rs:40:20 | LL | || { | -- coroutine construction occurs here diff --git a/tests/ui/drop/dynamic-drop.rs b/tests/ui/drop/dynamic-drop.rs index 1bd75e1852c4a..8315985f9a972 100644 --- a/tests/ui/drop/dynamic-drop.rs +++ b/tests/ui/drop/dynamic-drop.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass //@ needs-unwind //@ ignore-backends: gcc diff --git a/tests/ui/editions/edition-cstr-2015-2018.rs b/tests/ui/editions/edition-cstr-2015-2018.rs index 4d4274251f050..8dc87aa1b051a 100644 --- a/tests/ui/editions/edition-cstr-2015-2018.rs +++ b/tests/ui/editions/edition-cstr-2015-2018.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 macro_rules! construct { ($x:ident) => { $x"str" } } //~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` //~| NOTE expected one of 8 possible tokens diff --git a/tests/ui/editions/edition-cstr-2015-2018.stderr b/tests/ui/editions/edition-cstr-2015-2018.stderr index 62cb857655200..bcc9d65405bd1 100644 --- a/tests/ui/editions/edition-cstr-2015-2018.stderr +++ b/tests/ui/editions/edition-cstr-2015-2018.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` - --> $DIR/edition-cstr-2015-2018.rs:27:6 + --> $DIR/edition-cstr-2015-2018.rs:28:6 | LL | c"str"; | ^^^^^ expected one of 8 possible tokens @@ -10,7 +10,7 @@ LL | c"str"; = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` - --> $DIR/edition-cstr-2015-2018.rs:37:7 + --> $DIR/edition-cstr-2015-2018.rs:38:7 | LL | cr"str"; | ^^^^^ expected one of 8 possible tokens @@ -21,7 +21,7 @@ LL | cr"str"; = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `#` - --> $DIR/edition-cstr-2015-2018.rs:47:7 + --> $DIR/edition-cstr-2015-2018.rs:48:7 | LL | cr##"str"##; | ^ expected one of 8 possible tokens @@ -32,13 +32,13 @@ LL | cr##"str"##; = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` - --> $DIR/edition-cstr-2015-2018.rs:57:7 + --> $DIR/edition-cstr-2015-2018.rs:58:7 | LL | c "str"; | ^^^^^ expected one of 8 possible tokens error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` - --> $DIR/edition-cstr-2015-2018.rs:1:44 + --> $DIR/edition-cstr-2015-2018.rs:2:44 | LL | macro_rules! construct { ($x:ident) => { $x"str" } } | ^^^^^ expected one of 8 possible tokens @@ -49,7 +49,7 @@ LL | construct!(c); = note: this error originates in the macro `construct` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` - --> $DIR/edition-cstr-2015-2018.rs:5:33 + --> $DIR/edition-cstr-2015-2018.rs:6:33 | LL | macro_rules! contain { () => { c"str" } } | ^^^^^ expected one of 8 possible tokens diff --git a/tests/ui/ergonomic-clones/closure/print-verbose.rs b/tests/ui/ergonomic-clones/closure/print-verbose.rs index e80d0d4b649a5..1c403b53914ac 100644 --- a/tests/ui/ergonomic-clones/closure/print-verbose.rs +++ b/tests/ui/ergonomic-clones/closure/print-verbose.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags: -Zverbose-internals #![feature(ergonomic_clones)] diff --git a/tests/ui/ergonomic-clones/closure/print-verbose.stderr b/tests/ui/ergonomic-clones/closure/print-verbose.stderr index 283405c79d61e..703fa225e71b1 100644 --- a/tests/ui/ergonomic-clones/closure/print-verbose.stderr +++ b/tests/ui/ergonomic-clones/closure/print-verbose.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `c` - --> $DIR/print-verbose.rs:22:5 + --> $DIR/print-verbose.rs:23:5 | LL | let c = to_fn_once(use || { | - move occurs because `c` has type `{f::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'?9 str>, T)}`, which does not implement the `Copy` trait @@ -10,7 +10,7 @@ LL | c(); | ^ value used here after move | note: this value implements `FnOnce`, which causes it to be moved when called - --> $DIR/print-verbose.rs:21:5 + --> $DIR/print-verbose.rs:22:5 | LL | c(); | ^ diff --git a/tests/ui/ergonomic-clones/closure/print.rs b/tests/ui/ergonomic-clones/closure/print.rs index c24a4cc5094be..ed1b2caa57396 100644 --- a/tests/ui/ergonomic-clones/closure/print.rs +++ b/tests/ui/ergonomic-clones/closure/print.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(ergonomic_clones)] #![allow(incomplete_features)] diff --git a/tests/ui/ergonomic-clones/closure/print.stderr b/tests/ui/ergonomic-clones/closure/print.stderr index 5f48059ebff29..7cc88ae1fd52d 100644 --- a/tests/ui/ergonomic-clones/closure/print.stderr +++ b/tests/ui/ergonomic-clones/closure/print.stderr @@ -1,8 +1,8 @@ error[E0382]: use of moved value: `c` - --> $DIR/print.rs:20:5 + --> $DIR/print.rs:21:5 | LL | let c = to_fn_once(use || { - | - move occurs because `c` has type `{closure@$DIR/print.rs:15:24: 15:30}`, which does not implement the `Copy` trait + | - move occurs because `c` has type `{closure@$DIR/print.rs:16:24: 16:30}`, which does not implement the `Copy` trait ... LL | c(); | --- `c` moved due to this call @@ -10,7 +10,7 @@ LL | c(); | ^ value used here after move | note: this value implements `FnOnce`, which causes it to be moved when called - --> $DIR/print.rs:19:5 + --> $DIR/print.rs:20:5 | LL | c(); | ^ diff --git a/tests/ui/error-codes/E0501.rs b/tests/ui/error-codes/E0501.rs index 3e39d9a63c59d..136b6e4c2c42a 100644 --- a/tests/ui/error-codes/E0501.rs +++ b/tests/ui/error-codes/E0501.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn inside_closure(x: &mut i32) { } diff --git a/tests/ui/error-codes/E0501.stderr b/tests/ui/error-codes/E0501.stderr index 53d98d7e13fee..1b9620eb1ea2f 100644 --- a/tests/ui/error-codes/E0501.stderr +++ b/tests/ui/error-codes/E0501.stderr @@ -1,5 +1,5 @@ error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access - --> $DIR/E0501.rs:14:23 + --> $DIR/E0501.rs:15:23 | LL | let bar = || { | -- closure construction occurs here @@ -13,7 +13,7 @@ LL | drop(bar); | --- first borrow later used here error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access - --> $DIR/E0501.rs:17:23 + --> $DIR/E0501.rs:18:23 | LL | let bar = || { | -- closure construction occurs here diff --git a/tests/ui/error-codes/E0504.rs b/tests/ui/error-codes/E0504.rs index c2658bef61975..68bd342ef4726 100644 --- a/tests/ui/error-codes/E0504.rs +++ b/tests/ui/error-codes/E0504.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 struct FancyNum { num: u8, } diff --git a/tests/ui/error-codes/E0504.stderr b/tests/ui/error-codes/E0504.stderr index 582669593336a..c4cbc834ad98c 100644 --- a/tests/ui/error-codes/E0504.stderr +++ b/tests/ui/error-codes/E0504.stderr @@ -1,5 +1,5 @@ error[E0505]: cannot move out of `fancy_num` because it is borrowed - --> $DIR/E0504.rs:9:13 + --> $DIR/E0504.rs:10:13 | LL | let fancy_num = FancyNum { num: 5 }; | --------- binding `fancy_num` declared here @@ -15,7 +15,7 @@ LL | println!("main function: {}", fancy_ref.num); | ------------- borrow later used here | note: if `FancyNum` implemented `Clone`, you could clone the value - --> $DIR/E0504.rs:1:1 + --> $DIR/E0504.rs:2:1 | LL | struct FancyNum { | ^^^^^^^^^^^^^^^ consider implementing `Clone` for this type diff --git a/tests/ui/fmt/format-args-capture.rs b/tests/ui/fmt/format-args-capture.rs index 8562ae305f826..1c70cc41f029c 100644 --- a/tests/ui/fmt/format-args-capture.rs +++ b/tests/ui/fmt/format-args-capture.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass fn main() { diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs index 294fb6743fbcd..611c8659fdef0 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs +++ b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 trait X { type Y<'a>; } diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index e18d8198c9455..cdc874e0a9f3c 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr +++ b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr @@ -1,5 +1,5 @@ error: lifetimes must be followed by `+` to form a trait object type - --> $DIR/gat-trait-path-parenthesised-args.rs:5:29 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:29 | LL | fn foo<'a>(arg: Box>) {} | ^^ @@ -10,7 +10,7 @@ LL | fn foo<'a>(arg: Box>) {} | +++++++++++++ error: parenthesized generic arguments cannot be used in associated type constraints - --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:27 | LL | fn foo<'a>(arg: Box>) {} | ^^^^^ @@ -22,7 +22,7 @@ LL + fn foo<'a>(arg: Box = &'a ()>>) {} | error: parenthesized generic arguments cannot be used in associated type constraints - --> $DIR/gat-trait-path-parenthesised-args.rs:18:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:19:27 | LL | fn bar<'a>(arg: Box>) {} | ^-- @@ -30,13 +30,13 @@ LL | fn bar<'a>(arg: Box>) {} | help: remove these parentheses error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:27 | LL | fn foo<'a>(arg: Box>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ -- @@ -46,7 +46,7 @@ LL | fn foo<'a>(arg: Box>) {} | +++ error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:27 | LL | fn foo<'a>(arg: Box>) {} | ^---- help: remove the unnecessary generics @@ -54,19 +54,19 @@ LL | fn foo<'a>(arg: Box>) {} | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:27 | LL | fn foo<'a>(arg: Box>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ -- @@ -77,7 +77,7 @@ LL | fn foo<'a>(arg: Box>) {} | +++ error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:27 | LL | fn foo<'a>(arg: Box>) {} | ^---- help: remove the unnecessary generics @@ -85,20 +85,20 @@ LL | fn foo<'a>(arg: Box>) {} | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:27 | LL | fn foo<'a>(arg: Box>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ -- @@ -109,7 +109,7 @@ LL | fn foo<'a>(arg: Box>) {} | +++ error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:27 | LL | fn foo<'a>(arg: Box>) {} | ^---- help: remove the unnecessary generics @@ -117,27 +117,27 @@ LL | fn foo<'a>(arg: Box>) {} | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0224]: at least one trait is required for an object type - --> $DIR/gat-trait-path-parenthesised-args.rs:5:29 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:29 | LL | fn foo<'a>(arg: Box>) {} | ^^ error[E0038]: the trait `X` is not dyn compatible - --> $DIR/gat-trait-path-parenthesised-args.rs:5:21 + --> $DIR/gat-trait-path-parenthesised-args.rs:6:21 | LL | fn foo<'a>(arg: Box>) {} | ^^^^^^^^^^^^^^^^^^^^^ `X` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | trait X { | - this trait is not dyn compatible... @@ -146,13 +146,13 @@ LL | type Y<'a>; = help: consider moving `Y` to another trait error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:18:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:19:27 | LL | fn bar<'a>(arg: Box>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ -- @@ -162,13 +162,13 @@ LL | fn bar<'a>(arg: Box>) {} | ++ error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:18:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:19:27 | LL | fn bar<'a>(arg: Box>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ -- @@ -179,13 +179,13 @@ LL | fn bar<'a>(arg: Box>) {} | ++ error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:18:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:19:27 | LL | fn bar<'a>(arg: Box>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | type Y<'a>; | ^ -- @@ -196,14 +196,14 @@ LL | fn bar<'a>(arg: Box>) {} | ++ error[E0038]: the trait `X` is not dyn compatible - --> $DIR/gat-trait-path-parenthesised-args.rs:18:21 + --> $DIR/gat-trait-path-parenthesised-args.rs:19:21 | LL | fn bar<'a>(arg: Box>) {} | ^^^^^^^^^^^^^^^ `X` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:3:8 | LL | trait X { | - this trait is not dyn compatible... diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr index e710466447043..6fdf47fba73e0 100644 --- a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr +++ b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr @@ -1,12 +1,12 @@ error[E0599]: no method named `my_debug` found for reference `&impl Debug` in the current scope - --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:15:11 + --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:16:11 | LL | x.my_debug(); | ^^^^^^^^ method not found in `&impl Debug` | = help: items from traits can only be used if the trait is implemented and in scope note: `MyDebug` defines an item `my_debug`, perhaps you need to implement it - --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:4:1 + --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:5:1 | LL | trait MyDebug { | ^^^^^^^^^^^^^ diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr index de808259d40dc..7570d412bf19b 100644 --- a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr +++ b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `my_debug` found for reference `&_` in the current scope - --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:15:11 + --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:16:11 | LL | x.my_debug(); | ^^^^^^^^ method not found in `&_` diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs index 0c9909efa1ba1..e49ff39eb09b7 100644 --- a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs +++ b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs @@ -1,5 +1,6 @@ //@ revisions: current next //@[next] compile-flags: -Znext-solver +//@[next] edition: 2015 trait MyDebug { fn my_debug(&self); diff --git a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr index 112341287f8a5..27f5f8676b8da 100644 --- a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr +++ b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr @@ -1,5 +1,5 @@ error[E0782]: expected a type, found a trait - --> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:24 + --> $DIR/generic-with-implicit-hrtb-without-dyn.rs:7:24 | LL | fn ice() -> impl AsRef { | ^^^^^^^ @@ -10,7 +10,7 @@ LL | fn ice() -> impl AsRef { | +++ error[E0782]: expected a type, found a trait - --> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:24 + --> $DIR/generic-with-implicit-hrtb-without-dyn.rs:7:24 | LL | fn ice() -> impl AsRef { | ^^^^^^^ diff --git a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.pre2021.stderr b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.pre2021.stderr new file mode 100644 index 0000000000000..82a2c6693826b --- /dev/null +++ b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.pre2021.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied + --> $DIR/generic-with-implicit-hrtb-without-dyn.rs:7:13 + | +LL | fn ice() -> impl AsRef { + | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs index df43250f15153..ce078aa18cb0e 100644 --- a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs +++ b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs @@ -1,10 +1,11 @@ -//@ revisions: edition2015 edition2021 +//@ revisions: pre2021 edition2021 +//@[pre2021]edition:2015..2021 //@[edition2021]edition:2021 #![allow(warnings)] fn ice() -> impl AsRef { - //[edition2015]~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277] + //[pre2021]~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277] //[edition2021]~^^ ERROR: expected a type, found a trait [E0782] //[edition2021]~| ERROR: expected a type, found a trait [E0782] todo!() diff --git a/tests/ui/impl-trait/method/would-constrain-opaque.current.stderr b/tests/ui/impl-trait/method/would-constrain-opaque.current.stderr index 60533a39c536f..44597b7313c52 100644 --- a/tests/ui/impl-trait/method/would-constrain-opaque.current.stderr +++ b/tests/ui/impl-trait/method/would-constrain-opaque.current.stderr @@ -1,25 +1,25 @@ error[E0599]: no method named `method` found for reference `&impl Sized` in the current scope - --> $DIR/would-constrain-opaque.rs:28:11 + --> $DIR/would-constrain-opaque.rs:29:11 | LL | x.method(); | ^^^^^^ method not found in `&impl Sized` | = help: items from traits can only be used if the trait is implemented and in scope note: `Trait` defines an item `method`, perhaps you need to implement it - --> $DIR/would-constrain-opaque.rs:15:1 + --> $DIR/would-constrain-opaque.rs:16:1 | LL | trait Trait: Sized { | ^^^^^^^^^^^^^^^^^^ error[E0599]: no method named `method` found for reference `&impl Sized` in the current scope - --> $DIR/would-constrain-opaque.rs:30:11 + --> $DIR/would-constrain-opaque.rs:31:11 | LL | x.method(); | ^^^^^^ method not found in `&impl Sized` | = help: items from traits can only be used if the trait is implemented and in scope note: `Trait` defines an item `method`, perhaps you need to implement it - --> $DIR/would-constrain-opaque.rs:15:1 + --> $DIR/would-constrain-opaque.rs:16:1 | LL | trait Trait: Sized { | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/impl-trait/method/would-constrain-opaque.next.stderr b/tests/ui/impl-trait/method/would-constrain-opaque.next.stderr index 23a4ceb826a6e..e2fc9c6d2d88e 100644 --- a/tests/ui/impl-trait/method/would-constrain-opaque.next.stderr +++ b/tests/ui/impl-trait/method/would-constrain-opaque.next.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `method` found for reference `&_` in the current scope - --> $DIR/would-constrain-opaque.rs:28:11 + --> $DIR/would-constrain-opaque.rs:29:11 | LL | x.method(); | ^^^^^^ method not found in `&_` @@ -11,7 +11,7 @@ LL + use Trait; | error[E0599]: no method named `method` found for reference `&_` in the current scope - --> $DIR/would-constrain-opaque.rs:30:11 + --> $DIR/would-constrain-opaque.rs:31:11 | LL | x.method(); | ^^^^^^ method not found in `&_` diff --git a/tests/ui/impl-trait/method/would-constrain-opaque.rs b/tests/ui/impl-trait/method/would-constrain-opaque.rs index 8dd322825296b..514cecad9e5e5 100644 --- a/tests/ui/impl-trait/method/would-constrain-opaque.rs +++ b/tests/ui/impl-trait/method/would-constrain-opaque.rs @@ -1,5 +1,6 @@ //@ revisions: current next //@[next] compile-flags: -Znext-solver +//@[next] edition: 2015 // If we don't treat `impl Sized` as rigid, the first call would // resolve to the trait method, constraining the opaque, while the diff --git a/tests/ui/impl-trait/where-allowed-2.rs b/tests/ui/impl-trait/where-allowed-2.rs index 1a1210d00726d..d2e323af6a1a1 100644 --- a/tests/ui/impl-trait/where-allowed-2.rs +++ b/tests/ui/impl-trait/where-allowed-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 use std::fmt::Debug; fn in_adt_in_return() -> Vec { panic!() } diff --git a/tests/ui/impl-trait/where-allowed-2.stderr b/tests/ui/impl-trait/where-allowed-2.stderr index c421e587a9ef6..83364e6e7724f 100644 --- a/tests/ui/impl-trait/where-allowed-2.stderr +++ b/tests/ui/impl-trait/where-allowed-2.stderr @@ -1,5 +1,5 @@ error[E0283]: type annotations needed - --> $DIR/where-allowed-2.rs:3:30 + --> $DIR/where-allowed-2.rs:4:30 | LL | fn in_adt_in_return() -> Vec { panic!() } | ^^^^^^^^^^ cannot infer type diff --git a/tests/ui/impl-trait/where-allowed.rs b/tests/ui/impl-trait/where-allowed.rs index 04a95f7f6f013..7667c6c8f7a73 100644 --- a/tests/ui/impl-trait/where-allowed.rs +++ b/tests/ui/impl-trait/where-allowed.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //! A simple test for testing many permutations of allowedness of //! impl Trait #![feature(impl_trait_in_fn_trait_return)] diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr index 4d8f23bf7ca64..6cab4fabb1ffb 100644 --- a/tests/ui/impl-trait/where-allowed.stderr +++ b/tests/ui/impl-trait/where-allowed.stderr @@ -1,5 +1,5 @@ error[E0666]: nested `impl Trait` is not allowed - --> $DIR/where-allowed.rs:50:51 + --> $DIR/where-allowed.rs:51:51 | LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() } | --------^^^^^^^^^^- @@ -8,7 +8,7 @@ LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() } | outer `impl Trait` error[E0666]: nested `impl Trait` is not allowed - --> $DIR/where-allowed.rs:59:57 + --> $DIR/where-allowed.rs:60:57 | LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() } | --------^^^^^^^^^^- @@ -17,7 +17,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic | outer `impl Trait` error[E0658]: `impl Trait` in associated types is unstable - --> $DIR/where-allowed.rs:121:16 + --> $DIR/where-allowed.rs:122:16 | LL | type Out = impl Debug; | ^^^^^^^^^^ @@ -27,7 +27,7 @@ LL | type Out = impl Debug; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: `impl Trait` in type aliases is unstable - --> $DIR/where-allowed.rs:158:23 + --> $DIR/where-allowed.rs:159:23 | LL | type InTypeAlias = impl Debug; | ^^^^^^^^^^ @@ -37,7 +37,7 @@ LL | type InTypeAlias = impl Debug; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: `impl Trait` in type aliases is unstable - --> $DIR/where-allowed.rs:162:39 + --> $DIR/where-allowed.rs:163:39 | LL | type InReturnInTypeAlias = fn() -> impl Debug; | ^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | type InReturnInTypeAlias = fn() -> impl Debug; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in `fn` pointer parameters - --> $DIR/where-allowed.rs:18:40 + --> $DIR/where-allowed.rs:19:40 | LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() } | ^^^^^^^^^^ @@ -55,7 +55,7 @@ LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in `fn` pointer return types - --> $DIR/where-allowed.rs:22:42 + --> $DIR/where-allowed.rs:23:42 | LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() } | ^^^^^^^^^^ @@ -63,7 +63,7 @@ LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in `fn` pointer parameters - --> $DIR/where-allowed.rs:26:38 + --> $DIR/where-allowed.rs:27:38 | LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() } | ^^^^^^^^^^ @@ -71,7 +71,7 @@ LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in `fn` pointer return types - --> $DIR/where-allowed.rs:30:40 + --> $DIR/where-allowed.rs:31:40 | LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() } | ^^^^^^^^^^ @@ -79,7 +79,7 @@ LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds - --> $DIR/where-allowed.rs:34:49 + --> $DIR/where-allowed.rs:35:49 | LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() } | ^^^^^^^^^^ @@ -87,7 +87,7 @@ LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds - --> $DIR/where-allowed.rs:38:51 + --> $DIR/where-allowed.rs:39:51 | LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() } | ^^^^^^^^^^ @@ -95,7 +95,7 @@ LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds - --> $DIR/where-allowed.rs:42:55 + --> $DIR/where-allowed.rs:43:55 | LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() } | ^^^^^^^^^^ @@ -103,7 +103,7 @@ LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!( = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds - --> $DIR/where-allowed.rs:50:51 + --> $DIR/where-allowed.rs:51:51 | LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() } | ^^^^^^^^^^ @@ -111,7 +111,7 @@ LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds - --> $DIR/where-allowed.rs:55:53 + --> $DIR/where-allowed.rs:56:53 | LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() } | ^^^^^^^^^^ @@ -119,7 +119,7 @@ LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds - --> $DIR/where-allowed.rs:59:57 + --> $DIR/where-allowed.rs:60:57 | LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() } | ^^^^^^^^^^ @@ -127,7 +127,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds - --> $DIR/where-allowed.rs:68:38 + --> $DIR/where-allowed.rs:69:38 | LL | fn in_Fn_parameter_in_generics (_: F) { panic!() } | ^^^^^^^^^^ @@ -135,7 +135,7 @@ LL | fn in_Fn_parameter_in_generics (_: F) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds - --> $DIR/where-allowed.rs:72:40 + --> $DIR/where-allowed.rs:73:40 | LL | fn in_Fn_return_in_generics impl Debug> (_: F) { panic!() } | ^^^^^^^^^^ @@ -143,7 +143,7 @@ LL | fn in_Fn_return_in_generics impl Debug> (_: F) { panic!() } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in field types - --> $DIR/where-allowed.rs:85:32 + --> $DIR/where-allowed.rs:86:32 | LL | struct InBraceStructField { x: impl Debug } | ^^^^^^^^^^ @@ -151,7 +151,7 @@ LL | struct InBraceStructField { x: impl Debug } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in field types - --> $DIR/where-allowed.rs:89:41 + --> $DIR/where-allowed.rs:90:41 | LL | struct InAdtInBraceStructField { x: Vec } | ^^^^^^^^^^ @@ -159,7 +159,7 @@ LL | struct InAdtInBraceStructField { x: Vec } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in field types - --> $DIR/where-allowed.rs:93:27 + --> $DIR/where-allowed.rs:94:27 | LL | struct InTupleStructField(impl Debug); | ^^^^^^^^^^ @@ -167,7 +167,7 @@ LL | struct InTupleStructField(impl Debug); = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in field types - --> $DIR/where-allowed.rs:98:25 + --> $DIR/where-allowed.rs:99:25 | LL | InBraceVariant { x: impl Debug }, | ^^^^^^^^^^ @@ -175,7 +175,7 @@ LL | InBraceVariant { x: impl Debug }, = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in field types - --> $DIR/where-allowed.rs:100:20 + --> $DIR/where-allowed.rs:101:20 | LL | InTupleVariant(impl Debug), | ^^^^^^^^^^ @@ -183,7 +183,7 @@ LL | InTupleVariant(impl Debug), = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in `extern fn` parameters - --> $DIR/where-allowed.rs:142:33 + --> $DIR/where-allowed.rs:143:33 | LL | fn in_foreign_parameters(_: impl Debug); | ^^^^^^^^^^ @@ -191,7 +191,7 @@ LL | fn in_foreign_parameters(_: impl Debug); = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in `extern fn` return types - --> $DIR/where-allowed.rs:145:31 + --> $DIR/where-allowed.rs:146:31 | LL | fn in_foreign_return() -> impl Debug; | ^^^^^^^^^^ @@ -199,7 +199,7 @@ LL | fn in_foreign_return() -> impl Debug; = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in `fn` pointer return types - --> $DIR/where-allowed.rs:162:39 + --> $DIR/where-allowed.rs:163:39 | LL | type InReturnInTypeAlias = fn() -> impl Debug; | ^^^^^^^^^^ @@ -207,7 +207,7 @@ LL | type InReturnInTypeAlias = fn() -> impl Debug; = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in traits - --> $DIR/where-allowed.rs:167:16 + --> $DIR/where-allowed.rs:168:16 | LL | impl PartialEq for () { | ^^^^^^^^^^ @@ -215,7 +215,7 @@ LL | impl PartialEq for () { = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in impl headers - --> $DIR/where-allowed.rs:172:24 + --> $DIR/where-allowed.rs:173:24 | LL | impl PartialEq<()> for impl Debug { | ^^^^^^^^^^ @@ -223,7 +223,7 @@ LL | impl PartialEq<()> for impl Debug { = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in impl headers - --> $DIR/where-allowed.rs:177:6 + --> $DIR/where-allowed.rs:178:6 | LL | impl impl Debug { | ^^^^^^^^^^ @@ -231,7 +231,7 @@ LL | impl impl Debug { = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in impl headers - --> $DIR/where-allowed.rs:183:24 + --> $DIR/where-allowed.rs:184:24 | LL | impl InInherentImplAdt { | ^^^^^^^^^^ @@ -239,7 +239,7 @@ LL | impl InInherentImplAdt { = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in bounds - --> $DIR/where-allowed.rs:189:11 + --> $DIR/where-allowed.rs:190:11 | LL | where impl Debug: Debug | ^^^^^^^^^^ @@ -247,7 +247,7 @@ LL | where impl Debug: Debug = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in bounds - --> $DIR/where-allowed.rs:196:15 + --> $DIR/where-allowed.rs:197:15 | LL | where Vec: Debug | ^^^^^^^^^^ @@ -255,7 +255,7 @@ LL | where Vec: Debug = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in bounds - --> $DIR/where-allowed.rs:203:24 + --> $DIR/where-allowed.rs:204:24 | LL | where T: PartialEq | ^^^^^^^^^^ @@ -263,7 +263,7 @@ LL | where T: PartialEq = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds - --> $DIR/where-allowed.rs:210:17 + --> $DIR/where-allowed.rs:211:17 | LL | where T: Fn(impl Debug) | ^^^^^^^^^^ @@ -271,7 +271,7 @@ LL | where T: Fn(impl Debug) = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds - --> $DIR/where-allowed.rs:217:22 + --> $DIR/where-allowed.rs:218:22 | LL | where T: Fn() -> impl Debug | ^^^^^^^^^^ @@ -279,7 +279,7 @@ LL | where T: Fn() -> impl Debug = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in generic parameter defaults - --> $DIR/where-allowed.rs:223:40 + --> $DIR/where-allowed.rs:224:40 | LL | struct InStructGenericParamDefault(T); | ^^^^^^^^^^ @@ -287,7 +287,7 @@ LL | struct InStructGenericParamDefault(T); = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in generic parameter defaults - --> $DIR/where-allowed.rs:227:36 + --> $DIR/where-allowed.rs:228:36 | LL | enum InEnumGenericParamDefault { Variant(T) } | ^^^^^^^^^^ @@ -295,7 +295,7 @@ LL | enum InEnumGenericParamDefault { Variant(T) } = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in generic parameter defaults - --> $DIR/where-allowed.rs:231:38 + --> $DIR/where-allowed.rs:232:38 | LL | trait InTraitGenericParamDefault {} | ^^^^^^^^^^ @@ -303,7 +303,7 @@ LL | trait InTraitGenericParamDefault {} = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in generic parameter defaults - --> $DIR/where-allowed.rs:235:41 + --> $DIR/where-allowed.rs:236:41 | LL | type InTypeAliasGenericParamDefault = T; | ^^^^^^^^^^ @@ -311,7 +311,7 @@ LL | type InTypeAliasGenericParamDefault = T; = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in generic parameter defaults - --> $DIR/where-allowed.rs:240:10 + --> $DIR/where-allowed.rs:241:10 | LL | impl T {} | ^^^^^^^^^^ @@ -319,7 +319,7 @@ LL | impl T {} = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in generic parameter defaults - --> $DIR/where-allowed.rs:246:40 + --> $DIR/where-allowed.rs:247:40 | LL | fn in_method_generic_param_default(_: T) {} | ^^^^^^^^^^ @@ -327,7 +327,7 @@ LL | fn in_method_generic_param_default(_: T) {} = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/where-allowed.rs:250:29 + --> $DIR/where-allowed.rs:251:29 | LL | let _in_local_variable: impl Fn() = || {}; | ^^^^^^^^^ @@ -338,7 +338,7 @@ LL | let _in_local_variable: impl Fn() = || {}; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in closure return types - --> $DIR/where-allowed.rs:252:46 + --> $DIR/where-allowed.rs:253:46 | LL | let _in_return_in_local_variable = || -> impl Fn() { || {} }; | ^^^^^^^^^ @@ -346,7 +346,7 @@ LL | let _in_return_in_local_variable = || -> impl Fn() { || {} }; = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0053]: method `in_trait_impl_return` has an incompatible type for trait - --> $DIR/where-allowed.rs:128:34 + --> $DIR/where-allowed.rs:129:34 | LL | type Out = impl Debug; | ---------- the expected opaque type @@ -355,7 +355,7 @@ LL | fn in_trait_impl_return() -> impl Debug { () } | ^^^^^^^^^^ expected opaque type, found a different opaque type | note: type in trait - --> $DIR/where-allowed.rs:118:34 + --> $DIR/where-allowed.rs:119:34 | LL | fn in_trait_impl_return() -> Self::Out; | ^^^^^^^^^ @@ -369,7 +369,7 @@ LL + fn in_trait_impl_return() -> <() as DummyTrait>::Out { () } | error[E0283]: type annotations needed - --> $DIR/where-allowed.rs:46:57 + --> $DIR/where-allowed.rs:47:57 | LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() } | ^^^^^^^^^^ cannot infer type @@ -377,7 +377,7 @@ LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic! = note: cannot satisfy `_: Debug` error[E0283]: type annotations needed - --> $DIR/where-allowed.rs:64:46 + --> $DIR/where-allowed.rs:65:46 | LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() } | ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type @@ -391,7 +391,7 @@ LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { pani where F: Sync, F: Fn, Args: Tuple; error[E0118]: no nominal type found for inherent implementation - --> $DIR/where-allowed.rs:240:1 + --> $DIR/where-allowed.rs:241:1 | LL | impl T {} | ^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type @@ -399,7 +399,7 @@ LL | impl T {} = note: either implement a trait on it or create a newtype to wrap it instead error: unconstrained opaque type - --> $DIR/where-allowed.rs:121:16 + --> $DIR/where-allowed.rs:122:16 | LL | type Out = impl Debug; | ^^^^^^^^^^ @@ -407,7 +407,7 @@ LL | type Out = impl Debug; = note: `Out` must be used in combination with a concrete type within the same impl error: unconstrained opaque type - --> $DIR/where-allowed.rs:158:23 + --> $DIR/where-allowed.rs:159:23 | LL | type InTypeAlias = impl Debug; | ^^^^^^^^^^ @@ -420,14 +420,14 @@ Some errors have detailed explanations: E0053, E0118, E0283, E0562, E0658, E0666 For more information about an error, try `rustc --explain E0053`. Future incompatibility report: Future breakage diagnostic: warning: defaults for generic parameters are not allowed here - --> $DIR/where-allowed.rs:246:36 + --> $DIR/where-allowed.rs:247:36 | LL | fn in_method_generic_param_default(_: T) {} | ^^^^^^^^^^^^^^ Future breakage diagnostic: warning: defaults for generic parameters are not allowed here - --> $DIR/where-allowed.rs:240:6 + --> $DIR/where-allowed.rs:241:6 | LL | impl T {} | ^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-16966.rs b/tests/ui/issues/issue-16966.rs index 9c6188350e3f7..66a3fadac8d96 100644 --- a/tests/ui/issues/issue-16966.rs +++ b/tests/ui/issues/issue-16966.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() { panic!(std::default::Default::default()); //~^ ERROR type annotations needed diff --git a/tests/ui/issues/issue-16966.stderr b/tests/ui/issues/issue-16966.stderr index 0ed12d3a2e974..e294d8830de04 100644 --- a/tests/ui/issues/issue-16966.stderr +++ b/tests/ui/issues/issue-16966.stderr @@ -1,5 +1,5 @@ error[E0283]: type annotations needed - --> $DIR/issue-16966.rs:2:12 + --> $DIR/issue-16966.rs:3:12 | LL | panic!(std::default::Default::default()); | -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- diff --git a/tests/ui/iterators/generator_returned_from_fn.rs b/tests/ui/iterators/generator_returned_from_fn.rs index bd0317b1ffb7f..efc681c318007 100644 --- a/tests/ui/iterators/generator_returned_from_fn.rs +++ b/tests/ui/iterators/generator_returned_from_fn.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(iter_macro, impl_trait_in_fn_trait_return, yield_expr)] use std::iter::iter; diff --git a/tests/ui/iterators/generator_returned_from_fn.stderr b/tests/ui/iterators/generator_returned_from_fn.stderr index b2324af6d5e40..8bec119ddbc01 100644 --- a/tests/ui/iterators/generator_returned_from_fn.stderr +++ b/tests/ui/iterators/generator_returned_from_fn.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return reference to function parameter `a` - --> $DIR/generator_returned_from_fn.rs:24:13 + --> $DIR/generator_returned_from_fn.rs:25:13 | LL | iter! { || { | _____________^ @@ -11,7 +11,7 @@ LL | | } } | |_____^ returns a reference to data owned by the current function error: gen closure does not implement `Fn` because it captures state from its environment - --> $DIR/generator_returned_from_fn.rs:33:13 + --> $DIR/generator_returned_from_fn.rs:34:13 | LL | iter! { move || { | _____________-^^^^^^ @@ -20,15 +20,15 @@ LL | | for x in 5..10 { LL | | yield x * 2; LL | | } LL | | } } - | |_____- return type was inferred to be `{gen closure@$DIR/generator_returned_from_fn.rs:33:13: 33:20}` here + | |_____- return type was inferred to be `{gen closure@$DIR/generator_returned_from_fn.rs:34:13: 34:20}` here error[E0700]: hidden type for `impl FnOnce() -> impl Iterator` captures lifetime that does not appear in bounds - --> $DIR/generator_returned_from_fn.rs:42:13 + --> $DIR/generator_returned_from_fn.rs:43:13 | LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator { | ---- ------------------------------------------ opaque type defined here | | - | hidden type `{gen closure@$DIR/generator_returned_from_fn.rs:42:13: 42:20}` captures the anonymous lifetime defined here + | hidden type `{gen closure@$DIR/generator_returned_from_fn.rs:43:13: 43:20}` captures the anonymous lifetime defined here LL | iter! { move || { | _____________^ LL | | @@ -44,12 +44,12 @@ LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator | +++++++++ error[E0700]: hidden type for `impl Iterator` captures lifetime that does not appear in bounds - --> $DIR/generator_returned_from_fn.rs:42:13 + --> $DIR/generator_returned_from_fn.rs:43:13 | LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator { | ---- ------------------------- opaque type defined here | | - | hidden type `{gen closure body@$DIR/generator_returned_from_fn.rs:42:21: 49:6}` captures the anonymous lifetime defined here + | hidden type `{gen closure body@$DIR/generator_returned_from_fn.rs:43:21: 50:6}` captures the anonymous lifetime defined here LL | iter! { move || { | _____________^ LL | | diff --git a/tests/ui/iterators/into-iter-on-arrays-lint.fixed b/tests/ui/iterators/into-iter-on-arrays-lint.fixed index be754a28ffa92..848b13750d77a 100644 --- a/tests/ui/iterators/into-iter-on-arrays-lint.fixed +++ b/tests/ui/iterators/into-iter-on-arrays-lint.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass //@ run-rustfix //@ rustfix-only-machine-applicable diff --git a/tests/ui/iterators/into-iter-on-arrays-lint.rs b/tests/ui/iterators/into-iter-on-arrays-lint.rs index e4dddb325cd37..a505ba8313f56 100644 --- a/tests/ui/iterators/into-iter-on-arrays-lint.rs +++ b/tests/ui/iterators/into-iter-on-arrays-lint.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass //@ run-rustfix //@ rustfix-only-machine-applicable diff --git a/tests/ui/iterators/into-iter-on-arrays-lint.stderr b/tests/ui/iterators/into-iter-on-arrays-lint.stderr index a3eb3133a00f3..b173eb01d22ec 100644 --- a/tests/ui/iterators/into-iter-on-arrays-lint.stderr +++ b/tests/ui/iterators/into-iter-on-arrays-lint.stderr @@ -1,5 +1,5 @@ warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:11:11 + --> $DIR/into-iter-on-arrays-lint.rs:12:11 | LL | small.into_iter(); | ^^^^^^^^^ @@ -19,7 +19,7 @@ LL + IntoIterator::into_iter(small); | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:14:12 + --> $DIR/into-iter-on-arrays-lint.rs:15:12 | LL | [1, 2].into_iter(); | ^^^^^^^^^ @@ -38,7 +38,7 @@ LL + IntoIterator::into_iter([1, 2]); | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:17:9 + --> $DIR/into-iter-on-arrays-lint.rs:18:9 | LL | big.into_iter(); | ^^^^^^^^^ @@ -57,7 +57,7 @@ LL + IntoIterator::into_iter(big); | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:20:15 + --> $DIR/into-iter-on-arrays-lint.rs:21:15 | LL | [0u8; 33].into_iter(); | ^^^^^^^^^ @@ -76,7 +76,7 @@ LL + IntoIterator::into_iter([0u8; 33]); | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:24:21 + --> $DIR/into-iter-on-arrays-lint.rs:25:21 | LL | Box::new(small).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` @@ -85,7 +85,7 @@ LL | Box::new(small).into_iter(); = note: for more information, see warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:27:22 + --> $DIR/into-iter-on-arrays-lint.rs:28:22 | LL | Box::new([1, 2]).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` @@ -94,7 +94,7 @@ LL | Box::new([1, 2]).into_iter(); = note: for more information, see warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:30:19 + --> $DIR/into-iter-on-arrays-lint.rs:31:19 | LL | Box::new(big).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` @@ -103,7 +103,7 @@ LL | Box::new(big).into_iter(); = note: for more information, see warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:33:25 + --> $DIR/into-iter-on-arrays-lint.rs:34:25 | LL | Box::new([0u8; 33]).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` @@ -112,7 +112,7 @@ LL | Box::new([0u8; 33]).into_iter(); = note: for more information, see warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:37:31 + --> $DIR/into-iter-on-arrays-lint.rs:38:31 | LL | Box::new(Box::new(small)).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` @@ -121,7 +121,7 @@ LL | Box::new(Box::new(small)).into_iter(); = note: for more information, see warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:40:32 + --> $DIR/into-iter-on-arrays-lint.rs:41:32 | LL | Box::new(Box::new([1, 2])).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` @@ -130,7 +130,7 @@ LL | Box::new(Box::new([1, 2])).into_iter(); = note: for more information, see warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:43:29 + --> $DIR/into-iter-on-arrays-lint.rs:44:29 | LL | Box::new(Box::new(big)).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` @@ -139,7 +139,7 @@ LL | Box::new(Box::new(big)).into_iter(); = note: for more information, see warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 - --> $DIR/into-iter-on-arrays-lint.rs:46:35 + --> $DIR/into-iter-on-arrays-lint.rs:47:35 | LL | Box::new(Box::new([0u8; 33])).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` diff --git a/tests/ui/lint/rfc-2383-lint-reason/fulfilled_expectation_early_lints.rs b/tests/ui/lint/rfc-2383-lint-reason/fulfilled_expectation_early_lints.rs index 078c3a59eb3e1..df14f68a0fb51 100644 --- a/tests/ui/lint/rfc-2383-lint-reason/fulfilled_expectation_early_lints.rs +++ b/tests/ui/lint/rfc-2383-lint-reason/fulfilled_expectation_early_lints.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ check-pass fn expect_early_pass_lints() { diff --git a/tests/ui/lint/unused/issue-54538-unused-parens-lint.fixed b/tests/ui/lint/unused/issue-54538-unused-parens-lint.fixed index ada37ccd64014..6eba47ed585ed 100644 --- a/tests/ui/lint/unused/issue-54538-unused-parens-lint.fixed +++ b/tests/ui/lint/unused/issue-54538-unused-parens-lint.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![feature(box_patterns, stmt_expr_attributes, yeet_expr)] diff --git a/tests/ui/lint/unused/issue-54538-unused-parens-lint.rs b/tests/ui/lint/unused/issue-54538-unused-parens-lint.rs index 67066c3bee3f7..f14d37d4d91d5 100644 --- a/tests/ui/lint/unused/issue-54538-unused-parens-lint.rs +++ b/tests/ui/lint/unused/issue-54538-unused-parens-lint.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-rustfix #![feature(box_patterns, stmt_expr_attributes, yeet_expr)] diff --git a/tests/ui/lint/unused/issue-54538-unused-parens-lint.stderr b/tests/ui/lint/unused/issue-54538-unused-parens-lint.stderr index d5fdaef42d87e..e96350f099830 100644 --- a/tests/ui/lint/unused/issue-54538-unused-parens-lint.stderr +++ b/tests/ui/lint/unused/issue-54538-unused-parens-lint.stderr @@ -1,11 +1,11 @@ error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:16:9 + --> $DIR/issue-54538-unused-parens-lint.rs:17:9 | LL | let (a) = 0; | ^ ^ | note: the lint level is defined here - --> $DIR/issue-54538-unused-parens-lint.rs:13:9 + --> $DIR/issue-54538-unused-parens-lint.rs:14:9 | LL | #![deny(unused_parens, unused_braces)] | ^^^^^^^^^^^^^ @@ -16,7 +16,7 @@ LL + let a = 0; | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:17:9 + --> $DIR/issue-54538-unused-parens-lint.rs:18:9 | LL | for (a) in 0..1 {} | ^ ^ @@ -28,7 +28,7 @@ LL + for a in 0..1 {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:18:12 + --> $DIR/issue-54538-unused-parens-lint.rs:19:12 | LL | if let (a) = 0 {} | ^ ^ @@ -40,7 +40,7 @@ LL + if let a = 0 {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:19:15 + --> $DIR/issue-54538-unused-parens-lint.rs:20:15 | LL | while let (a) = 0 {} | ^ ^ @@ -52,7 +52,7 @@ LL + while let a = 0 {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:20:12 + --> $DIR/issue-54538-unused-parens-lint.rs:21:12 | LL | fn foo((a): u8) {} | ^ ^ @@ -64,7 +64,7 @@ LL + fn foo(a: u8) {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:21:14 + --> $DIR/issue-54538-unused-parens-lint.rs:22:14 | LL | let _ = |(a): u8| 0; | ^ ^ @@ -76,7 +76,7 @@ LL + let _ = |a: u8| 0; | error: unnecessary parentheses around `if` condition - --> $DIR/issue-54538-unused-parens-lint.rs:45:15 + --> $DIR/issue-54538-unused-parens-lint.rs:46:15 | LL | loop { if (break) {} } | ^ ^ @@ -88,7 +88,7 @@ LL + loop { if break {} } | error: unnecessary parentheses around `if` condition - --> $DIR/issue-54538-unused-parens-lint.rs:46:15 + --> $DIR/issue-54538-unused-parens-lint.rs:47:15 | LL | loop { if (break ({ println!("hello") })) {} } | ^ ^ @@ -100,7 +100,7 @@ LL + loop { if break ({ println!("hello") }) {} } | error: unnecessary parentheses around `break` value - --> $DIR/issue-54538-unused-parens-lint.rs:46:22 + --> $DIR/issue-54538-unused-parens-lint.rs:47:22 | LL | loop { if (break ({ println!("hello") })) {} } | ^ ^ @@ -112,13 +112,13 @@ LL + loop { if (break { println!("hello") }) {} } | error: unnecessary braces around `break` value - --> $DIR/issue-54538-unused-parens-lint.rs:49:22 + --> $DIR/issue-54538-unused-parens-lint.rs:50:22 | LL | loop { if (break { println!("hello") }) {} } | ^^ ^^ | note: the lint level is defined here - --> $DIR/issue-54538-unused-parens-lint.rs:13:24 + --> $DIR/issue-54538-unused-parens-lint.rs:14:24 | LL | #![deny(unused_parens, unused_braces)] | ^^^^^^^^^^^^^ @@ -129,7 +129,7 @@ LL + loop { if (break println!("hello")) {} } | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:73:12 + --> $DIR/issue-54538-unused-parens-lint.rs:74:12 | LL | if let (0 | 1) = 0 {} | ^ ^ @@ -141,7 +141,7 @@ LL + if let 0 | 1 = 0 {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:74:13 + --> $DIR/issue-54538-unused-parens-lint.rs:75:13 | LL | if let ((0 | 1),) = (0,) {} | ^ ^ @@ -153,7 +153,7 @@ LL + if let (0 | 1,) = (0,) {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:75:13 + --> $DIR/issue-54538-unused-parens-lint.rs:76:13 | LL | if let [(0 | 1)] = [0] {} | ^ ^ @@ -165,7 +165,7 @@ LL + if let [0 | 1] = [0] {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:76:16 + --> $DIR/issue-54538-unused-parens-lint.rs:77:16 | LL | if let 0 | (1 | 2) = 0 {} | ^ ^ @@ -177,7 +177,7 @@ LL + if let 0 | 1 | 2 = 0 {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:78:15 + --> $DIR/issue-54538-unused-parens-lint.rs:79:15 | LL | if let TS((0 | 1)) = TS(0) {} | ^ ^ @@ -189,7 +189,7 @@ LL + if let TS(0 | 1) = TS(0) {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:80:20 + --> $DIR/issue-54538-unused-parens-lint.rs:81:20 | LL | if let NS { f: (0 | 1) } = (NS { f: 0 }) {} | ^ ^ @@ -201,7 +201,7 @@ LL + if let NS { f: 0 | 1 } = (NS { f: 0 }) {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:90:9 + --> $DIR/issue-54538-unused-parens-lint.rs:91:9 | LL | (_) => {} | ^ ^ @@ -213,7 +213,7 @@ LL + _ => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:91:9 + --> $DIR/issue-54538-unused-parens-lint.rs:92:9 | LL | (y) => {} | ^ ^ @@ -225,7 +225,7 @@ LL + y => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:92:9 + --> $DIR/issue-54538-unused-parens-lint.rs:93:9 | LL | (ref r) => {} | ^ ^ @@ -237,7 +237,7 @@ LL + ref r => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:93:9 + --> $DIR/issue-54538-unused-parens-lint.rs:94:9 | LL | (e @ 1...2) => {} | ^ ^ @@ -249,7 +249,7 @@ LL + e @ 1...2 => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:99:9 + --> $DIR/issue-54538-unused-parens-lint.rs:100:9 | LL | (e @ &(1...2)) => {} | ^ ^ @@ -261,7 +261,7 @@ LL + e @ &(1...2) => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:100:10 + --> $DIR/issue-54538-unused-parens-lint.rs:101:10 | LL | &(_) => {} | ^ ^ @@ -273,7 +273,7 @@ LL + &_ => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:111:9 + --> $DIR/issue-54538-unused-parens-lint.rs:112:9 | LL | (_) => {} | ^ ^ @@ -285,7 +285,7 @@ LL + _ => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:112:9 + --> $DIR/issue-54538-unused-parens-lint.rs:113:9 | LL | (y) => {} | ^ ^ @@ -297,7 +297,7 @@ LL + y => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:113:9 + --> $DIR/issue-54538-unused-parens-lint.rs:114:9 | LL | (ref r) => {} | ^ ^ @@ -309,7 +309,7 @@ LL + ref r => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:114:9 + --> $DIR/issue-54538-unused-parens-lint.rs:115:9 | LL | (e @ 1..=2) => {} | ^ ^ @@ -321,7 +321,7 @@ LL + e @ 1..=2 => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:120:9 + --> $DIR/issue-54538-unused-parens-lint.rs:121:9 | LL | (e @ &(1..=2)) => {} | ^ ^ @@ -333,7 +333,7 @@ LL + e @ &(1..=2) => {} | error: unnecessary parentheses around pattern - --> $DIR/issue-54538-unused-parens-lint.rs:121:10 + --> $DIR/issue-54538-unused-parens-lint.rs:122:10 | LL | &(_) => {} | ^ ^ diff --git a/tests/ui/macros/assert-macro-owned.rs b/tests/ui/macros/assert-macro-owned.rs index f9b6f5f518059..6046278c1bdfd 100644 --- a/tests/ui/macros/assert-macro-owned.rs +++ b/tests/ui/macros/assert-macro-owned.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-fail //@ error-pattern:panicked //@ error-pattern:test-assert-owned diff --git a/tests/ui/macros/assert-trailing-junk.rs b/tests/ui/macros/assert-trailing-junk.rs index 16f68dfcf9b65..e0fd82847b77c 100644 --- a/tests/ui/macros/assert-trailing-junk.rs +++ b/tests/ui/macros/assert-trailing-junk.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ revisions: with-generic-asset without-generic-asset //@ [with-generic-asset] compile-flags: --cfg feature="generic_assert" diff --git a/tests/ui/macros/assert-trailing-junk.with-generic-asset.stderr b/tests/ui/macros/assert-trailing-junk.with-generic-asset.stderr index 7582c8e8659bc..2af779a467a3f 100644 --- a/tests/ui/macros/assert-trailing-junk.with-generic-asset.stderr +++ b/tests/ui/macros/assert-trailing-junk.with-generic-asset.stderr @@ -1,17 +1,17 @@ error: expected one of `,`, `.`, `?`, or an operator, found `some` - --> $DIR/assert-trailing-junk.rs:9:18 + --> $DIR/assert-trailing-junk.rs:10:18 | LL | assert!(true some extra junk, "whatever"); | ^^^^ expected one of `,`, `.`, `?`, or an operator error: expected one of `,`, `.`, `?`, or an operator, found `some` - --> $DIR/assert-trailing-junk.rs:12:18 + --> $DIR/assert-trailing-junk.rs:13:18 | LL | assert!(true some extra junk); | ^^^^ expected one of `,`, `.`, `?`, or an operator error: no rules expected `blah` - --> $DIR/assert-trailing-junk.rs:15:30 + --> $DIR/assert-trailing-junk.rs:16:30 | LL | assert!(true, "whatever" blah); | -^^^^ no rules expected this token in macro call @@ -21,7 +21,7 @@ LL | assert!(true, "whatever" blah); = note: while trying to match sequence start error: unexpected string literal - --> $DIR/assert-trailing-junk.rs:18:18 + --> $DIR/assert-trailing-junk.rs:19:18 | LL | assert!(true "whatever" blah); | -^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | assert!(true "whatever" blah); | help: try adding a comma error: no rules expected `blah` - --> $DIR/assert-trailing-junk.rs:18:29 + --> $DIR/assert-trailing-junk.rs:19:29 | LL | assert!(true "whatever" blah); | -^^^^ no rules expected this token in macro call @@ -39,7 +39,7 @@ LL | assert!(true "whatever" blah); = note: while trying to match sequence start error: macro requires an expression as an argument - --> $DIR/assert-trailing-junk.rs:22:5 + --> $DIR/assert-trailing-junk.rs:23:5 | LL | assert!(true;); | ^^^^^^^^^^^^-^ @@ -47,7 +47,7 @@ LL | assert!(true;); | help: try removing semicolon error: unexpected string literal - --> $DIR/assert-trailing-junk.rs:25:27 + --> $DIR/assert-trailing-junk.rs:26:27 | LL | assert!(false || true "error message"); | -^^^^^^^^^^^^^^^ diff --git a/tests/ui/macros/assert-trailing-junk.without-generic-asset.stderr b/tests/ui/macros/assert-trailing-junk.without-generic-asset.stderr index 7582c8e8659bc..2af779a467a3f 100644 --- a/tests/ui/macros/assert-trailing-junk.without-generic-asset.stderr +++ b/tests/ui/macros/assert-trailing-junk.without-generic-asset.stderr @@ -1,17 +1,17 @@ error: expected one of `,`, `.`, `?`, or an operator, found `some` - --> $DIR/assert-trailing-junk.rs:9:18 + --> $DIR/assert-trailing-junk.rs:10:18 | LL | assert!(true some extra junk, "whatever"); | ^^^^ expected one of `,`, `.`, `?`, or an operator error: expected one of `,`, `.`, `?`, or an operator, found `some` - --> $DIR/assert-trailing-junk.rs:12:18 + --> $DIR/assert-trailing-junk.rs:13:18 | LL | assert!(true some extra junk); | ^^^^ expected one of `,`, `.`, `?`, or an operator error: no rules expected `blah` - --> $DIR/assert-trailing-junk.rs:15:30 + --> $DIR/assert-trailing-junk.rs:16:30 | LL | assert!(true, "whatever" blah); | -^^^^ no rules expected this token in macro call @@ -21,7 +21,7 @@ LL | assert!(true, "whatever" blah); = note: while trying to match sequence start error: unexpected string literal - --> $DIR/assert-trailing-junk.rs:18:18 + --> $DIR/assert-trailing-junk.rs:19:18 | LL | assert!(true "whatever" blah); | -^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | assert!(true "whatever" blah); | help: try adding a comma error: no rules expected `blah` - --> $DIR/assert-trailing-junk.rs:18:29 + --> $DIR/assert-trailing-junk.rs:19:29 | LL | assert!(true "whatever" blah); | -^^^^ no rules expected this token in macro call @@ -39,7 +39,7 @@ LL | assert!(true "whatever" blah); = note: while trying to match sequence start error: macro requires an expression as an argument - --> $DIR/assert-trailing-junk.rs:22:5 + --> $DIR/assert-trailing-junk.rs:23:5 | LL | assert!(true;); | ^^^^^^^^^^^^-^ @@ -47,7 +47,7 @@ LL | assert!(true;); | help: try removing semicolon error: unexpected string literal - --> $DIR/assert-trailing-junk.rs:25:27 + --> $DIR/assert-trailing-junk.rs:26:27 | LL | assert!(false || true "error message"); | -^^^^^^^^^^^^^^^ diff --git a/tests/ui/macros/auxiliary/borrowck-error-in-macro.rs b/tests/ui/macros/auxiliary/borrowck-error-in-macro.rs index 2d5f2bda2edfe..431297bd55f11 100644 --- a/tests/ui/macros/auxiliary/borrowck-error-in-macro.rs +++ b/tests/ui/macros/auxiliary/borrowck-error-in-macro.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #[macro_export] macro_rules! ice { () => { diff --git a/tests/ui/macros/auxiliary/fancy-panic.rs b/tests/ui/macros/auxiliary/fancy-panic.rs index 35be93b059032..ba6079c551ff0 100644 --- a/tests/ui/macros/auxiliary/fancy-panic.rs +++ b/tests/ui/macros/auxiliary/fancy-panic.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #[macro_export] macro_rules! fancy_panic { () => { diff --git a/tests/ui/macros/auxiliary/or-pattern.rs b/tests/ui/macros/auxiliary/or-pattern.rs index a319c405eb6e8..7b42a77c64dfa 100644 --- a/tests/ui/macros/auxiliary/or-pattern.rs +++ b/tests/ui/macros/auxiliary/or-pattern.rs @@ -1,3 +1,4 @@ +//@ edition:2015 #![crate_type = "lib"] #[macro_export] diff --git a/tests/ui/macros/borrowck-error-in-macro.rs b/tests/ui/macros/borrowck-error-in-macro.rs index fe75188efd203..46fe69702cd5b 100644 --- a/tests/ui/macros/borrowck-error-in-macro.rs +++ b/tests/ui/macros/borrowck-error-in-macro.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ aux-build: borrowck-error-in-macro.rs //@ error-pattern: a call in this macro requires a mutable binding due to mutable borrow of `d` //FIXME: remove error-pattern (see #141896) diff --git a/tests/ui/macros/borrowck-error-in-macro.stderr b/tests/ui/macros/borrowck-error-in-macro.stderr index ec0302ee287ec..31ea2382eb5b6 100644 --- a/tests/ui/macros/borrowck-error-in-macro.stderr +++ b/tests/ui/macros/borrowck-error-in-macro.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow value as mutable, as it is not declared as mutable - --> $DIR/borrowck-error-in-macro.rs:7:1 + --> $DIR/borrowck-error-in-macro.rs:8:1 | LL | a::ice! {} | ^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | a::ice! {} | = note: this error originates in the macro `a::ice` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider changing this to be mutable - --> $DIR/auxiliary/borrowck-error-in-macro.rs:6:17 + --> $DIR/auxiliary/borrowck-error-in-macro.rs:7:17 | LL | let mut c = || *d += 1; | +++ diff --git a/tests/ui/macros/macro-comma-behavior-rpass.rs b/tests/ui/macros/macro-comma-behavior-rpass.rs index 14ac1dd42124d..1ffa840c0e7fa 100644 --- a/tests/ui/macros/macro-comma-behavior-rpass.rs +++ b/tests/ui/macros/macro-comma-behavior-rpass.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass //@ needs-unwind #![allow(unused_imports)] diff --git a/tests/ui/macros/macro-follow-rpass.rs b/tests/ui/macros/macro-follow-rpass.rs index 8350887922531..8551b1887708e 100644 --- a/tests/ui/macros/macro-follow-rpass.rs +++ b/tests/ui/macros/macro-follow-rpass.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass #![allow(unused_macros)] // Check the macro follow sets (see corresponding cfail test). diff --git a/tests/ui/macros/macro-follow.rs b/tests/ui/macros/macro-follow.rs index 8054418d9b893..923c9bd6cedc9 100644 --- a/tests/ui/macros/macro-follow.rs +++ b/tests/ui/macros/macro-follow.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // // Check the macro follow sets (see corresponding rpass test). diff --git a/tests/ui/macros/macro-follow.stderr b/tests/ui/macros/macro-follow.stderr index 61ae79d235ee5..92491dc26d12b 100644 --- a/tests/ui/macros/macro-follow.stderr +++ b/tests/ui/macros/macro-follow.stderr @@ -1,5 +1,5 @@ error: `$p:pat` is followed by `(`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:8:13 + --> $DIR/macro-follow.rs:9:13 | LL | ($p:pat ()) => {}; | ^ not allowed after `pat` fragments @@ -7,7 +7,7 @@ LL | ($p:pat ()) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `[`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:9:13 + --> $DIR/macro-follow.rs:10:13 | LL | ($p:pat []) => {}; | ^ not allowed after `pat` fragments @@ -15,7 +15,7 @@ LL | ($p:pat []) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `{`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:10:13 + --> $DIR/macro-follow.rs:11:13 | LL | ($p:pat {}) => {}; | ^ not allowed after `pat` fragments @@ -23,7 +23,7 @@ LL | ($p:pat {}) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `:`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:11:13 + --> $DIR/macro-follow.rs:12:13 | LL | ($p:pat :) => {}; | ^ not allowed after `pat` fragments @@ -31,7 +31,7 @@ LL | ($p:pat :) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `>`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:12:13 + --> $DIR/macro-follow.rs:13:13 | LL | ($p:pat >) => {}; | ^ not allowed after `pat` fragments @@ -39,7 +39,7 @@ LL | ($p:pat >) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `+`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:13:13 + --> $DIR/macro-follow.rs:14:13 | LL | ($p:pat +) => {}; | ^ not allowed after `pat` fragments @@ -47,7 +47,7 @@ LL | ($p:pat +) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `ident`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:14:13 + --> $DIR/macro-follow.rs:15:13 | LL | ($p:pat ident) => {}; | ^^^^^ not allowed after `pat` fragments @@ -55,7 +55,7 @@ LL | ($p:pat ident) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$q:pat`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:15:13 + --> $DIR/macro-follow.rs:16:13 | LL | ($p:pat $q:pat) => {}; | ^^^^^^ not allowed after `pat` fragments @@ -63,7 +63,7 @@ LL | ($p:pat $q:pat) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$e:expr`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:16:13 + --> $DIR/macro-follow.rs:17:13 | LL | ($p:pat $e:expr) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -71,7 +71,7 @@ LL | ($p:pat $e:expr) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$t:ty`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:17:13 + --> $DIR/macro-follow.rs:18:13 | LL | ($p:pat $t:ty) => {}; | ^^^^^ not allowed after `pat` fragments @@ -79,7 +79,7 @@ LL | ($p:pat $t:ty) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$s:stmt`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:18:13 + --> $DIR/macro-follow.rs:19:13 | LL | ($p:pat $s:stmt) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -87,7 +87,7 @@ LL | ($p:pat $s:stmt) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$q:path`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:19:13 + --> $DIR/macro-follow.rs:20:13 | LL | ($p:pat $q:path) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -95,7 +95,7 @@ LL | ($p:pat $q:path) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$b:block`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:20:13 + --> $DIR/macro-follow.rs:21:13 | LL | ($p:pat $b:block) => {}; | ^^^^^^^^ not allowed after `pat` fragments @@ -103,7 +103,7 @@ LL | ($p:pat $b:block) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$i:ident`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:21:13 + --> $DIR/macro-follow.rs:22:13 | LL | ($p:pat $i:ident) => {}; | ^^^^^^^^ not allowed after `pat` fragments @@ -111,7 +111,7 @@ LL | ($p:pat $i:ident) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$t:tt`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:22:13 + --> $DIR/macro-follow.rs:23:13 | LL | ($p:pat $t:tt) => {}; | ^^^^^ not allowed after `pat` fragments @@ -119,7 +119,7 @@ LL | ($p:pat $t:tt) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$i:item`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:23:13 + --> $DIR/macro-follow.rs:24:13 | LL | ($p:pat $i:item) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -127,7 +127,7 @@ LL | ($p:pat $i:item) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$m:meta`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:24:13 + --> $DIR/macro-follow.rs:25:13 | LL | ($p:pat $m:meta) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -135,7 +135,7 @@ LL | ($p:pat $m:meta) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:28:14 + --> $DIR/macro-follow.rs:29:14 | LL | ($e:expr ()) => {}; | ^ not allowed after `expr` fragments @@ -143,7 +143,7 @@ LL | ($e:expr ()) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:29:14 + --> $DIR/macro-follow.rs:30:14 | LL | ($e:expr []) => {}; | ^ not allowed after `expr` fragments @@ -151,7 +151,7 @@ LL | ($e:expr []) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:30:14 + --> $DIR/macro-follow.rs:31:14 | LL | ($e:expr {}) => {}; | ^ not allowed after `expr` fragments @@ -159,7 +159,7 @@ LL | ($e:expr {}) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `=`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:31:14 + --> $DIR/macro-follow.rs:32:14 | LL | ($e:expr =) => {}; | ^ not allowed after `expr` fragments @@ -167,7 +167,7 @@ LL | ($e:expr =) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `|`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:32:14 + --> $DIR/macro-follow.rs:33:14 | LL | ($e:expr |) => {}; | ^ not allowed after `expr` fragments @@ -175,7 +175,7 @@ LL | ($e:expr |) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `:`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:33:14 + --> $DIR/macro-follow.rs:34:14 | LL | ($e:expr :) => {}; | ^ not allowed after `expr` fragments @@ -183,7 +183,7 @@ LL | ($e:expr :) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `>`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:34:14 + --> $DIR/macro-follow.rs:35:14 | LL | ($e:expr >) => {}; | ^ not allowed after `expr` fragments @@ -191,7 +191,7 @@ LL | ($e:expr >) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:35:14 + --> $DIR/macro-follow.rs:36:14 | LL | ($e:expr +) => {}; | ^ not allowed after `expr` fragments @@ -199,7 +199,7 @@ LL | ($e:expr +) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `ident`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:36:14 + --> $DIR/macro-follow.rs:37:14 | LL | ($e:expr ident) => {}; | ^^^^^ not allowed after `expr` fragments @@ -207,7 +207,7 @@ LL | ($e:expr ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `if`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:37:14 + --> $DIR/macro-follow.rs:38:14 | LL | ($e:expr if) => {}; | ^^ not allowed after `expr` fragments @@ -215,7 +215,7 @@ LL | ($e:expr if) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `in`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:38:14 + --> $DIR/macro-follow.rs:39:14 | LL | ($e:expr in) => {}; | ^^ not allowed after `expr` fragments @@ -223,7 +223,7 @@ LL | ($e:expr in) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$p:pat`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:39:14 + --> $DIR/macro-follow.rs:40:14 | LL | ($e:expr $p:pat) => {}; | ^^^^^^ not allowed after `expr` fragments @@ -231,7 +231,7 @@ LL | ($e:expr $p:pat) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$f:expr`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:40:14 + --> $DIR/macro-follow.rs:41:14 | LL | ($e:expr $f:expr) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -239,7 +239,7 @@ LL | ($e:expr $f:expr) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$t:ty`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:41:14 + --> $DIR/macro-follow.rs:42:14 | LL | ($e:expr $t:ty) => {}; | ^^^^^ not allowed after `expr` fragments @@ -247,7 +247,7 @@ LL | ($e:expr $t:ty) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$s:stmt`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:42:14 + --> $DIR/macro-follow.rs:43:14 | LL | ($e:expr $s:stmt) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -255,7 +255,7 @@ LL | ($e:expr $s:stmt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$p:path`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:43:14 + --> $DIR/macro-follow.rs:44:14 | LL | ($e:expr $p:path) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -263,7 +263,7 @@ LL | ($e:expr $p:path) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$b:block`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:44:14 + --> $DIR/macro-follow.rs:45:14 | LL | ($e:expr $b:block) => {}; | ^^^^^^^^ not allowed after `expr` fragments @@ -271,7 +271,7 @@ LL | ($e:expr $b:block) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$i:ident`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:45:14 + --> $DIR/macro-follow.rs:46:14 | LL | ($e:expr $i:ident) => {}; | ^^^^^^^^ not allowed after `expr` fragments @@ -279,7 +279,7 @@ LL | ($e:expr $i:ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$t:tt`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:46:14 + --> $DIR/macro-follow.rs:47:14 | LL | ($e:expr $t:tt) => {}; | ^^^^^ not allowed after `expr` fragments @@ -287,7 +287,7 @@ LL | ($e:expr $t:tt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$i:item`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:47:14 + --> $DIR/macro-follow.rs:48:14 | LL | ($e:expr $i:item) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -295,7 +295,7 @@ LL | ($e:expr $i:item) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$m:meta`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:48:14 + --> $DIR/macro-follow.rs:49:14 | LL | ($e:expr $m:meta) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -303,7 +303,7 @@ LL | ($e:expr $m:meta) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:53:12 + --> $DIR/macro-follow.rs:54:12 | LL | ($t:ty ()) => {}; | ^ not allowed after `ty` fragments @@ -311,7 +311,7 @@ LL | ($t:ty ()) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `+`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:55:12 + --> $DIR/macro-follow.rs:56:12 | LL | ($t:ty +) => {}; | ^ not allowed after `ty` fragments @@ -319,7 +319,7 @@ LL | ($t:ty +) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `ident`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:56:12 + --> $DIR/macro-follow.rs:57:12 | LL | ($t:ty ident) => {}; | ^^^^^ not allowed after `ty` fragments @@ -327,7 +327,7 @@ LL | ($t:ty ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `if`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:57:12 + --> $DIR/macro-follow.rs:58:12 | LL | ($t:ty if) => {}; | ^^ not allowed after `ty` fragments @@ -335,7 +335,7 @@ LL | ($t:ty if) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$p:pat`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:58:12 + --> $DIR/macro-follow.rs:59:12 | LL | ($t:ty $p:pat) => {}; | ^^^^^^ not allowed after `ty` fragments @@ -343,7 +343,7 @@ LL | ($t:ty $p:pat) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$e:expr`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:59:12 + --> $DIR/macro-follow.rs:60:12 | LL | ($t:ty $e:expr) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -351,7 +351,7 @@ LL | ($t:ty $e:expr) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$r:ty`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:60:12 + --> $DIR/macro-follow.rs:61:12 | LL | ($t:ty $r:ty) => {}; | ^^^^^ not allowed after `ty` fragments @@ -359,7 +359,7 @@ LL | ($t:ty $r:ty) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$s:stmt`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:61:12 + --> $DIR/macro-follow.rs:62:12 | LL | ($t:ty $s:stmt) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -367,7 +367,7 @@ LL | ($t:ty $s:stmt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$p:path`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:62:12 + --> $DIR/macro-follow.rs:63:12 | LL | ($t:ty $p:path) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -375,7 +375,7 @@ LL | ($t:ty $p:path) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$i:ident`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:64:12 + --> $DIR/macro-follow.rs:65:12 | LL | ($t:ty $i:ident) => {}; | ^^^^^^^^ not allowed after `ty` fragments @@ -383,7 +383,7 @@ LL | ($t:ty $i:ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$r:tt`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:65:12 + --> $DIR/macro-follow.rs:66:12 | LL | ($t:ty $r:tt) => {}; | ^^^^^ not allowed after `ty` fragments @@ -391,7 +391,7 @@ LL | ($t:ty $r:tt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$i:item`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:66:12 + --> $DIR/macro-follow.rs:67:12 | LL | ($t:ty $i:item) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -399,7 +399,7 @@ LL | ($t:ty $i:item) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$m:meta`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:67:12 + --> $DIR/macro-follow.rs:68:12 | LL | ($t:ty $m:meta) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -407,7 +407,7 @@ LL | ($t:ty $m:meta) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:71:14 + --> $DIR/macro-follow.rs:72:14 | LL | ($s:stmt ()) => {}; | ^ not allowed after `stmt` fragments @@ -415,7 +415,7 @@ LL | ($s:stmt ()) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:72:14 + --> $DIR/macro-follow.rs:73:14 | LL | ($s:stmt []) => {}; | ^ not allowed after `stmt` fragments @@ -423,7 +423,7 @@ LL | ($s:stmt []) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:73:14 + --> $DIR/macro-follow.rs:74:14 | LL | ($s:stmt {}) => {}; | ^ not allowed after `stmt` fragments @@ -431,7 +431,7 @@ LL | ($s:stmt {}) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `=`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:74:14 + --> $DIR/macro-follow.rs:75:14 | LL | ($s:stmt =) => {}; | ^ not allowed after `stmt` fragments @@ -439,7 +439,7 @@ LL | ($s:stmt =) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `|`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:75:14 + --> $DIR/macro-follow.rs:76:14 | LL | ($s:stmt |) => {}; | ^ not allowed after `stmt` fragments @@ -447,7 +447,7 @@ LL | ($s:stmt |) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `:`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:76:14 + --> $DIR/macro-follow.rs:77:14 | LL | ($s:stmt :) => {}; | ^ not allowed after `stmt` fragments @@ -455,7 +455,7 @@ LL | ($s:stmt :) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `>`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:77:14 + --> $DIR/macro-follow.rs:78:14 | LL | ($s:stmt >) => {}; | ^ not allowed after `stmt` fragments @@ -463,7 +463,7 @@ LL | ($s:stmt >) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `+`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:78:14 + --> $DIR/macro-follow.rs:79:14 | LL | ($s:stmt +) => {}; | ^ not allowed after `stmt` fragments @@ -471,7 +471,7 @@ LL | ($s:stmt +) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `ident`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:79:14 + --> $DIR/macro-follow.rs:80:14 | LL | ($s:stmt ident) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -479,7 +479,7 @@ LL | ($s:stmt ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `if`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:80:14 + --> $DIR/macro-follow.rs:81:14 | LL | ($s:stmt if) => {}; | ^^ not allowed after `stmt` fragments @@ -487,7 +487,7 @@ LL | ($s:stmt if) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `in`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:81:14 + --> $DIR/macro-follow.rs:82:14 | LL | ($s:stmt in) => {}; | ^^ not allowed after `stmt` fragments @@ -495,7 +495,7 @@ LL | ($s:stmt in) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$p:pat`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:82:14 + --> $DIR/macro-follow.rs:83:14 | LL | ($s:stmt $p:pat) => {}; | ^^^^^^ not allowed after `stmt` fragments @@ -503,7 +503,7 @@ LL | ($s:stmt $p:pat) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$e:expr`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:83:14 + --> $DIR/macro-follow.rs:84:14 | LL | ($s:stmt $e:expr) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -511,7 +511,7 @@ LL | ($s:stmt $e:expr) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:ty`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:84:14 + --> $DIR/macro-follow.rs:85:14 | LL | ($s:stmt $t:ty) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -519,7 +519,7 @@ LL | ($s:stmt $t:ty) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:stmt`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:85:14 + --> $DIR/macro-follow.rs:86:14 | LL | ($s:stmt $t:stmt) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -527,7 +527,7 @@ LL | ($s:stmt $t:stmt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$p:path`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:86:14 + --> $DIR/macro-follow.rs:87:14 | LL | ($s:stmt $p:path) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -535,7 +535,7 @@ LL | ($s:stmt $p:path) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$b:block`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:87:14 + --> $DIR/macro-follow.rs:88:14 | LL | ($s:stmt $b:block) => {}; | ^^^^^^^^ not allowed after `stmt` fragments @@ -543,7 +543,7 @@ LL | ($s:stmt $b:block) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$i:ident`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:88:14 + --> $DIR/macro-follow.rs:89:14 | LL | ($s:stmt $i:ident) => {}; | ^^^^^^^^ not allowed after `stmt` fragments @@ -551,7 +551,7 @@ LL | ($s:stmt $i:ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:tt`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:89:14 + --> $DIR/macro-follow.rs:90:14 | LL | ($s:stmt $t:tt) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -559,7 +559,7 @@ LL | ($s:stmt $t:tt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$i:item`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:90:14 + --> $DIR/macro-follow.rs:91:14 | LL | ($s:stmt $i:item) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -567,7 +567,7 @@ LL | ($s:stmt $i:item) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$m:meta`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:91:14 + --> $DIR/macro-follow.rs:92:14 | LL | ($s:stmt $m:meta) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -575,7 +575,7 @@ LL | ($s:stmt $m:meta) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$p:path` is followed by `(`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:95:14 + --> $DIR/macro-follow.rs:96:14 | LL | ($p:path ()) => {}; | ^ not allowed after `path` fragments @@ -583,7 +583,7 @@ LL | ($p:path ()) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `+`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:97:14 + --> $DIR/macro-follow.rs:98:14 | LL | ($p:path +) => {}; | ^ not allowed after `path` fragments @@ -591,7 +591,7 @@ LL | ($p:path +) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `ident`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:98:14 + --> $DIR/macro-follow.rs:99:14 | LL | ($p:path ident) => {}; | ^^^^^ not allowed after `path` fragments @@ -599,7 +599,7 @@ LL | ($p:path ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `if`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:99:14 + --> $DIR/macro-follow.rs:100:14 | LL | ($p:path if) => {}; | ^^ not allowed after `path` fragments @@ -607,7 +607,7 @@ LL | ($p:path if) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$q:pat`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:100:14 + --> $DIR/macro-follow.rs:101:14 | LL | ($p:path $q:pat) => {}; | ^^^^^^ not allowed after `path` fragments @@ -615,7 +615,7 @@ LL | ($p:path $q:pat) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$e:expr`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:101:14 + --> $DIR/macro-follow.rs:102:14 | LL | ($p:path $e:expr) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -623,7 +623,7 @@ LL | ($p:path $e:expr) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$t:ty`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:102:14 + --> $DIR/macro-follow.rs:103:14 | LL | ($p:path $t:ty) => {}; | ^^^^^ not allowed after `path` fragments @@ -631,7 +631,7 @@ LL | ($p:path $t:ty) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$s:stmt`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:103:14 + --> $DIR/macro-follow.rs:104:14 | LL | ($p:path $s:stmt) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -639,7 +639,7 @@ LL | ($p:path $s:stmt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$q:path`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:104:14 + --> $DIR/macro-follow.rs:105:14 | LL | ($p:path $q:path) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -647,7 +647,7 @@ LL | ($p:path $q:path) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$i:ident`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:106:14 + --> $DIR/macro-follow.rs:107:14 | LL | ($p:path $i:ident) => {}; | ^^^^^^^^ not allowed after `path` fragments @@ -655,7 +655,7 @@ LL | ($p:path $i:ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$t:tt`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:107:14 + --> $DIR/macro-follow.rs:108:14 | LL | ($p:path $t:tt) => {}; | ^^^^^ not allowed after `path` fragments @@ -663,7 +663,7 @@ LL | ($p:path $t:tt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$i:item`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:108:14 + --> $DIR/macro-follow.rs:109:14 | LL | ($p:path $i:item) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -671,7 +671,7 @@ LL | ($p:path $i:item) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$m:meta`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:109:14 + --> $DIR/macro-follow.rs:110:14 | LL | ($p:path $m:meta) => {}; | ^^^^^^^ not allowed after `path` fragments diff --git a/tests/ui/macros/macro-input-future-proofing.rs b/tests/ui/macros/macro-input-future-proofing.rs index 9a5bdb08a8ec8..205a3983c188e 100644 --- a/tests/ui/macros/macro-input-future-proofing.rs +++ b/tests/ui/macros/macro-input-future-proofing.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(unused_macros)] macro_rules! errors_everywhere { diff --git a/tests/ui/macros/macro-input-future-proofing.stderr b/tests/ui/macros/macro-input-future-proofing.stderr index 542486927dfd1..11960db987435 100644 --- a/tests/ui/macros/macro-input-future-proofing.stderr +++ b/tests/ui/macros/macro-input-future-proofing.stderr @@ -1,5 +1,5 @@ error: `$ty:ty` is followed by `<`, which is not allowed for `ty` fragments - --> $DIR/macro-input-future-proofing.rs:4:13 + --> $DIR/macro-input-future-proofing.rs:5:13 | LL | ($ty:ty <) => (); | ^ not allowed after `ty` fragments @@ -7,7 +7,7 @@ LL | ($ty:ty <) => (); = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$ty:ty` is followed by `<`, which is not allowed for `ty` fragments - --> $DIR/macro-input-future-proofing.rs:5:13 + --> $DIR/macro-input-future-proofing.rs:6:13 | LL | ($ty:ty < foo ,) => (); | ^ not allowed after `ty` fragments @@ -15,7 +15,7 @@ LL | ($ty:ty < foo ,) => (); = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$pa:pat` is followed by `>`, which is not allowed for `pat` fragments - --> $DIR/macro-input-future-proofing.rs:11:14 + --> $DIR/macro-input-future-proofing.rs:12:14 | LL | ($pa:pat >) => (); | ^ not allowed after `pat` fragments @@ -23,7 +23,7 @@ LL | ($pa:pat >) => (); = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$pa:pat` is followed by `$pb:pat`, which is not allowed for `pat` fragments - --> $DIR/macro-input-future-proofing.rs:13:14 + --> $DIR/macro-input-future-proofing.rs:14:14 | LL | ($pa:pat $pb:pat $ty:ty ,) => (); | ^^^^^^^ not allowed after `pat` fragments @@ -31,7 +31,7 @@ LL | ($pa:pat $pb:pat $ty:ty ,) => (); = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$pb:pat` is followed by `$ty:ty`, which is not allowed for `pat` fragments - --> $DIR/macro-input-future-proofing.rs:13:22 + --> $DIR/macro-input-future-proofing.rs:14:22 | LL | ($pa:pat $pb:pat $ty:ty ,) => (); | ^^^^^^ not allowed after `pat` fragments @@ -39,7 +39,7 @@ LL | ($pa:pat $pb:pat $ty:ty ,) => (); = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments - --> $DIR/macro-input-future-proofing.rs:16:17 + --> $DIR/macro-input-future-proofing.rs:17:17 | LL | ($($ty:ty)* -) => (); | ^ not allowed after `ty` fragments @@ -47,7 +47,7 @@ LL | ($($ty:ty)* -) => (); = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$b:ty` is followed by `-`, which is not allowed for `ty` fragments - --> $DIR/macro-input-future-proofing.rs:17:23 + --> $DIR/macro-input-future-proofing.rs:18:23 | LL | ($($a:ty, $b:ty)* -) => (); | ^ not allowed after `ty` fragments @@ -55,7 +55,7 @@ LL | ($($a:ty, $b:ty)* -) => (); = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments - --> $DIR/macro-input-future-proofing.rs:18:15 + --> $DIR/macro-input-future-proofing.rs:19:15 | LL | ($($ty:ty)-+) => (); | ^ not allowed after `ty` fragments @@ -63,7 +63,7 @@ LL | ($($ty:ty)-+) => (); = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragments - --> $DIR/macro-input-future-proofing.rs:19:21 + --> $DIR/macro-input-future-proofing.rs:20:21 | LL | ( $($a:expr)* $($b:tt)* ) => { }; | ^^^^^ not allowed after `expr` fragments diff --git a/tests/ui/macros/macro-pat-pattern-followed-by-or.rs b/tests/ui/macros/macro-pat-pattern-followed-by-or.rs index d584e919a2a00..59d26a9af2e10 100644 --- a/tests/ui/macros/macro-pat-pattern-followed-by-or.rs +++ b/tests/ui/macros/macro-pat-pattern-followed-by-or.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass #![allow(unused_macros)] macro_rules! foo { ($x:pat | $y:pat) => {} } // should be ok diff --git a/tests/ui/macros/no-matching-rule.rs b/tests/ui/macros/no-matching-rule.rs index 55e547ee72b0f..e9f39edcd3c7a 100644 --- a/tests/ui/macros/no-matching-rule.rs +++ b/tests/ui/macros/no-matching-rule.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() { panic!(@); //~ ERROR no rules expected `@` } diff --git a/tests/ui/macros/no-matching-rule.stderr b/tests/ui/macros/no-matching-rule.stderr index a6312a843f398..e154043fa97da 100644 --- a/tests/ui/macros/no-matching-rule.stderr +++ b/tests/ui/macros/no-matching-rule.stderr @@ -1,5 +1,5 @@ error: no rules expected `@` - --> $DIR/no-matching-rule.rs:2:12 + --> $DIR/no-matching-rule.rs:3:12 | LL | panic!(@); | ^ no rules expected this token in macro call diff --git a/tests/ui/macros/non-fmt-panic.fixed b/tests/ui/macros/non-fmt-panic.fixed index b102dba17319a..2bfb9d98d5773 100644 --- a/tests/ui/macros/non-fmt-panic.fixed +++ b/tests/ui/macros/non-fmt-panic.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //! The non_fmt_panics lint detects panic!(..) invocations where //! the first argument is not a formatting string. //! diff --git a/tests/ui/macros/non-fmt-panic.rs b/tests/ui/macros/non-fmt-panic.rs index 9277529c6d421..a71ee988ba824 100644 --- a/tests/ui/macros/non-fmt-panic.rs +++ b/tests/ui/macros/non-fmt-panic.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //! The non_fmt_panics lint detects panic!(..) invocations where //! the first argument is not a formatting string. //! diff --git a/tests/ui/macros/non-fmt-panic.stderr b/tests/ui/macros/non-fmt-panic.stderr index 1787316b48bb1..43f59782ee727 100644 --- a/tests/ui/macros/non-fmt-panic.stderr +++ b/tests/ui/macros/non-fmt-panic.stderr @@ -1,5 +1,5 @@ warning: panic message contains a brace - --> $DIR/non-fmt-panic.rs:19:29 + --> $DIR/non-fmt-panic.rs:20:29 | LL | panic!("here's a brace: {"); | ^ @@ -12,7 +12,7 @@ LL | panic!("{}", "here's a brace: {"); | +++++ warning: panic message contains a brace - --> $DIR/non-fmt-panic.rs:20:35 + --> $DIR/non-fmt-panic.rs:21:35 | LL | unreachable!("here's a brace: {"); | ^ @@ -24,7 +24,7 @@ LL | unreachable!("{}", "here's a brace: {"); | +++++ warning: panic message contains a brace - --> $DIR/non-fmt-panic.rs:21:31 + --> $DIR/non-fmt-panic.rs:22:31 | LL | std::panic!("another one: }"); | ^ @@ -36,7 +36,7 @@ LL | std::panic!("{}", "another one: }"); | +++++ warning: panic message contains an unused formatting placeholder - --> $DIR/non-fmt-panic.rs:22:25 + --> $DIR/non-fmt-panic.rs:23:25 | LL | core::panic!("Hello {}"); | ^^ @@ -52,7 +52,7 @@ LL | core::panic!("{}", "Hello {}"); | +++++ warning: panic message contains unused formatting placeholders - --> $DIR/non-fmt-panic.rs:23:21 + --> $DIR/non-fmt-panic.rs:24:21 | LL | assert!(false, "{:03x} {test} bla"); | ^^^^^^ ^^^^^^ @@ -68,7 +68,7 @@ LL | assert!(false, "{}", "{:03x} {test} bla"); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:25:20 + --> $DIR/non-fmt-panic.rs:26:20 | LL | assert!(false, S); | ^ @@ -81,7 +81,7 @@ LL | assert!(false, "{}", S); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:27:20 + --> $DIR/non-fmt-panic.rs:28:20 | LL | assert!(false, 123); | ^^^ @@ -94,7 +94,7 @@ LL | assert!(false, "{}", 123); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:29:20 + --> $DIR/non-fmt-panic.rs:30:20 | LL | assert!(false, Some(123)); | ^^^^^^^^^ @@ -107,7 +107,7 @@ LL | assert!(false, "{:?}", Some(123)); | +++++++ warning: panic message contains braces - --> $DIR/non-fmt-panic.rs:31:27 + --> $DIR/non-fmt-panic.rs:32:27 | LL | debug_assert!(false, "{{}} bla"); | ^^^^ @@ -119,7 +119,7 @@ LL | debug_assert!(false, "{}", "{{}} bla"); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:32:12 + --> $DIR/non-fmt-panic.rs:33:12 | LL | panic!(C); | ^ @@ -132,7 +132,7 @@ LL | panic!("{}", C); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:33:12 + --> $DIR/non-fmt-panic.rs:34:12 | LL | panic!(S); | ^ @@ -145,7 +145,7 @@ LL | panic!("{}", S); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:34:18 + --> $DIR/non-fmt-panic.rs:35:18 | LL | unreachable!(S); | ^ @@ -158,7 +158,7 @@ LL | unreachable!("{}", S); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:35:18 + --> $DIR/non-fmt-panic.rs:36:18 | LL | unreachable!(S); | ^ @@ -171,7 +171,7 @@ LL | unreachable!("{}", S); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:36:17 + --> $DIR/non-fmt-panic.rs:37:17 | LL | std::panic!(123); | ^^^ @@ -189,7 +189,7 @@ LL + std::panic::panic_any(123); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:37:18 + --> $DIR/non-fmt-panic.rs:38:18 | LL | core::panic!(&*"abc"); | ^^^^^^^ @@ -202,7 +202,7 @@ LL | core::panic!("{}", &*"abc"); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:38:12 + --> $DIR/non-fmt-panic.rs:39:12 | LL | panic!(Some(123)); | ^^^^^^^^^ @@ -220,7 +220,7 @@ LL + std::panic::panic_any(Some(123)); | warning: panic message contains an unused formatting placeholder - --> $DIR/non-fmt-panic.rs:39:12 + --> $DIR/non-fmt-panic.rs:40:12 | LL | panic!(concat!("{", "}")); | ^^^^^^^^^^^^^^^^^ @@ -236,7 +236,7 @@ LL | panic!("{}", concat!("{", "}")); | +++++ warning: panic message contains braces - --> $DIR/non-fmt-panic.rs:40:5 + --> $DIR/non-fmt-panic.rs:41:5 | LL | panic!(concat!("{", "{")); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -248,7 +248,7 @@ LL | panic!("{}", concat!("{", "{")); | +++++ warning: panic message contains an unused formatting placeholder - --> $DIR/non-fmt-panic.rs:42:37 + --> $DIR/non-fmt-panic.rs:43:37 | LL | fancy_panic::fancy_panic!("test {} 123"); | ^^ @@ -256,7 +256,7 @@ LL | fancy_panic::fancy_panic!("test {} 123"); = note: this message is not used as a format string when given without arguments, but will be in Rust 2021 warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:52:12 + --> $DIR/non-fmt-panic.rs:53:12 | LL | panic!(a!()); | ^^^^ @@ -274,7 +274,7 @@ LL + std::panic::panic_any(a!()); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:53:18 + --> $DIR/non-fmt-panic.rs:54:18 | LL | unreachable!(a!()); | ^^^^ @@ -287,7 +287,7 @@ LL | unreachable!("{}", a!()); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:55:12 + --> $DIR/non-fmt-panic.rs:56:12 | LL | panic!(format!("{}", 1)); | ^^^^^^^^^^^^^^^^ @@ -302,7 +302,7 @@ LL + panic!("{}", 1); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:56:18 + --> $DIR/non-fmt-panic.rs:57:18 | LL | unreachable!(format!("{}", 1)); | ^^^^^^^^^^^^^^^^ @@ -317,7 +317,7 @@ LL + unreachable!("{}", 1); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:57:20 + --> $DIR/non-fmt-panic.rs:58:20 | LL | assert!(false, format!("{}", 1)); | ^^^^^^^^^^^^^^^^ @@ -332,7 +332,7 @@ LL + assert!(false, "{}", 1); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:58:26 + --> $DIR/non-fmt-panic.rs:59:26 | LL | debug_assert!(false, format!("{}", 1)); | ^^^^^^^^^^^^^^^^ @@ -347,7 +347,7 @@ LL + debug_assert!(false, "{}", 1); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:60:12 + --> $DIR/non-fmt-panic.rs:61:12 | LL | panic![123]; | ^^^ @@ -365,7 +365,7 @@ LL + std::panic::panic_any(123); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:61:12 + --> $DIR/non-fmt-panic.rs:62:12 | LL | panic!{123}; | ^^^ @@ -383,7 +383,7 @@ LL + std::panic::panic_any(123); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:78:12 + --> $DIR/non-fmt-panic.rs:79:12 | LL | panic!(v); | ------ ^ @@ -394,7 +394,7 @@ LL | panic!(v); = note: for more information, see warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:79:20 + --> $DIR/non-fmt-panic.rs:80:20 | LL | assert!(false, v); | ^ @@ -403,7 +403,7 @@ LL | assert!(false, v); = note: for more information, see warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:83:12 + --> $DIR/non-fmt-panic.rs:84:12 | LL | panic!(v); | ^ @@ -421,7 +421,7 @@ LL + std::panic::panic_any(v); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:84:20 + --> $DIR/non-fmt-panic.rs:85:20 | LL | assert!(false, v); | ^ @@ -434,7 +434,7 @@ LL | assert!(false, "{:?}", v); | +++++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:88:12 + --> $DIR/non-fmt-panic.rs:89:12 | LL | panic!(v); | ^ @@ -452,7 +452,7 @@ LL + std::panic::panic_any(v); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:89:20 + --> $DIR/non-fmt-panic.rs:90:20 | LL | assert!(false, v); | ^ @@ -465,7 +465,7 @@ LL | assert!(false, "{}", v); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:93:12 + --> $DIR/non-fmt-panic.rs:94:12 | LL | panic!(v); | ^ @@ -483,7 +483,7 @@ LL + std::panic::panic_any(v); | warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:94:20 + --> $DIR/non-fmt-panic.rs:95:20 | LL | assert!(false, v); | ^ diff --git a/tests/ui/match/option-result-type-param-mismatch-13466.rs b/tests/ui/match/option-result-type-param-mismatch-13466.rs index 05dbdfdee0e3a..f59cdac9d6652 100644 --- a/tests/ui/match/option-result-type-param-mismatch-13466.rs +++ b/tests/ui/match/option-result-type-param-mismatch-13466.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //! Regression test for https://github.com/rust-lang/rust/issues/13466 // Regression test for #13466 diff --git a/tests/ui/match/option-result-type-param-mismatch-13466.stderr b/tests/ui/match/option-result-type-param-mismatch-13466.stderr index b0cf1591f5eed..9a8158613278f 100644 --- a/tests/ui/match/option-result-type-param-mismatch-13466.stderr +++ b/tests/ui/match/option-result-type-param-mismatch-13466.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/option-result-type-param-mismatch-13466.rs:12:9 + --> $DIR/option-result-type-param-mismatch-13466.rs:13:9 | LL | let _x: usize = match Some(1) { | ------- this expression has type `Option<{integer}>` @@ -10,7 +10,7 @@ LL | Ok(u) => u, found enum `Result<_, _>` error[E0308]: mismatched types - --> $DIR/option-result-type-param-mismatch-13466.rs:18:9 + --> $DIR/option-result-type-param-mismatch-13466.rs:19:9 | LL | let _x: usize = match Some(1) { | ------- this expression has type `Option<{integer}>` diff --git a/tests/ui/methods/missing-method-on-type-parameter.rs b/tests/ui/methods/missing-method-on-type-parameter.rs index cbcbeea4d4cd0..e1cd087208a0a 100644 --- a/tests/ui/methods/missing-method-on-type-parameter.rs +++ b/tests/ui/methods/missing-method-on-type-parameter.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Regression test for https://github.com/rust-lang/rust/issues/129205 fn x() { T::try_from(); //~ ERROR E0599 diff --git a/tests/ui/methods/missing-method-on-type-parameter.stderr b/tests/ui/methods/missing-method-on-type-parameter.stderr index c53d7afe4e2d9..0b58fbfa4af11 100644 --- a/tests/ui/methods/missing-method-on-type-parameter.stderr +++ b/tests/ui/methods/missing-method-on-type-parameter.stderr @@ -1,5 +1,5 @@ error[E0599]: no function or associated item named `try_from` found for type parameter `T` in the current scope - --> $DIR/missing-method-on-type-parameter.rs:3:8 + --> $DIR/missing-method-on-type-parameter.rs:4:8 | LL | fn x() { | - function or associated item `try_from` not found for this type parameter diff --git a/tests/ui/mir/mir_calls_to_shims.rs b/tests/ui/mir/mir_calls_to_shims.rs index 7a5b2182e26d8..9e8dd0c0afbfc 100644 --- a/tests/ui/mir/mir_calls_to_shims.rs +++ b/tests/ui/mir/mir_calls_to_shims.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass //@ needs-unwind diff --git a/tests/ui/never_type/diverging-tuple-parts-39485.rs b/tests/ui/never_type/diverging-tuple-parts-39485.rs index 0cde6119308e5..f8304a692de65 100644 --- a/tests/ui/never_type/diverging-tuple-parts-39485.rs +++ b/tests/ui/never_type/diverging-tuple-parts-39485.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // After #39485, this test used to pass, but that change was reverted // due to numerous inference failures like #39808, so it now fails // again. #39485 made it so that diverging types never propagate diff --git a/tests/ui/never_type/diverging-tuple-parts-39485.stderr b/tests/ui/never_type/diverging-tuple-parts-39485.stderr index ded13e2707f5f..90d0d4260d2dd 100644 --- a/tests/ui/never_type/diverging-tuple-parts-39485.stderr +++ b/tests/ui/never_type/diverging-tuple-parts-39485.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/diverging-tuple-parts-39485.rs:8:5 + --> $DIR/diverging-tuple-parts-39485.rs:9:5 | LL | &panic!() | ^^^^^^^^^ expected `()`, found `&_` @@ -17,7 +17,7 @@ LL + panic!() | error[E0308]: mismatched types - --> $DIR/diverging-tuple-parts-39485.rs:12:5 + --> $DIR/diverging-tuple-parts-39485.rs:13:5 | LL | fn f() -> isize { | ----- expected `isize` because of return type diff --git a/tests/ui/never_type/impl_trait_fallback2.rs b/tests/ui/never_type/impl_trait_fallback2.rs index 399bd72561b41..c7c624bdce6e4 100644 --- a/tests/ui/never_type/impl_trait_fallback2.rs +++ b/tests/ui/never_type/impl_trait_fallback2.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(type_alias_impl_trait)] fn main() {} diff --git a/tests/ui/never_type/impl_trait_fallback2.stderr b/tests/ui/never_type/impl_trait_fallback2.stderr index 0f197aa5cc6fb..ed270988626c4 100644 --- a/tests/ui/never_type/impl_trait_fallback2.stderr +++ b/tests/ui/never_type/impl_trait_fallback2.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): T` is not satisfied - --> $DIR/impl_trait_fallback2.rs:8:25 + --> $DIR/impl_trait_fallback2.rs:9:25 | LL | fn should_ret_unit() -> impl T { | ^^^^^^ the trait `T` is not implemented for `()` @@ -10,7 +10,7 @@ LL | panic!() = help: the trait `T` is implemented for `i32` error[E0277]: the trait bound `(): T` is not satisfied - --> $DIR/impl_trait_fallback2.rs:16:11 + --> $DIR/impl_trait_fallback2.rs:17:11 | LL | fn a() -> Foo { | ^^^ the trait `T` is not implemented for `()` diff --git a/tests/ui/never_type/impl_trait_fallback3.rs b/tests/ui/never_type/impl_trait_fallback3.rs index 3740aad73f0be..03cd6fc25c2b4 100644 --- a/tests/ui/never_type/impl_trait_fallback3.rs +++ b/tests/ui/never_type/impl_trait_fallback3.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(type_alias_impl_trait)] fn main() {} diff --git a/tests/ui/never_type/impl_trait_fallback3.stderr b/tests/ui/never_type/impl_trait_fallback3.stderr index 11425a749534f..259aea18d688d 100644 --- a/tests/ui/never_type/impl_trait_fallback3.stderr +++ b/tests/ui/never_type/impl_trait_fallback3.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): T` is not satisfied - --> $DIR/impl_trait_fallback3.rs:12:11 + --> $DIR/impl_trait_fallback3.rs:13:11 | LL | fn a() -> Foo { | ^^^ the trait `T` is not implemented for `()` @@ -8,7 +8,7 @@ LL | panic!() | -------- return type was inferred to be `_` here | help: this trait has no implementations, consider adding one - --> $DIR/impl_trait_fallback3.rs:5:1 + --> $DIR/impl_trait_fallback3.rs:6:1 | LL | trait T { | ^^^^^^^ diff --git a/tests/ui/never_type/impl_trait_fallback4.rs b/tests/ui/never_type/impl_trait_fallback4.rs index 2fa3d0028be8e..52ddd74f91612 100644 --- a/tests/ui/never_type/impl_trait_fallback4.rs +++ b/tests/ui/never_type/impl_trait_fallback4.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(type_alias_impl_trait)] trait T { diff --git a/tests/ui/never_type/impl_trait_fallback4.stderr b/tests/ui/never_type/impl_trait_fallback4.stderr index c4fc949373ae4..f9de4b6a4944e 100644 --- a/tests/ui/never_type/impl_trait_fallback4.stderr +++ b/tests/ui/never_type/impl_trait_fallback4.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): T` is not satisfied - --> $DIR/impl_trait_fallback4.rs:13:13 + --> $DIR/impl_trait_fallback4.rs:14:13 | LL | fn foo() -> impl T { | ^^^^^^ the trait `T` is not implemented for `()` @@ -8,7 +8,7 @@ LL | panic!() | -------- return type was inferred to be `_` here | help: this trait has no implementations, consider adding one - --> $DIR/impl_trait_fallback4.rs:3:1 + --> $DIR/impl_trait_fallback4.rs:4:1 | LL | trait T { | ^^^^^^^ diff --git a/tests/ui/never_type/issue-5500-1.rs b/tests/ui/never_type/issue-5500-1.rs index 65617e36c6d6d..802bfa5f79bf1 100644 --- a/tests/ui/never_type/issue-5500-1.rs +++ b/tests/ui/never_type/issue-5500-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // MIR doesn't generate an error because the assignment isn't reachable. This // is OK because the test is here to check that the compiler doesn't ICE (cf. // #5500). diff --git a/tests/ui/nll/closure-access-spans.rs b/tests/ui/nll/closure-access-spans.rs index 2a59e80b25cd9..68d1232abb72c 100644 --- a/tests/ui/nll/closure-access-spans.rs +++ b/tests/ui/nll/closure-access-spans.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // check that accesses due to a closure capture give a special note fn closure_imm_capture_conflict(mut x: i32) { diff --git a/tests/ui/nll/closure-access-spans.stderr b/tests/ui/nll/closure-access-spans.stderr index a8024a8c20b9e..dc26ebbcfb190 100644 --- a/tests/ui/nll/closure-access-spans.stderr +++ b/tests/ui/nll/closure-access-spans.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/closure-access-spans.rs:5:5 + --> $DIR/closure-access-spans.rs:6:5 | LL | let r = &mut x; | ------ mutable borrow occurs here @@ -11,7 +11,7 @@ LL | r.use_mut(); | - mutable borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/closure-access-spans.rs:11:5 + --> $DIR/closure-access-spans.rs:12:5 | LL | let r = &mut x; | ------ first mutable borrow occurs here @@ -23,7 +23,7 @@ LL | r.use_mut(); | - first borrow later used here error[E0500]: closure requires unique access to `x` but it is already borrowed - --> $DIR/closure-access-spans.rs:17:5 + --> $DIR/closure-access-spans.rs:18:5 | LL | let r = &mut x; | ------ borrow occurs here @@ -35,7 +35,7 @@ LL | r.use_mut(); | - first borrow later used here error[E0503]: cannot use `x` because it was mutably borrowed - --> $DIR/closure-access-spans.rs:23:13 + --> $DIR/closure-access-spans.rs:24:13 | LL | let r = &mut x; | ------ `x` is borrowed here @@ -45,7 +45,7 @@ LL | r.use_ref(); | - borrow later used here error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/closure-access-spans.rs:29:5 + --> $DIR/closure-access-spans.rs:30:5 | LL | fn closure_move_capture_conflict(mut x: String) { | ----- binding `x` declared here @@ -64,7 +64,7 @@ LL | let r = &x.clone(); | ++++++++ error[E0382]: borrow of moved value: `x` - --> $DIR/closure-access-spans.rs:35:5 + --> $DIR/closure-access-spans.rs:36:5 | LL | fn closure_imm_capture_moved(mut x: String) { | ----- move occurs because `x` has type `String`, which does not implement the `Copy` trait @@ -81,7 +81,7 @@ LL | let r = x.clone(); | ++++++++ error[E0382]: borrow of moved value: `x` - --> $DIR/closure-access-spans.rs:40:5 + --> $DIR/closure-access-spans.rs:41:5 | LL | fn closure_mut_capture_moved(mut x: String) { | ----- move occurs because `x` has type `String`, which does not implement the `Copy` trait @@ -98,7 +98,7 @@ LL | let r = x.clone(); | ++++++++ error[E0382]: borrow of moved value: `x` - --> $DIR/closure-access-spans.rs:45:5 + --> $DIR/closure-access-spans.rs:46:5 | LL | fn closure_unique_capture_moved(x: &mut String) { | - move occurs because `x` has type `&mut String`, which does not implement the `Copy` trait @@ -110,7 +110,7 @@ LL | || *x = String::new(); | value borrowed here after move error[E0382]: use of moved value: `x` - --> $DIR/closure-access-spans.rs:50:5 + --> $DIR/closure-access-spans.rs:51:5 | LL | fn closure_move_capture_moved(x: &mut String) { | - move occurs because `x` has type `&mut String`, which does not implement the `Copy` trait diff --git a/tests/ui/nll/closure-borrow-spans.rs b/tests/ui/nll/closure-borrow-spans.rs index b38f7900e8e5e..2ecab122da662 100644 --- a/tests/ui/nll/closure-borrow-spans.rs +++ b/tests/ui/nll/closure-borrow-spans.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // check that existing borrows due to a closure capture give a special note fn move_while_borrowed(x: String) { diff --git a/tests/ui/nll/closure-borrow-spans.stderr b/tests/ui/nll/closure-borrow-spans.stderr index c466cad25d2e5..8ae792f7030cd 100644 --- a/tests/ui/nll/closure-borrow-spans.stderr +++ b/tests/ui/nll/closure-borrow-spans.stderr @@ -1,5 +1,5 @@ error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:5:13 + --> $DIR/closure-borrow-spans.rs:6:13 | LL | let f = || x.len(); | -- - borrow occurs due to use in closure @@ -11,7 +11,7 @@ LL | f.use_ref(); | - borrow later used here error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable - --> $DIR/closure-borrow-spans.rs:11:13 + --> $DIR/closure-borrow-spans.rs:12:13 | LL | let f = || x; | -- - first borrow occurs due to use of `x` in closure @@ -23,7 +23,7 @@ LL | f.use_ref(); | - immutable borrow later used here error[E0597]: `x` does not live long enough - --> $DIR/closure-borrow-spans.rs:19:16 + --> $DIR/closure-borrow-spans.rs:20:16 | LL | let x = 1; | - binding `x` declared here @@ -37,7 +37,7 @@ LL | f.use_ref(); | - borrow later used here error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:26:5 + --> $DIR/closure-borrow-spans.rs:27:5 | LL | let f = || x; | -- - borrow occurs due to use in closure @@ -49,7 +49,7 @@ LL | f.use_ref(); | - borrow later used here error[E0503]: cannot use `x` because it was mutably borrowed - --> $DIR/closure-borrow-spans.rs:32:13 + --> $DIR/closure-borrow-spans.rs:33:13 | LL | let f = || x = 0; | -- - borrow occurs due to use of `x` in closure @@ -61,7 +61,7 @@ LL | f.use_ref(); | - borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/closure-borrow-spans.rs:38:13 + --> $DIR/closure-borrow-spans.rs:39:13 | LL | let f = || x = 0; | -- - first borrow occurs due to use of `x` in closure @@ -73,7 +73,7 @@ LL | f.use_ref(); | - mutable borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/closure-borrow-spans.rs:44:13 + --> $DIR/closure-borrow-spans.rs:45:13 | LL | let f = || x = 0; | -- - first borrow occurs due to use of `x` in closure @@ -85,7 +85,7 @@ LL | f.use_ref(); | - first borrow later used here error[E0597]: `x` does not live long enough - --> $DIR/closure-borrow-spans.rs:52:16 + --> $DIR/closure-borrow-spans.rs:53:16 | LL | let mut x = 1; | ----- binding `x` declared here @@ -99,7 +99,7 @@ LL | f.use_ref(); | - borrow later used here error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:59:5 + --> $DIR/closure-borrow-spans.rs:60:5 | LL | let f = || x = 0; | -- - borrow occurs due to use in closure @@ -111,7 +111,7 @@ LL | f.use_ref(); | - borrow later used here error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:65:13 + --> $DIR/closure-borrow-spans.rs:66:13 | LL | let f = || *x = 0; | -- -- borrow occurs due to use in closure @@ -123,7 +123,7 @@ LL | f.use_ref(); | - borrow later used here error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access - --> $DIR/closure-borrow-spans.rs:71:13 + --> $DIR/closure-borrow-spans.rs:72:13 | LL | let f = || *x = 0; | -- -- first borrow occurs due to use of `x` in closure @@ -135,7 +135,7 @@ LL | f.use_ref(); | - first borrow later used here error[E0501]: cannot borrow `x` as mutable because previous closure requires unique access - --> $DIR/closure-borrow-spans.rs:77:13 + --> $DIR/closure-borrow-spans.rs:78:13 | LL | let f = || *x = 0; | -- -- first borrow occurs due to use of `x` in closure @@ -147,7 +147,7 @@ LL | f.use_ref(); | - first borrow later used here error[E0597]: `x` does not live long enough - --> $DIR/closure-borrow-spans.rs:86:16 + --> $DIR/closure-borrow-spans.rs:87:16 | LL | let x = &mut z; | - binding `x` declared here @@ -161,7 +161,7 @@ LL | f.use_ref(); | - borrow later used here error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:93:5 + --> $DIR/closure-borrow-spans.rs:94:5 | LL | let f = || *x = 0; | -- -- borrow occurs due to use in closure diff --git a/tests/ui/nll/closure-captures.rs b/tests/ui/nll/closure-captures.rs index 16d90b971745a..4dbd646a4cc40 100644 --- a/tests/ui/nll/closure-captures.rs +++ b/tests/ui/nll/closure-captures.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Some cases with closures that might be problems // Should have one error per assignment diff --git a/tests/ui/nll/closure-captures.stderr b/tests/ui/nll/closure-captures.stderr index 828974c517e60..b10e18a0a28b6 100644 --- a/tests/ui/nll/closure-captures.stderr +++ b/tests/ui/nll/closure-captures.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:7:5 + --> $DIR/closure-captures.rs:8:5 | LL | x = 1; | ^^^^^ cannot assign @@ -10,7 +10,7 @@ LL | fn one_closure(mut x: i32) { | +++ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:9:5 + --> $DIR/closure-captures.rs:10:5 | LL | x = 1; | ^^^^^ cannot assign @@ -21,7 +21,7 @@ LL | fn one_closure(mut x: i32) { | +++ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:15:9 + --> $DIR/closure-captures.rs:16:9 | LL | x = 1; | ^^^^^ cannot assign @@ -32,7 +32,7 @@ LL | fn two_closures(mut x: i32) { | +++ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:19:9 + --> $DIR/closure-captures.rs:20:9 | LL | x = 1; | ^^^^^ cannot assign @@ -43,7 +43,7 @@ LL | fn two_closures(mut x: i32) { | +++ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:27:9 + --> $DIR/closure-captures.rs:28:9 | LL | fn fn_ref(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` @@ -58,7 +58,7 @@ LL | x = 1;} | - mutable borrow occurs due to use of `x` in closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:31:9 + --> $DIR/closure-captures.rs:32:9 | LL | fn fn_ref(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` @@ -73,7 +73,7 @@ LL | x = 1;}); | - mutable borrow occurs due to use of `x` in closure error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:39:10 + --> $DIR/closure-captures.rs:40:10 | LL | x = 1;} | ^^^^^ cannot assign @@ -84,7 +84,7 @@ LL | fn two_closures_ref(mut x: i32) { | +++ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:38:9 + --> $DIR/closure-captures.rs:39:9 | LL | fn fn_ref(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` @@ -99,7 +99,7 @@ LL | x = 1;} | - mutable borrow occurs due to use of `x` in closure error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:43:5 + --> $DIR/closure-captures.rs:44:5 | LL | x = 1;}); | ^^^^^ cannot assign @@ -110,7 +110,7 @@ LL | fn two_closures_ref(mut x: i32) { | +++ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:42:9 + --> $DIR/closure-captures.rs:43:9 | LL | fn fn_ref(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` @@ -125,7 +125,7 @@ LL | x = 1;}); | - mutable borrow occurs due to use of `x` in closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:48:9 + --> $DIR/closure-captures.rs:49:9 | LL | fn fn_ref(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` @@ -140,7 +140,7 @@ LL | *x = 1;}); | -- mutable borrow occurs due to use of `x` in closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:51:9 + --> $DIR/closure-captures.rs:52:9 | LL | fn fn_ref(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` diff --git a/tests/ui/nll/closures-in-loops.rs b/tests/ui/nll/closures-in-loops.rs index 491c186ecb5a0..bf7b7bc8a70c8 100644 --- a/tests/ui/nll/closures-in-loops.rs +++ b/tests/ui/nll/closures-in-loops.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Test messages where a closure capture conflicts with itself because it's in // a loop. diff --git a/tests/ui/nll/closures-in-loops.stderr b/tests/ui/nll/closures-in-loops.stderr index 050b220e62638..8d832e29a23d7 100644 --- a/tests/ui/nll/closures-in-loops.stderr +++ b/tests/ui/nll/closures-in-loops.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `x` - --> $DIR/closures-in-loops.rs:6:9 + --> $DIR/closures-in-loops.rs:7:9 | LL | fn repreated_move(x: String) { | - move occurs because `x` has type `String`, which does not implement the `Copy` trait @@ -16,7 +16,7 @@ LL | || x.clone(); | ++++++++ error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/closures-in-loops.rs:13:16 + --> $DIR/closures-in-loops.rs:14:16 | LL | v.push(|| x = String::new()); | - ^^ - borrows occur due to use of `x` in closure @@ -25,7 +25,7 @@ LL | v.push(|| x = String::new()); | first borrow used here, in later iteration of loop error[E0524]: two closures require unique access to `x` at the same time - --> $DIR/closures-in-loops.rs:20:16 + --> $DIR/closures-in-loops.rs:21:16 | LL | v.push(|| *x = String::new()); | - ^^ -- borrows occur due to use of `x` in closure diff --git a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.rs b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.rs index d17d6f07f6870..156ec9e78f5c1 100644 --- a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.rs +++ b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // This is testing an attempt to corrupt the discriminant of the match // arm in a guard, followed by an attempt to continue matching on that // corrupted discriminant in the remaining match arms. diff --git a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.stderr b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.stderr index a37639883d2b1..9ca85a7351295 100644 --- a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.stderr +++ b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-1.stderr @@ -1,5 +1,5 @@ error[E0510]: cannot mutably borrow `x` in match guard - --> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:21:14 + --> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:22:14 | LL | match x { | - value is immutable in match guard diff --git a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.rs b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.rs index 9c3e7e9978ec7..cbb00daa8c39d 100644 --- a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.rs +++ b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // This is testing an attempt to corrupt the discriminant of the match // arm in a guard, followed by an attempt to continue matching on that // corrupted discriminant in the remaining match arms. diff --git a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.stderr b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.stderr index 5cd0982526b3a..900ae8f8ab536 100644 --- a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.stderr +++ b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-2.stderr @@ -1,5 +1,5 @@ error[E0510]: cannot mutably borrow `x` in match guard - --> $DIR/issue-27282-mutate-before-diverging-arm-2.rs:26:18 + --> $DIR/issue-27282-mutate-before-diverging-arm-2.rs:27:18 | LL | match x { | - value is immutable in match guard diff --git a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.rs b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.rs index cff9e963e2725..e7a9ab659f1bf 100644 --- a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.rs +++ b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // This is testing an attempt to corrupt the discriminant of the match // arm in a guard, followed by an attempt to continue matching on that // corrupted discriminant in the remaining match arms. diff --git a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.stderr b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.stderr index e4d0cf3111272..e81b8b1004cc3 100644 --- a/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.stderr +++ b/tests/ui/nll/issue-27282-mutate-before-diverging-arm-3.stderr @@ -1,5 +1,5 @@ error[E0510]: cannot mutably borrow `x` in match guard - --> $DIR/issue-27282-mutate-before-diverging-arm-3.rs:20:14 + --> $DIR/issue-27282-mutate-before-diverging-arm-3.rs:21:14 | LL | match **x { | --- value is immutable in match guard diff --git a/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.rs b/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.rs index ac06b2b01028f..b5e7bd193608a 100644 --- a/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.rs +++ b/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Issue 27282: This is a variation on issue-27282-move-ref-mut-into-guard.rs // // It reborrows instead of moving the `ref mut` pattern borrow. This diff --git a/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.stderr b/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.stderr index 5eb7a25bf9f50..59ef7469655a8 100644 --- a/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.stderr +++ b/tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow `r` as mutable, as it is immutable for the pattern guard - --> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:14:25 + --> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:15:25 | LL | ref mut r if { (|| { let bar = &mut *r; **bar = false; })(); | ^^ -- mutable borrow occurs due to use of `r` in closure @@ -9,7 +9,7 @@ LL | ref mut r if { (|| { let bar = &mut *r; **bar = false; })(); = note: variables bound in patterns are immutable until the end of the pattern guard error[E0596]: cannot borrow `r` as mutable, as it is immutable for the pattern guard - --> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:24:40 + --> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:25:40 | LL | ref mut r if let Some(()) = { (|| { let bar = &mut *r; **bar = false; })(); | ^^ -- mutable borrow occurs due to use of `r` in closure diff --git a/tests/ui/nll/issue-27583.rs b/tests/ui/nll/issue-27583.rs index cdf0bd3647d9e..ac5e812ed0799 100644 --- a/tests/ui/nll/issue-27583.rs +++ b/tests/ui/nll/issue-27583.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ check-pass // Regression test for issue #27583. Unclear how useful this will be // going forward, since the issue in question was EXTREMELY sensitive diff --git a/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.rs b/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.rs index 0ec0179e846f4..35d14b98a6acc 100644 --- a/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.rs +++ b/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // This test illustrates a case where full NLL (enabled by the feature // switch below) produces superior diagnostics to the NLL-migrate // mode. diff --git a/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr b/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr index e3f44467550cd..d3aaf9cc9a6a9 100644 --- a/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr +++ b/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:6:8 + --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:7:8 | LL | || doit(data); | -- ^^^^^^^^^^ argument requires that `'1` must outlive `'static` @@ -9,7 +9,7 @@ LL | || doit(data); = note: closure implements `FnMut`, so references to captured variables can't escape the closure error[E0597]: `data` does not live long enough - --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:6:13 + --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:7:13 | LL | fn doit(data: &'static mut ()) { | ---- binding `data` declared here diff --git a/tests/ui/nll/issue-51268.rs b/tests/ui/nll/issue-51268.rs index dcdedf7d4c513..b8d5e65c52603 100644 --- a/tests/ui/nll/issue-51268.rs +++ b/tests/ui/nll/issue-51268.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 struct Bar; impl Bar { diff --git a/tests/ui/nll/issue-51268.stderr b/tests/ui/nll/issue-51268.stderr index b0c3d8b878d33..6c2f64de62e89 100644 --- a/tests/ui/nll/issue-51268.stderr +++ b/tests/ui/nll/issue-51268.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `self.thing` as mutable because it is also borrowed as immutable - --> $DIR/issue-51268.rs:14:9 + --> $DIR/issue-51268.rs:15:9 | LL | self.thing.bar(|| { | ^ --- -- immutable borrow occurs here diff --git a/tests/ui/nll/issue-52663-span-decl-captured-variable.rs b/tests/ui/nll/issue-52663-span-decl-captured-variable.rs index cd1f457a13064..19a08472c0aaa 100644 --- a/tests/ui/nll/issue-52663-span-decl-captured-variable.rs +++ b/tests/ui/nll/issue-52663-span-decl-captured-variable.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn expect_fn(f: F) where F : Fn() { f(); } diff --git a/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr b/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr index 4749e3b8e453d..0cebd07d8665d 100644 --- a/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr +++ b/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure - --> $DIR/issue-52663-span-decl-captured-variable.rs:8:26 + --> $DIR/issue-52663-span-decl-captured-variable.rs:9:26 | LL | let x = (vec![22], vec![44]); | - -------------------- move occurs because `x.0` has type `Vec`, which does not implement the `Copy` trait @@ -11,7 +11,7 @@ LL | expect_fn(|| drop(x.0)); | captured by this `Fn` closure | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/issue-52663-span-decl-captured-variable.rs:1:33 + --> $DIR/issue-52663-span-decl-captured-variable.rs:2:33 | LL | fn expect_fn(f: F) where F : Fn() { | ^^^^ diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs index 9c0785cc96403..a379b5f9c26e1 100644 --- a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs +++ b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags:-Zverbose-internals #![allow(warnings)] diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index 3468c5ad37298..7dc5ef155cdf1 100644 --- a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -1,5 +1,5 @@ note: external requirements - --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23 + --> $DIR/ty-param-closure-outlives-from-return-type.rs:27:23 | LL | with_signature(x, |y| y) | ^^^ @@ -13,7 +13,7 @@ LL | with_signature(x, |y| y) = note: where T: '?2 note: no external requirements - --> $DIR/ty-param-closure-outlives-from-return-type.rs:15:1 + --> $DIR/ty-param-closure-outlives-from-return-type.rs:16:1 | LL | / fn no_region<'a, T>(x: Box) -> Box LL | | where @@ -23,7 +23,7 @@ LL | | T: Debug, = note: defining type: no_region::<'?1, T> error[E0309]: the parameter type `T` may not live long enough - --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:27 + --> $DIR/ty-param-closure-outlives-from-return-type.rs:27:27 | LL | fn no_region<'a, T>(x: Box) -> Box | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... @@ -37,7 +37,7 @@ LL | T: Debug + 'a, | ++++ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5 + --> $DIR/ty-param-closure-outlives-from-return-type.rs:42:5 | LL | fn wrong_region<'a, 'b, T>(x: Box) -> Box | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... diff --git a/tests/ui/nll/ty-outlives/ty-param-fn.rs b/tests/ui/nll/ty-outlives/ty-param-fn.rs index 4393a3b41697f..ba70f29a6509a 100644 --- a/tests/ui/nll/ty-outlives/ty-param-fn.rs +++ b/tests/ui/nll/ty-outlives/ty-param-fn.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(warnings)] use std::fmt::Debug; diff --git a/tests/ui/nll/ty-outlives/ty-param-fn.stderr b/tests/ui/nll/ty-outlives/ty-param-fn.stderr index 56bd41051e276..3bb9af5c64013 100644 --- a/tests/ui/nll/ty-outlives/ty-param-fn.stderr +++ b/tests/ui/nll/ty-outlives/ty-param-fn.stderr @@ -1,5 +1,5 @@ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/ty-param-fn.rs:9:5 + --> $DIR/ty-param-fn.rs:10:5 | LL | fn no_region<'a, T>(x: Box) -> Box | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... @@ -13,7 +13,7 @@ LL | T: Debug + 'a, | ++++ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/ty-param-fn.rs:24:5 + --> $DIR/ty-param-fn.rs:25:5 | LL | fn wrong_region<'a, 'b, T>(x: Box) -> Box | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... diff --git a/tests/ui/or-patterns/binding-typo-2.rs b/tests/ui/or-patterns/binding-typo-2.rs index 275b68a22e22f..882cb6eb7c011 100644 --- a/tests/ui/or-patterns/binding-typo-2.rs +++ b/tests/ui/or-patterns/binding-typo-2.rs @@ -63,8 +63,8 @@ fn foo(x: (Lol, Lol)) { } fn bar(x: (Lol, Lol)) { use Lol::*; - use ::Bat; - use ::Bay; + use crate::Bat; + use crate::Bay; match &x { (Foo, _) | (Ban, Foo) => {} //~^ ERROR: variable `Ban` is not bound in all patterns diff --git a/tests/ui/panics/explicit-panic-msg.rs b/tests/ui/panics/explicit-panic-msg.rs index e5728ef1e20c5..7d1afcccaaba8 100644 --- a/tests/ui/panics/explicit-panic-msg.rs +++ b/tests/ui/panics/explicit-panic-msg.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(unused_assignments)] #![allow(unused_variables)] #![allow(non_fmt_panics)] diff --git a/tests/ui/panics/issue-47429-short-backtraces.rs b/tests/ui/panics/issue-47429-short-backtraces.rs index 21428d876e227..b276541d2ed8d 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.rs +++ b/tests/ui/panics/issue-47429-short-backtraces.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Regression test for #47429: short backtraces were not terminating correctly //@ compile-flags: -O diff --git a/tests/ui/panics/issue-47429-short-backtraces.run.stderr b/tests/ui/panics/issue-47429-short-backtraces.run.stderr index 32aa6a3502ee0..49a1ecc455b65 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.run.stderr +++ b/tests/ui/panics/issue-47429-short-backtraces.run.stderr @@ -1,5 +1,5 @@ -thread 'main' ($TID) panicked at $DIR/issue-47429-short-backtraces.rs:27:5: +thread 'main' ($TID) panicked at $DIR/issue-47429-short-backtraces.rs:28:5: explicit panic stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/panics/panic-macro-any-wrapped.rs b/tests/ui/panics/panic-macro-any-wrapped.rs index e3a2dc6eed42e..53fa41b706c7f 100644 --- a/tests/ui/panics/panic-macro-any-wrapped.rs +++ b/tests/ui/panics/panic-macro-any-wrapped.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-fail //@ error-pattern:panicked //@ error-pattern:Box diff --git a/tests/ui/panics/panic-macro-any.rs b/tests/ui/panics/panic-macro-any.rs index 1392929b65c2e..2b706b0111a9d 100644 --- a/tests/ui/panics/panic-macro-any.rs +++ b/tests/ui/panics/panic-macro-any.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-fail //@ error-pattern:panicked //@ error-pattern:Box diff --git a/tests/ui/panics/runtime-switch.rs b/tests/ui/panics/runtime-switch.rs index 61c07a97c7008..a3003d0503945 100644 --- a/tests/ui/panics/runtime-switch.rs +++ b/tests/ui/panics/runtime-switch.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Test for std::panic::set_backtrace_style. //@ compile-flags: -O diff --git a/tests/ui/panics/runtime-switch.run.stderr b/tests/ui/panics/runtime-switch.run.stderr index 48a12b59b69b3..7876f84495432 100644 --- a/tests/ui/panics/runtime-switch.run.stderr +++ b/tests/ui/panics/runtime-switch.run.stderr @@ -1,5 +1,5 @@ -thread 'main' ($TID) panicked at $DIR/runtime-switch.rs:31:5: +thread 'main' ($TID) panicked at $DIR/runtime-switch.rs:32:5: explicit panic stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.rs b/tests/ui/panics/short-ice-remove-middle-frames-2.rs index 660530f0eada8..28556304be622 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.rs +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags:-Cstrip=none //@ run-fail //@ check-run-results diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr index 584b477f3a7c1..79ae85ab95a4e 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr @@ -1,5 +1,5 @@ -thread 'main' ($TID) panicked at $DIR/short-ice-remove-middle-frames-2.rs:62:5: +thread 'main' ($TID) panicked at $DIR/short-ice-remove-middle-frames-2.rs:63:5: debug!!! stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/panics/short-ice-remove-middle-frames.rs b/tests/ui/panics/short-ice-remove-middle-frames.rs index 41fb6e9950e6c..0468bffbe4446 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.rs +++ b/tests/ui/panics/short-ice-remove-middle-frames.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags:-Cstrip=none //@ run-fail //@ check-run-results diff --git a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr index 1efcb7d530409..fc1ccffbf2b4a 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr @@ -1,5 +1,5 @@ -thread 'main' ($TID) panicked at $DIR/short-ice-remove-middle-frames.rs:58:5: +thread 'main' ($TID) panicked at $DIR/short-ice-remove-middle-frames.rs:59:5: debug!!! stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs index 1380974538a50..18f7b80fc9cea 100644 --- a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs +++ b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() {} #[cfg(false)] fn e() { let _ = [#[attr]]; } diff --git a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr index 5d94a8dcbdb81..86ef1ca681cf7 100644 --- a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr +++ b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr @@ -1,17 +1,17 @@ error: expected expression, found `]` - --> $DIR/attr-stmt-expr-attr-bad.rs:3:40 + --> $DIR/attr-stmt-expr-attr-bad.rs:4:40 | LL | #[cfg(false)] fn e() { let _ = [#[attr]]; } | ^ expected expression error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:5:35 + --> $DIR/attr-stmt-expr-attr-bad.rs:6:35 | LL | #[cfg(false)] fn e() { let _ = foo#[attr](); } | ^ expected one of 8 possible tokens error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:7:36 + --> $DIR/attr-stmt-expr-attr-bad.rs:8:36 | LL | #[cfg(false)] fn e() { let _ = foo(#![attr]); } | ^^^^^^^^ @@ -20,7 +20,7 @@ LL | #[cfg(false)] fn e() { let _ = foo(#![attr]); } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:7:36 + --> $DIR/attr-stmt-expr-attr-bad.rs:8:36 | LL | #[cfg(false)] fn e() { let _ = foo(#![attr]); } | ^^^^^^^^ @@ -30,13 +30,13 @@ LL | #[cfg(false)] fn e() { let _ = foo(#![attr]); } = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: expected expression, found `)` - --> $DIR/attr-stmt-expr-attr-bad.rs:7:44 + --> $DIR/attr-stmt-expr-attr-bad.rs:8:44 | LL | #[cfg(false)] fn e() { let _ = foo(#![attr]); } | ^ expected expression error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:11:38 + --> $DIR/attr-stmt-expr-attr-bad.rs:12:38 | LL | #[cfg(false)] fn e() { let _ = x.foo(#![attr]); } | ^^^^^^^^ @@ -45,13 +45,13 @@ LL | #[cfg(false)] fn e() { let _ = x.foo(#![attr]); } = note: outer attributes, like `#[test]`, annotate the item following them error: expected expression, found `)` - --> $DIR/attr-stmt-expr-attr-bad.rs:11:46 + --> $DIR/attr-stmt-expr-attr-bad.rs:12:46 | LL | #[cfg(false)] fn e() { let _ = x.foo(#![attr]); } | ^ expected expression error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:14:36 + --> $DIR/attr-stmt-expr-attr-bad.rs:15:36 | LL | #[cfg(false)] fn e() { let _ = 0 + #![attr] 0; } | ^^^^^^^^ @@ -60,7 +60,7 @@ LL | #[cfg(false)] fn e() { let _ = 0 + #![attr] 0; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:16:33 + --> $DIR/attr-stmt-expr-attr-bad.rs:17:33 | LL | #[cfg(false)] fn e() { let _ = !#![attr] 0; } | ^^^^^^^^ @@ -69,7 +69,7 @@ LL | #[cfg(false)] fn e() { let _ = !#![attr] 0; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:18:33 + --> $DIR/attr-stmt-expr-attr-bad.rs:19:33 | LL | #[cfg(false)] fn e() { let _ = -#![attr] 0; } | ^^^^^^^^ @@ -78,13 +78,13 @@ LL | #[cfg(false)] fn e() { let _ = -#![attr] 0; } = note: outer attributes, like `#[test]`, annotate the item following them error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:20:34 + --> $DIR/attr-stmt-expr-attr-bad.rs:21:34 | LL | #[cfg(false)] fn e() { let _ = x #![attr] as Y; } | ^ expected one of 8 possible tokens error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:22:35 + --> $DIR/attr-stmt-expr-attr-bad.rs:23:35 | LL | #[cfg(false)] fn e() { let _ = || #![attr] foo; } | ^^^^^^^^ @@ -93,7 +93,7 @@ LL | #[cfg(false)] fn e() { let _ = || #![attr] foo; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:24:40 + --> $DIR/attr-stmt-expr-attr-bad.rs:25:40 | LL | #[cfg(false)] fn e() { let _ = move || #![attr] foo; } | ^^^^^^^^ @@ -102,7 +102,7 @@ LL | #[cfg(false)] fn e() { let _ = move || #![attr] foo; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:26:35 + --> $DIR/attr-stmt-expr-attr-bad.rs:27:35 | LL | #[cfg(false)] fn e() { let _ = || #![attr] {foo}; } | ^^^^^^^^ @@ -111,7 +111,7 @@ LL | #[cfg(false)] fn e() { let _ = || #![attr] {foo}; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:28:40 + --> $DIR/attr-stmt-expr-attr-bad.rs:29:40 | LL | #[cfg(false)] fn e() { let _ = move || #![attr] {foo}; } | ^^^^^^^^ @@ -120,19 +120,19 @@ LL | #[cfg(false)] fn e() { let _ = move || #![attr] {foo}; } = note: outer attributes, like `#[test]`, annotate the item following them error: attributes are not allowed on range expressions starting with `..` - --> $DIR/attr-stmt-expr-attr-bad.rs:30:40 + --> $DIR/attr-stmt-expr-attr-bad.rs:31:40 | LL | #[cfg(false)] fn e() { let _ = #[attr] ..#[attr] 0; } | ^^ error: attributes are not allowed on range expressions starting with `..` - --> $DIR/attr-stmt-expr-attr-bad.rs:32:40 + --> $DIR/attr-stmt-expr-attr-bad.rs:33:40 | LL | #[cfg(false)] fn e() { let _ = #[attr] ..; } | ^^ error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:34:41 + --> $DIR/attr-stmt-expr-attr-bad.rs:35:41 | LL | #[cfg(false)] fn e() { let _ = #[attr] &#![attr] 0; } | ^^^^^^^^ @@ -141,7 +141,7 @@ LL | #[cfg(false)] fn e() { let _ = #[attr] &#![attr] 0; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:36:45 + --> $DIR/attr-stmt-expr-attr-bad.rs:37:45 | LL | #[cfg(false)] fn e() { let _ = #[attr] &mut #![attr] 0; } | ^^^^^^^^ @@ -150,7 +150,7 @@ LL | #[cfg(false)] fn e() { let _ = #[attr] &mut #![attr] 0; } = note: outer attributes, like `#[test]`, annotate the item following them error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:38:37 + --> $DIR/attr-stmt-expr-attr-bad.rs:39:37 | LL | #[cfg(false)] fn e() { let _ = if 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch @@ -164,7 +164,7 @@ LL + #[cfg(false)] fn e() { let _ = if 0 {}; } | error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:40:38 + --> $DIR/attr-stmt-expr-attr-bad.rs:41:38 | LL | #[cfg(false)] fn e() { let _ = if 0 {#![attr]}; } | ^^^^^^^^ @@ -173,13 +173,13 @@ LL | #[cfg(false)] fn e() { let _ = if 0 {#![attr]}; } = note: outer attributes, like `#[test]`, annotate the item following them error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:42:40 + --> $DIR/attr-stmt-expr-attr-bad.rs:43:40 | LL | #[cfg(false)] fn e() { let _ = if 0 {} #[attr] else {}; } | ^ expected one of `.`, `;`, `?`, `else`, or an operator error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:44:45 + --> $DIR/attr-stmt-expr-attr-bad.rs:45:45 | LL | #[cfg(false)] fn e() { let _ = if 0 {} else #[attr] {}; } | ---- ^^^^^^^ -- the attributes are attached to this branch @@ -193,7 +193,7 @@ LL + #[cfg(false)] fn e() { let _ = if 0 {} else {}; } | error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:46:46 + --> $DIR/attr-stmt-expr-attr-bad.rs:47:46 | LL | #[cfg(false)] fn e() { let _ = if 0 {} else {#![attr]}; } | ^^^^^^^^ @@ -202,7 +202,7 @@ LL | #[cfg(false)] fn e() { let _ = if 0 {} else {#![attr]}; } = note: outer attributes, like `#[test]`, annotate the item following them error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:48:45 + --> $DIR/attr-stmt-expr-attr-bad.rs:49:45 | LL | #[cfg(false)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; } | ---- ^^^^^^^ ------- the attributes are attached to this branch @@ -216,7 +216,7 @@ LL + #[cfg(false)] fn e() { let _ = if 0 {} else if 0 {}; } | error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:50:50 + --> $DIR/attr-stmt-expr-attr-bad.rs:51:50 | LL | #[cfg(false)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch @@ -230,7 +230,7 @@ LL + #[cfg(false)] fn e() { let _ = if 0 {} else if 0 {}; } | error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:52:51 + --> $DIR/attr-stmt-expr-attr-bad.rs:53:51 | LL | #[cfg(false)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; } | ^^^^^^^^ @@ -239,7 +239,7 @@ LL | #[cfg(false)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; } = note: outer attributes, like `#[test]`, annotate the item following them error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:54:45 + --> $DIR/attr-stmt-expr-attr-bad.rs:55:45 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch @@ -253,7 +253,7 @@ LL + #[cfg(false)] fn e() { let _ = if let _ = 0 {}; } | error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:56:46 + --> $DIR/attr-stmt-expr-attr-bad.rs:57:46 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {#![attr]}; } | ^^^^^^^^ @@ -262,13 +262,13 @@ LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {#![attr]}; } = note: outer attributes, like `#[test]`, annotate the item following them error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:58:48 + --> $DIR/attr-stmt-expr-attr-bad.rs:59:48 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} #[attr] else {}; } | ^ expected one of `.`, `;`, `?`, `else`, or an operator error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:60:53 + --> $DIR/attr-stmt-expr-attr-bad.rs:61:53 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; } | ---- ^^^^^^^ -- the attributes are attached to this branch @@ -282,7 +282,7 @@ LL + #[cfg(false)] fn e() { let _ = if let _ = 0 {} else {}; } | error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:62:54 + --> $DIR/attr-stmt-expr-attr-bad.rs:63:54 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; } | ^^^^^^^^ @@ -291,7 +291,7 @@ LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; } = note: outer attributes, like `#[test]`, annotate the item following them error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:64:53 + --> $DIR/attr-stmt-expr-attr-bad.rs:65:53 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; } | ---- ^^^^^^^ --------------- the attributes are attached to this branch @@ -305,7 +305,7 @@ LL + #[cfg(false)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; } | error: outer attributes are not allowed on `if` and `else` branches - --> $DIR/attr-stmt-expr-attr-bad.rs:66:66 + --> $DIR/attr-stmt-expr-attr-bad.rs:67:66 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; } | -- ^^^^^^^ -- the attributes are attached to this branch @@ -319,7 +319,7 @@ LL + #[cfg(false)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; } | error: an inner attribute is not permitted in this context - --> $DIR/attr-stmt-expr-attr-bad.rs:68:67 + --> $DIR/attr-stmt-expr-attr-bad.rs:69:67 | LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}; } | ^^^^^^^^ @@ -328,7 +328,7 @@ LL | #[cfg(false)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]} = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted following an outer attribute - --> $DIR/attr-stmt-expr-attr-bad.rs:71:32 + --> $DIR/attr-stmt-expr-attr-bad.rs:72:32 | LL | #[cfg(false)] fn s() { #[attr] #![attr] let _ = 0; } | ------- ^^^^^^^^ not permitted following an outer attribute @@ -339,7 +339,7 @@ LL | #[cfg(false)] fn s() { #[attr] #![attr] let _ = 0; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted following an outer attribute - --> $DIR/attr-stmt-expr-attr-bad.rs:73:32 + --> $DIR/attr-stmt-expr-attr-bad.rs:74:32 | LL | #[cfg(false)] fn s() { #[attr] #![attr] 0; } | ------- ^^^^^^^^ not permitted following an outer attribute @@ -350,7 +350,7 @@ LL | #[cfg(false)] fn s() { #[attr] #![attr] 0; } = note: outer attributes, like `#[test]`, annotate the item following them error: an inner attribute is not permitted following an outer attribute - --> $DIR/attr-stmt-expr-attr-bad.rs:75:32 + --> $DIR/attr-stmt-expr-attr-bad.rs:76:32 | LL | #[cfg(false)] fn s() { #[attr] #![attr] foo!(); } | ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation @@ -361,7 +361,7 @@ LL | #[cfg(false)] fn s() { #[attr] #![attr] foo!(); } = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files error: an inner attribute is not permitted following an outer attribute - --> $DIR/attr-stmt-expr-attr-bad.rs:77:32 + --> $DIR/attr-stmt-expr-attr-bad.rs:78:32 | LL | #[cfg(false)] fn s() { #[attr] #![attr] foo![]; } | ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation @@ -372,7 +372,7 @@ LL | #[cfg(false)] fn s() { #[attr] #![attr] foo![]; } = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files error: an inner attribute is not permitted following an outer attribute - --> $DIR/attr-stmt-expr-attr-bad.rs:79:32 + --> $DIR/attr-stmt-expr-attr-bad.rs:80:32 | LL | #[cfg(false)] fn s() { #[attr] #![attr] foo!{}; } | ------- ^^^^^^^^ ------ the inner attribute doesn't annotate this item macro invocation @@ -383,7 +383,7 @@ LL | #[cfg(false)] fn s() { #[attr] #![attr] foo!{}; } = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files error[E0586]: inclusive range with no end - --> $DIR/attr-stmt-expr-attr-bad.rs:85:35 + --> $DIR/attr-stmt-expr-attr-bad.rs:86:35 | LL | #[cfg(false)] fn e() { match 0 { 0..=#[attr] 10 => () } } | ^^^ @@ -396,13 +396,13 @@ LL + #[cfg(false)] fn e() { match 0 { 0..#[attr] 10 => () } } | error: expected one of `=>`, `if`, or `|`, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:85:38 + --> $DIR/attr-stmt-expr-attr-bad.rs:86:38 | LL | #[cfg(false)] fn e() { match 0 { 0..=#[attr] 10 => () } } | ^ expected one of `=>`, `if`, or `|` error[E0586]: inclusive range with no end - --> $DIR/attr-stmt-expr-attr-bad.rs:88:35 + --> $DIR/attr-stmt-expr-attr-bad.rs:89:35 | LL | #[cfg(false)] fn e() { match 0 { 0..=#[attr] -10 => () } } | ^^^ @@ -415,19 +415,19 @@ LL + #[cfg(false)] fn e() { match 0 { 0..#[attr] -10 => () } } | error: expected one of `=>`, `if`, or `|`, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:88:38 + --> $DIR/attr-stmt-expr-attr-bad.rs:89:38 | LL | #[cfg(false)] fn e() { match 0 { 0..=#[attr] -10 => () } } | ^ expected one of `=>`, `if`, or `|` error: unexpected token: `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:91:39 + --> $DIR/attr-stmt-expr-attr-bad.rs:92:39 | LL | #[cfg(false)] fn e() { match 0 { 0..=-#[attr] 10 => () } } | ^ error[E0586]: inclusive range with no end - --> $DIR/attr-stmt-expr-attr-bad.rs:93:35 + --> $DIR/attr-stmt-expr-attr-bad.rs:94:35 | LL | #[cfg(false)] fn e() { match 0 { 0..=#[attr] FOO => () } } | ^^^ @@ -440,43 +440,43 @@ LL + #[cfg(false)] fn e() { match 0 { 0..#[attr] FOO => () } } | error: expected one of `=>`, `if`, or `|`, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:93:38 + --> $DIR/attr-stmt-expr-attr-bad.rs:94:38 | LL | #[cfg(false)] fn e() { match 0 { 0..=#[attr] FOO => () } } | ^ expected one of `=>`, `if`, or `|` error: unexpected token: `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:97:34 + --> $DIR/attr-stmt-expr-attr-bad.rs:98:34 | LL | #[cfg(false)] fn e() { let _ = x.#![attr]foo(); } | ^ error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:97:34 + --> $DIR/attr-stmt-expr-attr-bad.rs:98:34 | LL | #[cfg(false)] fn e() { let _ = x.#![attr]foo(); } | ^ expected one of `.`, `;`, `?`, `else`, or an operator error: unexpected token: `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:100:34 + --> $DIR/attr-stmt-expr-attr-bad.rs:101:34 | LL | #[cfg(false)] fn e() { let _ = x.#[attr]foo(); } | ^ error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#` - --> $DIR/attr-stmt-expr-attr-bad.rs:100:34 + --> $DIR/attr-stmt-expr-attr-bad.rs:101:34 | LL | #[cfg(false)] fn e() { let _ = x.#[attr]foo(); } | ^ expected one of `.`, `;`, `?`, `else`, or an operator error: expected statement after outer attribute - --> $DIR/attr-stmt-expr-attr-bad.rs:105:37 + --> $DIR/attr-stmt-expr-attr-bad.rs:106:37 | LL | #[cfg(false)] fn e() { { fn foo() { #[attr]; } } } | ^^^^^^^ error: expected statement after outer attribute - --> $DIR/attr-stmt-expr-attr-bad.rs:107:37 + --> $DIR/attr-stmt-expr-attr-bad.rs:108:37 | LL | #[cfg(false)] fn e() { { fn foo() { #[attr] } } } | ^^^^^^^ diff --git a/tests/ui/parser/help-set-edition-ice-122130.rs b/tests/ui/parser/help-set-edition-ice-122130.rs index bc5af04ecbc0c..97dc1cff22883 100644 --- a/tests/ui/parser/help-set-edition-ice-122130.rs +++ b/tests/ui/parser/help-set-edition-ice-122130.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 enum will { s#[c"owned_box"] //~^ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `#` diff --git a/tests/ui/parser/help-set-edition-ice-122130.stderr b/tests/ui/parser/help-set-edition-ice-122130.stderr index 700b1ec911b30..73aff965b88dc 100644 --- a/tests/ui/parser/help-set-edition-ice-122130.stderr +++ b/tests/ui/parser/help-set-edition-ice-122130.stderr @@ -1,5 +1,5 @@ error: expected one of `(`, `,`, `=`, `{`, or `}`, found `#` - --> $DIR/help-set-edition-ice-122130.rs:2:6 + --> $DIR/help-set-edition-ice-122130.rs:3:6 | LL | s#[c"owned_box"] | ^ expected one of `(`, `,`, `=`, `{`, or `}` @@ -10,7 +10,7 @@ LL | s#[c"owned_box"] = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected item, found `"owned_box"` - --> $DIR/help-set-edition-ice-122130.rs:2:9 + --> $DIR/help-set-edition-ice-122130.rs:3:9 | LL | s#[c"owned_box"] | ^^^^^^^^^^^ expected item diff --git a/tests/ui/parser/issues/issue-63115-range-pat-interpolated.rs b/tests/ui/parser/issues/issue-63115-range-pat-interpolated.rs index 9a6bd4442e563..447149ed419dc 100644 --- a/tests/ui/parser/issues/issue-63115-range-pat-interpolated.rs +++ b/tests/ui/parser/issues/issue-63115-range-pat-interpolated.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ check-pass #![allow(ellipsis_inclusive_range_patterns)] diff --git a/tests/ui/parser/trait-object-bad-parens.rs b/tests/ui/parser/trait-object-bad-parens.rs index bb047a4b43142..c53e52f2eca33 100644 --- a/tests/ui/parser/trait-object-bad-parens.rs +++ b/tests/ui/parser/trait-object-bad-parens.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![feature(auto_traits)] #![feature(negative_impls)] #![allow(bare_trait_objects)] diff --git a/tests/ui/parser/trait-object-bad-parens.stderr b/tests/ui/parser/trait-object-bad-parens.stderr index 7c2559ce89fd1..de3bece8176de 100644 --- a/tests/ui/parser/trait-object-bad-parens.stderr +++ b/tests/ui/parser/trait-object-bad-parens.stderr @@ -1,23 +1,23 @@ error[E0178]: expected a path on the left-hand side of `+` - --> $DIR/trait-object-bad-parens.rs:8:16 + --> $DIR/trait-object-bad-parens.rs:9:16 | LL | let _: Box<((Auto)) + Auto>; | ^^^^^^^^ expected a path error[E0178]: expected a path on the left-hand side of `+` - --> $DIR/trait-object-bad-parens.rs:9:16 + --> $DIR/trait-object-bad-parens.rs:10:16 | LL | let _: Box<(Auto + Auto) + Auto>; | ^^^^^^^^^^^^^ expected a path error[E0178]: expected a path on the left-hand side of `+` - --> $DIR/trait-object-bad-parens.rs:10:16 + --> $DIR/trait-object-bad-parens.rs:11:16 | LL | let _: Box<(Auto +) + Auto>; | ^^^^^^^^ expected a path error[E0178]: expected a path on the left-hand side of `+` - --> $DIR/trait-object-bad-parens.rs:11:16 + --> $DIR/trait-object-bad-parens.rs:12:16 | LL | let _: Box<(dyn Auto) + Auto>; | ^^^^^^^^^^ expected a path diff --git a/tests/ui/parser/trait-object-polytrait-priority.rs b/tests/ui/parser/trait-object-polytrait-priority.rs index 85568f0fe1b18..a21128cb92c05 100644 --- a/tests/ui/parser/trait-object-polytrait-priority.rs +++ b/tests/ui/parser/trait-object-polytrait-priority.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(bare_trait_objects)] trait Trait<'a> {} diff --git a/tests/ui/parser/trait-object-polytrait-priority.stderr b/tests/ui/parser/trait-object-polytrait-priority.stderr index a291a8e229c4b..b0154773ca8fa 100644 --- a/tests/ui/parser/trait-object-polytrait-priority.stderr +++ b/tests/ui/parser/trait-object-polytrait-priority.stderr @@ -1,5 +1,5 @@ error[E0178]: expected a path on the left-hand side of `+` - --> $DIR/trait-object-polytrait-priority.rs:6:12 + --> $DIR/trait-object-polytrait-priority.rs:7:12 | LL | let _: &for<'a> Trait<'a> + 'static; | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/pattern/inc-range-pat.rs b/tests/ui/pattern/inc-range-pat.rs index 189dac4feedba..2f57e54297fcd 100644 --- a/tests/ui/pattern/inc-range-pat.rs +++ b/tests/ui/pattern/inc-range-pat.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ run-pass // Test old and new syntax for inclusive range patterns. diff --git a/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs index a6144c9497d04..6cf59debcaa2e 100644 --- a/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs +++ b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() {} struct U; diff --git a/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr index a1049701dc3b8..ae5d53d2b3fd0 100644 --- a/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr +++ b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr @@ -1,5 +1,5 @@ error[E0505]: cannot move out of `arr[..]` because it is borrowed - --> $DIR/borrowck-move-ref-pattern.rs:8:24 + --> $DIR/borrowck-move-ref-pattern.rs:9:24 | LL | let mut arr = [U, U, U, U, U]; | ------- binding `arr` declared here @@ -12,7 +12,7 @@ LL | drop(hold_all); | -------- borrow later used here error[E0384]: cannot assign twice to immutable variable `_x1` - --> $DIR/borrowck-move-ref-pattern.rs:9:5 + --> $DIR/borrowck-move-ref-pattern.rs:10:5 | LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr; | --- first assignment to `_x1` @@ -29,7 +29,7 @@ LL | let [ref _x0_hold, ref mut _x1, ref xs_hold @ ..] = arr; | +++++++ error[E0505]: cannot move out of `arr[..]` because it is borrowed - --> $DIR/borrowck-move-ref-pattern.rs:11:10 + --> $DIR/borrowck-move-ref-pattern.rs:12:10 | LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr; | ------------ borrow of `arr[..]` occurs here @@ -40,7 +40,7 @@ LL | drop(_x0_hold); | -------- borrow later used here error[E0502]: cannot borrow `arr[..]` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-move-ref-pattern.rs:13:16 + --> $DIR/borrowck-move-ref-pattern.rs:14:16 | LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr; | ----------- immutable borrow occurs here @@ -52,7 +52,7 @@ LL | drop(xs_hold); | ------- immutable borrow later used here error[E0505]: cannot move out of `arr[..]` because it is borrowed - --> $DIR/borrowck-move-ref-pattern.rs:13:29 + --> $DIR/borrowck-move-ref-pattern.rs:14:29 | LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr; | ----------- borrow of `arr[..]` occurs here @@ -64,7 +64,7 @@ LL | drop(xs_hold); | ------- borrow later used here error[E0505]: cannot move out of `arr[..]` because it is borrowed - --> $DIR/borrowck-move-ref-pattern.rs:13:34 + --> $DIR/borrowck-move-ref-pattern.rs:14:34 | LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr; | ----------- borrow of `arr[..]` occurs here @@ -76,7 +76,7 @@ LL | drop(xs_hold); | ------- borrow later used here error[E0384]: cannot assign twice to immutable variable `_x1` - --> $DIR/borrowck-move-ref-pattern.rs:23:5 + --> $DIR/borrowck-move-ref-pattern.rs:24:5 | LL | let (ref _x0, _x1, ref _x2, ..) = tup; | --- first assignment to `_x1` @@ -93,7 +93,7 @@ LL | let (ref _x0, ref mut _x1, ref _x2, ..) = tup; | +++++++ error[E0502]: cannot borrow `tup.0` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-move-ref-pattern.rs:24:20 + --> $DIR/borrowck-move-ref-pattern.rs:25:20 | LL | let (ref _x0, _x1, ref _x2, ..) = tup; | ------- immutable borrow occurs here @@ -105,7 +105,7 @@ LL | *_x0 = U; | -------- immutable borrow later used here error[E0502]: cannot borrow `tup.0` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-move-ref-pattern.rs:25:10 + --> $DIR/borrowck-move-ref-pattern.rs:26:10 | LL | let (ref _x0, _x1, ref _x2, ..) = tup; | ------- immutable borrow occurs here @@ -116,7 +116,7 @@ LL | *_x0 = U; | -------- immutable borrow later used here error[E0594]: cannot assign to `*_x0`, which is behind a `&` reference - --> $DIR/borrowck-move-ref-pattern.rs:26:5 + --> $DIR/borrowck-move-ref-pattern.rs:27:5 | LL | *_x0 = U; | ^^^^^^^^ `_x0` is a `&` reference, so the data it refers to cannot be written @@ -127,7 +127,7 @@ LL | let (ref mut _x0, _x1, ref _x2, ..) = tup; | +++ error[E0594]: cannot assign to `*_x2`, which is behind a `&` reference - --> $DIR/borrowck-move-ref-pattern.rs:27:5 + --> $DIR/borrowck-move-ref-pattern.rs:28:5 | LL | *_x2 = U; | ^^^^^^^^ `_x2` is a `&` reference, so the data it refers to cannot be written @@ -138,7 +138,7 @@ LL | let (ref _x0, _x1, ref mut _x2, ..) = tup; | +++ error[E0382]: use of moved value: `tup.1` - --> $DIR/borrowck-move-ref-pattern.rs:28:10 + --> $DIR/borrowck-move-ref-pattern.rs:29:10 | LL | let (ref _x0, _x1, ref _x2, ..) = tup; | --- value moved here @@ -153,7 +153,7 @@ LL | let (ref _x0, ref _x1, ref _x2, ..) = tup; | +++ error[E0382]: borrow of moved value: `tup.1` - --> $DIR/borrowck-move-ref-pattern.rs:29:20 + --> $DIR/borrowck-move-ref-pattern.rs:30:20 | LL | drop(tup.1); | ----- value moved here @@ -163,7 +163,7 @@ LL | let _x1_hold = &tup.1; = note: move occurs because `tup.1` has type `U`, which does not implement the `Copy` trait error[E0502]: cannot borrow `tup.3` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-move-ref-pattern.rs:31:20 + --> $DIR/borrowck-move-ref-pattern.rs:32:20 | LL | let (.., ref mut _x3) = tup; | ----------- mutable borrow occurs here @@ -174,7 +174,7 @@ LL | drop(_x3); | --- mutable borrow later used here error[E0499]: cannot borrow `tup.3` as mutable more than once at a time - --> $DIR/borrowck-move-ref-pattern.rs:32:20 + --> $DIR/borrowck-move-ref-pattern.rs:33:20 | LL | let (.., ref mut _x3) = tup; | ----------- first mutable borrow occurs here @@ -186,7 +186,7 @@ LL | drop(_x3); | --- first borrow later used here error[E0499]: cannot borrow `tup.3` as mutable more than once at a time - --> $DIR/borrowck-move-ref-pattern.rs:33:14 + --> $DIR/borrowck-move-ref-pattern.rs:34:14 | LL | let (.., ref mut _x3) = tup; | ----------- first mutable borrow occurs here @@ -198,7 +198,7 @@ LL | drop(_x3); | --- first borrow later used here error[E0502]: cannot borrow `tup.3` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-move-ref-pattern.rs:34:14 + --> $DIR/borrowck-move-ref-pattern.rs:35:14 | LL | let (.., ref mut _x3) = tup; | ----------- mutable borrow occurs here @@ -209,7 +209,7 @@ LL | drop(_x3); | --- mutable borrow later used here error[E0382]: use of moved value: `tup` - --> $DIR/borrowck-move-ref-pattern.rs:43:14 + --> $DIR/borrowck-move-ref-pattern.rs:44:14 | LL | let mut tup = (U, U, U); | ------- move occurs because `tup` has type `(U, U, U)`, which does not implement the `Copy` trait diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs index ebb1683af7de6..a89238cecd2b8 100644 --- a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs +++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() { struct S; // Not `Copy`. diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr index deb14d141a92d..6bd0e3beb83d8 100644 --- a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr +++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr @@ -1,5 +1,5 @@ error[E0382]: borrow of moved value: `tup0` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:31:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:32:10 | LL | let mut tup0 = (S, S); | -------- move occurs because `tup0` has type `(S, S)`, which does not implement the `Copy` trait @@ -14,7 +14,7 @@ LL | drop(&tup0); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup1` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:32:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:33:10 | LL | let mut tup1 = (S, S, S); | -------- move occurs because `tup1` has type `(S, S, S)`, which does not implement the `Copy` trait @@ -29,7 +29,7 @@ LL | drop(&tup1); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup2` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:33:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:34:10 | LL | let tup2 = (S, S); | ---- move occurs because `tup2` has type `(S, S)`, which does not implement the `Copy` trait @@ -44,7 +44,7 @@ LL | drop(&tup2); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup3` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:34:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:35:10 | LL | let tup3 = (S, S, S); | ---- move occurs because `tup3` has type `(S, S, S)`, which does not implement the `Copy` trait @@ -59,7 +59,7 @@ LL | drop(&tup3); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup4` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:39:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:40:10 | LL | let tup4 = (S, S); | ---- move occurs because `tup4` has type `(S, S)`, which does not implement the `Copy` trait @@ -74,7 +74,7 @@ LL | drop(&tup4.0); | ^^^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr0` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:41:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:42:10 | LL | let mut arr0 = [S, S, S]; | -------- move occurs because `arr0` has type `[S; 3]`, which does not implement the `Copy` trait @@ -89,7 +89,7 @@ LL | drop(&arr0); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr1` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:42:36 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:43:36 | LL | let mut arr1 = [S, S, S, S, S]; | -------- move occurs because `arr1` has type `[S; 5]`, which does not implement the `Copy` trait @@ -104,7 +104,7 @@ LL | let [_, mov1, mov2, mov3, _] = &arr1; | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr2` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:43:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:44:10 | LL | let arr2 = [S, S, S]; | ---- move occurs because `arr2` has type `[S; 3]`, which does not implement the `Copy` trait @@ -119,7 +119,7 @@ LL | drop(&arr2); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr3` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:44:36 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:45:36 | LL | let arr3 = [S, S, S, S, S]; | ---- move occurs because `arr3` has type `[S; 5]`, which does not implement the `Copy` trait @@ -134,7 +134,7 @@ LL | let [_, mov1, mov2, mov3, _] = &arr3; | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup0` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:75:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:76:10 | LL | let mut tup0: Option<(S, S)> = None; | -------- move occurs because `tup0` has type `Option<(S, S)>`, which does not implement the `Copy` trait @@ -148,7 +148,7 @@ LL | drop(&tup0); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -157,7 +157,7 @@ LL | m!((ref mut borrow, mov) = tup0); | ---- you could clone this value error[E0382]: borrow of moved value: `tup1` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:76:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:77:10 | LL | let mut tup1: Option<(S, S, S)> = None; | -------- move occurs because `tup1` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait @@ -172,7 +172,7 @@ LL | drop(&tup1); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -181,7 +181,7 @@ LL | m!((mov, _, ref mut borrow) = tup1); | ---- you could clone this value error[E0382]: borrow of moved value: `tup2` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:77:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:78:10 | LL | let tup2: Option<(S, S)> = None; | ---- move occurs because `tup2` has type `Option<(S, S)>`, which does not implement the `Copy` trait @@ -196,7 +196,7 @@ LL | drop(&tup2); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -205,7 +205,7 @@ LL | m!((ref borrow, mov) = tup2); | ---- you could clone this value error[E0382]: borrow of moved value: `tup3` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:78:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:79:10 | LL | let tup3: Option<(S, S, S)> = None; | ---- move occurs because `tup3` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait @@ -220,7 +220,7 @@ LL | drop(&tup3); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -229,7 +229,7 @@ LL | m!((mov, _, ref borrow) = tup3); | ---- you could clone this value error[E0382]: borrow of moved value: `tup4` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:79:21 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:80:21 | LL | let tup4: Option<(S, S)> = None; | ---- move occurs because `tup4` has type `Option<(S, S)>`, which does not implement the `Copy` trait @@ -244,7 +244,7 @@ LL | m!((ref x, _) = &tup4); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -253,7 +253,7 @@ LL | m!((ref borrow, mov) = tup4); | ---- you could clone this value error[E0382]: borrow of moved value: `arr0` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:80:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:81:10 | LL | let mut arr0: Option<[S; 3]> = None; | -------- move occurs because `arr0` has type `Option<[S; 3]>`, which does not implement the `Copy` trait @@ -268,7 +268,7 @@ LL | drop(&arr0); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -277,7 +277,7 @@ LL | m!([mov @ .., ref borrow] = arr0); | ---- you could clone this value error[E0382]: borrow of moved value: `arr1` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:81:35 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:82:35 | LL | let mut arr1: Option<[S; 5]> = None; | -------- move occurs because `arr1` has type `Option<[S; 5]>`, which does not implement the `Copy` trait @@ -292,7 +292,7 @@ LL | m!([_, mov1, mov2, mov3, _] = &arr1); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -301,7 +301,7 @@ LL | m!([_, ref mut borrow @ .., _, mov] = arr1); | ---- you could clone this value error[E0382]: borrow of moved value: `arr2` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:82:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:83:10 | LL | let arr2: Option<[S; 3]> = None; | ---- move occurs because `arr2` has type `Option<[S; 3]>`, which does not implement the `Copy` trait @@ -316,7 +316,7 @@ LL | drop(&arr2); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -325,7 +325,7 @@ LL | m!([mov @ .., ref borrow] = arr2); | ---- you could clone this value error[E0382]: borrow of moved value: `arr3` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:83:35 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:84:35 | LL | let arr3: Option<[S; 5]> = None; | ---- move occurs because `arr3` has type `Option<[S; 5]>`, which does not implement the `Copy` trait @@ -339,7 +339,7 @@ LL | m!([_, mov1, mov2, mov3, _] = &arr3); | ^^^^^ value borrowed here after move | note: if `S` implemented `Clone`, you could clone the value - --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:3:5 | LL | struct S; // Not `Copy`. | ^^^^^^^^ consider implementing `Clone` for this type @@ -348,7 +348,7 @@ LL | m!([_, ref borrow @ .., _, mov] = arr3); | ---- you could clone this value error[E0382]: borrow of moved value: `tup0` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:111:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:112:10 | LL | let mut tup0: Option<(S, S)> = None; | -------- move occurs because `tup0` has type `Option<(S, S)>`, which does not implement the `Copy` trait @@ -362,7 +362,7 @@ LL | drop(&tup0); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup1` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:112:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:113:10 | LL | let mut tup1: Option<(S, S, S)> = None; | -------- move occurs because `tup1` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait @@ -377,7 +377,7 @@ LL | drop(&tup1); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup2` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:113:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:114:10 | LL | let tup2: Option<(S, S)> = None; | ---- move occurs because `tup2` has type `Option<(S, S)>`, which does not implement the `Copy` trait @@ -392,7 +392,7 @@ LL | drop(&tup2); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup3` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:114:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:115:10 | LL | let tup3: Option<(S, S, S)> = None; | ---- move occurs because `tup3` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait @@ -407,7 +407,7 @@ LL | drop(&tup3); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `tup4` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:115:21 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:116:21 | LL | let tup4: Option<(S, S)> = None; | ---- move occurs because `tup4` has type `Option<(S, S)>`, which does not implement the `Copy` trait @@ -422,7 +422,7 @@ LL | m!((ref x, _) = &tup4); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr0` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:116:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:117:10 | LL | let mut arr0: Option<[S; 3]> = None; | -------- move occurs because `arr0` has type `Option<[S; 3]>`, which does not implement the `Copy` trait @@ -437,7 +437,7 @@ LL | drop(&arr0); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr1` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:117:35 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:118:35 | LL | let mut arr1: Option<[S; 5]> = None; | -------- move occurs because `arr1` has type `Option<[S; 5]>`, which does not implement the `Copy` trait @@ -452,7 +452,7 @@ LL | m!([_, mov1, mov2, mov3, _] = &arr1); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr2` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:118:10 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:119:10 | LL | let arr2: Option<[S; 3]> = None; | ---- move occurs because `arr2` has type `Option<[S; 3]>`, which does not implement the `Copy` trait @@ -467,7 +467,7 @@ LL | drop(&arr2); | ^^^^^ value borrowed here after move error[E0382]: borrow of moved value: `arr3` - --> $DIR/move-ref-patterns-closure-captures-inside.rs:119:35 + --> $DIR/move-ref-patterns-closure-captures-inside.rs:120:35 | LL | let arr3: Option<[S; 5]> = None; | ---- move occurs because `arr3` has type `Option<[S; 5]>`, which does not implement the `Copy` trait diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs index cd619cc41eb27..d281f280aa52f 100644 --- a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs +++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() { struct U; fn accept_fn_once(_: &impl FnOnce()) {} diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr index eba65a61803d0..e986be0d4dfb6 100644 --- a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr +++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr @@ -1,5 +1,5 @@ error[E0525]: expected a closure that implements the `FnMut` trait, but this closure only implements `FnOnce` - --> $DIR/move-ref-patterns-closure-captures.rs:9:14 + --> $DIR/move-ref-patterns-closure-captures.rs:10:14 | LL | let c1 = || { | ^^ this closure implements `FnOnce`, not `FnMut` @@ -13,13 +13,13 @@ LL | accept_fn_mut(&c1); | required by a bound introduced by this call | note: required by a bound in `accept_fn_mut` - --> $DIR/move-ref-patterns-closure-captures.rs:4:31 + --> $DIR/move-ref-patterns-closure-captures.rs:5:31 | LL | fn accept_fn_mut(_: &impl FnMut()) {} | ^^^^^^^ required by this bound in `accept_fn_mut` error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` - --> $DIR/move-ref-patterns-closure-captures.rs:9:14 + --> $DIR/move-ref-patterns-closure-captures.rs:10:14 | LL | let c1 = || { | ^^ this closure implements `FnOnce`, not `Fn` @@ -33,13 +33,13 @@ LL | accept_fn(&c1); | required by a bound introduced by this call | note: required by a bound in `accept_fn` - --> $DIR/move-ref-patterns-closure-captures.rs:5:27 + --> $DIR/move-ref-patterns-closure-captures.rs:6:27 | LL | fn accept_fn(_: &impl Fn()) {} | ^^^^ required by this bound in `accept_fn` error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut` - --> $DIR/move-ref-patterns-closure-captures.rs:20:14 + --> $DIR/move-ref-patterns-closure-captures.rs:21:14 | LL | let c2 = || { | ^^ this closure implements `FnMut`, not `Fn` @@ -53,7 +53,7 @@ LL | accept_fn(&c2); | required by a bound introduced by this call | note: required by a bound in `accept_fn` - --> $DIR/move-ref-patterns-closure-captures.rs:5:27 + --> $DIR/move-ref-patterns-closure-captures.rs:6:27 | LL | fn accept_fn(_: &impl Fn()) {} | ^^^^ required by this bound in `accept_fn` diff --git a/tests/ui/print_type_sizes/coroutine.rs b/tests/ui/print_type_sizes/coroutine.rs index 1533578878944..a255ce226ee6f 100644 --- a/tests/ui/print_type_sizes/coroutine.rs +++ b/tests/ui/print_type_sizes/coroutine.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags: -Z print-type-sizes --crate-type=lib //@ build-pass //@ ignore-pass diff --git a/tests/ui/print_type_sizes/coroutine.stdout b/tests/ui/print_type_sizes/coroutine.stdout index 339bbddfc2a93..28d3f9cca1b01 100644 --- a/tests/ui/print_type_sizes/coroutine.stdout +++ b/tests/ui/print_type_sizes/coroutine.stdout @@ -1,4 +1,4 @@ -print-type-size type: `{coroutine@$DIR/coroutine.rs:11:5: 11:14}`: 8193 bytes, alignment: 1 bytes +print-type-size type: `{coroutine@$DIR/coroutine.rs:12:5: 12:14}`: 8193 bytes, alignment: 1 bytes print-type-size discriminant: 1 bytes print-type-size variant `Unresumed`: 8192 bytes print-type-size upvar `.array`: 8192 bytes diff --git a/tests/ui/proc-macro/auxiliary/issue-83510.rs b/tests/ui/proc-macro/auxiliary/issue-83510.rs index 50bdd36607d59..71914e402c486 100644 --- a/tests/ui/proc-macro/auxiliary/issue-83510.rs +++ b/tests/ui/proc-macro/auxiliary/issue-83510.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/issue-83510.rs b/tests/ui/proc-macro/issue-83510.rs index d49e1867f1d67..7f90906f4138e 100644 --- a/tests/ui/proc-macro/issue-83510.rs +++ b/tests/ui/proc-macro/issue-83510.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ proc-macro: issue-83510.rs //@ ignore-backends: gcc diff --git a/tests/ui/proc-macro/issue-83510.stderr b/tests/ui/proc-macro/issue-83510.stderr index a7c3f5a1d5b67..50209a8facb9a 100644 --- a/tests/ui/proc-macro/issue-83510.stderr +++ b/tests/ui/proc-macro/issue-83510.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Foo` in this scope - --> $DIR/issue-83510.rs:6:1 + --> $DIR/issue-83510.rs:7:1 | LL | issue_83510::dance_like_you_want_to_ice!(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope @@ -7,7 +7,7 @@ LL | issue_83510::dance_like_you_want_to_ice!(); = note: this error originates in the macro `issue_83510::dance_like_you_want_to_ice` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0404]: expected trait, found struct `Box` - --> $DIR/issue-83510.rs:6:1 + --> $DIR/issue-83510.rs:7:1 | LL | issue_83510::dance_like_you_want_to_ice!(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a trait @@ -15,7 +15,7 @@ LL | issue_83510::dance_like_you_want_to_ice!(); = note: this error originates in the macro `issue_83510::dance_like_you_want_to_ice` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0405]: cannot find trait `Baz` in this scope - --> $DIR/issue-83510.rs:6:1 + --> $DIR/issue-83510.rs:7:1 | LL | issue_83510::dance_like_you_want_to_ice!(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope @@ -23,7 +23,7 @@ LL | issue_83510::dance_like_you_want_to_ice!(); = note: this error originates in the macro `issue_83510::dance_like_you_want_to_ice` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: inherent associated types are unstable - --> $DIR/issue-83510.rs:6:1 + --> $DIR/issue-83510.rs:7:1 | LL | issue_83510::dance_like_you_want_to_ice!(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/regions/regions-addr-of-upvar-self.rs b/tests/ui/regions/regions-addr-of-upvar-self.rs index 171eca32e2960..945726d7d2dc0 100644 --- a/tests/ui/regions/regions-addr-of-upvar-self.rs +++ b/tests/ui/regions/regions-addr-of-upvar-self.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 struct Dog { food: usize, } diff --git a/tests/ui/regions/regions-addr-of-upvar-self.stderr b/tests/ui/regions/regions-addr-of-upvar-self.stderr index 3a028cc9e211c..0aa9aca032155 100644 --- a/tests/ui/regions/regions-addr-of-upvar-self.stderr +++ b/tests/ui/regions/regions-addr-of-upvar-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-addr-of-upvar-self.rs:8:20 + --> $DIR/regions-addr-of-upvar-self.rs:9:20 | LL | let _f = || { | -- lifetime `'1` represents this closure's body @@ -9,7 +9,7 @@ LL | let p: &'static mut usize = &mut self.food; = note: closure implements `FnMut`, so references to captured variables can't escape the closure error: lifetime may not live long enough - --> $DIR/regions-addr-of-upvar-self.rs:8:20 + --> $DIR/regions-addr-of-upvar-self.rs:9:20 | LL | pub fn chase_cat(&mut self) { | - let's call the lifetime of this reference `'1` @@ -18,7 +18,7 @@ LL | let p: &'static mut usize = &mut self.food; | ^^^^^^^^^^^^^^^^^^ type annotation requires that `'1` must outlive `'static` error[E0597]: `self` does not live long enough - --> $DIR/regions-addr-of-upvar-self.rs:8:46 + --> $DIR/regions-addr-of-upvar-self.rs:9:46 | LL | pub fn chase_cat(&mut self) { | --------- binding `self` declared here diff --git a/tests/ui/regions/regions-close-object-into-object-1.rs b/tests/ui/regions/regions-close-object-into-object-1.rs index 2dc33d5671ff0..c9d3f6b139537 100644 --- a/tests/ui/regions/regions-close-object-into-object-1.rs +++ b/tests/ui/regions/regions-close-object-into-object-1.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(warnings)] trait A { } diff --git a/tests/ui/regions/regions-close-object-into-object-1.stderr b/tests/ui/regions/regions-close-object-into-object-1.stderr index 8353587c6463e..4a89bfbd9d5b6 100644 --- a/tests/ui/regions/regions-close-object-into-object-1.stderr +++ b/tests/ui/regions/regions-close-object-into-object-1.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return value referencing local data `*v` - --> $DIR/regions-close-object-into-object-1.rs:12:5 + --> $DIR/regions-close-object-into-object-1.rs:13:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^---^^^^^^^^^^^^ diff --git a/tests/ui/regions/regions-close-object-into-object-3.rs b/tests/ui/regions/regions-close-object-into-object-3.rs index 78d93b0ece5b6..e118b8cf74418 100644 --- a/tests/ui/regions/regions-close-object-into-object-3.rs +++ b/tests/ui/regions/regions-close-object-into-object-3.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(warnings)] trait A { } diff --git a/tests/ui/regions/regions-close-object-into-object-3.stderr b/tests/ui/regions/regions-close-object-into-object-3.stderr index 706595ae87f7b..39bd7c6a890b5 100644 --- a/tests/ui/regions/regions-close-object-into-object-3.stderr +++ b/tests/ui/regions/regions-close-object-into-object-3.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return value referencing local data `*v` - --> $DIR/regions-close-object-into-object-3.rs:11:5 + --> $DIR/regions-close-object-into-object-3.rs:12:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^---^^^^^^^^^^^^ diff --git a/tests/ui/regions/regions-close-object-into-object-5.rs b/tests/ui/regions/regions-close-object-into-object-5.rs index d534c37496d1c..13c02d2b7958e 100644 --- a/tests/ui/regions/regions-close-object-into-object-5.rs +++ b/tests/ui/regions/regions-close-object-into-object-5.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(warnings)] diff --git a/tests/ui/regions/regions-close-object-into-object-5.stderr b/tests/ui/regions/regions-close-object-into-object-5.stderr index 881d9e03cdfab..86f5cac5314f3 100644 --- a/tests/ui/regions/regions-close-object-into-object-5.stderr +++ b/tests/ui/regions/regions-close-object-into-object-5.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-object-into-object-5.rs:17:5 + --> $DIR/regions-close-object-into-object-5.rs:18:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^ @@ -13,7 +13,7 @@ LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { | +++++++++ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-object-into-object-5.rs:17:5 + --> $DIR/regions-close-object-into-object-5.rs:18:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ @@ -27,7 +27,7 @@ LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { | +++++++++ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-object-into-object-5.rs:17:5 + --> $DIR/regions-close-object-into-object-5.rs:18:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { | +++++++++ error[E0515]: cannot return value referencing local data `*v` - --> $DIR/regions-close-object-into-object-5.rs:17:5 + --> $DIR/regions-close-object-into-object-5.rs:18:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^---^^^^^^^^^^^^^^^^ @@ -50,7 +50,7 @@ LL | Box::new(B(&*v)) as Box | returns a value referencing data owned by the current function error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-object-into-object-5.rs:17:14 + --> $DIR/regions-close-object-into-object-5.rs:18:14 | LL | Box::new(B(&*v)) as Box | ^^^^^^ diff --git a/tests/ui/span/dropck_misc_variants.rs b/tests/ui/span/dropck_misc_variants.rs index 5818a94bcb1e3..ecf78b657c53d 100644 --- a/tests/ui/span/dropck_misc_variants.rs +++ b/tests/ui/span/dropck_misc_variants.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // check that dropck does the right thing with misc. Ty variants use std::fmt; diff --git a/tests/ui/span/dropck_misc_variants.stderr b/tests/ui/span/dropck_misc_variants.stderr index 24a2c9089f5b1..fef4d3721a9b4 100644 --- a/tests/ui/span/dropck_misc_variants.stderr +++ b/tests/ui/span/dropck_misc_variants.stderr @@ -1,5 +1,5 @@ error[E0597]: `bomb` does not live long enough - --> $DIR/dropck_misc_variants.rs:23:36 + --> $DIR/dropck_misc_variants.rs:24:36 | LL | let (_w, bomb); | ---- binding `bomb` declared here @@ -15,7 +15,7 @@ LL | } = note: values in a scope are dropped in the opposite order they are defined error[E0597]: `v` does not live long enough - --> $DIR/dropck_misc_variants.rs:31:27 + --> $DIR/dropck_misc_variants.rs:32:27 | LL | let (_w,v); | - binding `v` declared here diff --git a/tests/ui/span/issue-25199.rs b/tests/ui/span/issue-25199.rs index dbc3b190068ec..3719bd50ad8cb 100644 --- a/tests/ui/span/issue-25199.rs +++ b/tests/ui/span/issue-25199.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Regression test for Issue 25199: Check that one cannot hide a // destructor's access to borrowed data behind a boxed trait object. // diff --git a/tests/ui/span/issue-25199.stderr b/tests/ui/span/issue-25199.stderr index 7a6910065fc3e..eac25890deb10 100644 --- a/tests/ui/span/issue-25199.stderr +++ b/tests/ui/span/issue-25199.stderr @@ -1,5 +1,5 @@ error[E0597]: `container` does not live long enough - --> $DIR/issue-25199.rs:70:27 + --> $DIR/issue-25199.rs:71:27 | LL | let container = Container::new(); | --------- binding `container` declared here diff --git a/tests/ui/suggestions/dont-suggest-ref/move-into-closure.rs b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.rs index 34088f219b2b8..fadc2768a2d64 100644 --- a/tests/ui/suggestions/dont-suggest-ref/move-into-closure.rs +++ b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #[derive(Clone)] enum Either { One(X), diff --git a/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr index 39c2fabf9eb14..99409dfd5c5e8 100644 --- a/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr +++ b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:75:21 + --> $DIR/move-into-closure.rs:76:21 | LL | let x = X(Y); | - captured outer variable @@ -13,7 +13,7 @@ LL | let X(_t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -23,7 +23,7 @@ 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:78:34 + --> $DIR/move-into-closure.rs:79:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -38,7 +38,7 @@ LL | if let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -48,7 +48,7 @@ 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:81:37 + --> $DIR/move-into-closure.rs:82:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -63,7 +63,7 @@ LL | while let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -73,7 +73,7 @@ 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:84:15 + --> $DIR/move-into-closure.rs:85:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -91,7 +91,7 @@ LL | Either::One(_t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -101,7 +101,7 @@ 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:90:15 + --> $DIR/move-into-closure.rs:91:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -119,7 +119,7 @@ LL | Either::One(_t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -129,7 +129,7 @@ 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:98:25 + --> $DIR/move-into-closure.rs:99:25 | LL | let x = X(Y); | - captured outer variable @@ -144,7 +144,7 @@ LL | let X(mut _t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -154,7 +154,7 @@ 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:101:38 + --> $DIR/move-into-closure.rs:102:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -169,7 +169,7 @@ LL | if let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -179,7 +179,7 @@ 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:104:41 + --> $DIR/move-into-closure.rs:105:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -194,7 +194,7 @@ LL | while let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -204,7 +204,7 @@ 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:107:15 + --> $DIR/move-into-closure.rs:108:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -222,7 +222,7 @@ LL | Either::One(mut _t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -232,7 +232,7 @@ 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:113:15 + --> $DIR/move-into-closure.rs:114:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -250,7 +250,7 @@ LL | Either::One(mut _t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:13:18 + --> $DIR/move-into-closure.rs:14:18 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -260,7 +260,7 @@ LL | match &em { | + error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:132:21 + --> $DIR/move-into-closure.rs:133:21 | LL | let x = X(Y); | - captured outer variable @@ -274,7 +274,7 @@ LL | let X(_t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -284,7 +284,7 @@ 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:135:34 + --> $DIR/move-into-closure.rs:136:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -299,7 +299,7 @@ LL | if let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -309,7 +309,7 @@ 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:138:37 + --> $DIR/move-into-closure.rs:139:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -324,7 +324,7 @@ LL | while let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -334,7 +334,7 @@ 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:141:15 + --> $DIR/move-into-closure.rs:142:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -352,7 +352,7 @@ LL | Either::One(_t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -362,7 +362,7 @@ 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:147:15 + --> $DIR/move-into-closure.rs:148:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -380,7 +380,7 @@ LL | Either::One(_t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -390,7 +390,7 @@ 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:155:25 + --> $DIR/move-into-closure.rs:156:25 | LL | let x = X(Y); | - captured outer variable @@ -405,7 +405,7 @@ LL | let X(mut _t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -415,7 +415,7 @@ 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:158:38 + --> $DIR/move-into-closure.rs:159:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -430,7 +430,7 @@ LL | if let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -440,7 +440,7 @@ 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:161:41 + --> $DIR/move-into-closure.rs:162:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -455,7 +455,7 @@ LL | while let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -465,7 +465,7 @@ 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:164:15 + --> $DIR/move-into-closure.rs:165:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -483,7 +483,7 @@ LL | Either::One(mut _t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -493,7 +493,7 @@ 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:170:15 + --> $DIR/move-into-closure.rs:171:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -511,7 +511,7 @@ LL | Either::One(mut _t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:39:22 + --> $DIR/move-into-closure.rs:40:22 | LL | fn consume_fn(_f: F) { } | ^^^^ @@ -521,7 +521,7 @@ LL | match &em { | + error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:189:21 + --> $DIR/move-into-closure.rs:190:21 | LL | let x = X(Y); | - captured outer variable @@ -535,7 +535,7 @@ LL | let X(_t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -545,7 +545,7 @@ 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:192:34 + --> $DIR/move-into-closure.rs:193:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -560,7 +560,7 @@ LL | if let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -570,7 +570,7 @@ 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:195:37 + --> $DIR/move-into-closure.rs:196:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -585,7 +585,7 @@ LL | while let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -595,7 +595,7 @@ 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:198:15 + --> $DIR/move-into-closure.rs:199:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -613,7 +613,7 @@ LL | Either::One(_t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -623,7 +623,7 @@ 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:204:15 + --> $DIR/move-into-closure.rs:205:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -641,7 +641,7 @@ LL | Either::One(_t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -651,7 +651,7 @@ 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:212:25 + --> $DIR/move-into-closure.rs:213:25 | LL | let x = X(Y); | - captured outer variable @@ -666,7 +666,7 @@ LL | let X(mut _t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -676,7 +676,7 @@ 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:215:38 + --> $DIR/move-into-closure.rs:216:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -691,7 +691,7 @@ LL | if let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -701,7 +701,7 @@ 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:218:41 + --> $DIR/move-into-closure.rs:219:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -716,7 +716,7 @@ LL | while let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -726,7 +726,7 @@ 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:221:15 + --> $DIR/move-into-closure.rs:222:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -744,7 +744,7 @@ LL | Either::One(mut _t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -754,7 +754,7 @@ 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:227:15 + --> $DIR/move-into-closure.rs:228:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -772,7 +772,7 @@ LL | Either::One(mut _t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:50:29 + --> $DIR/move-into-closure.rs:51:29 | LL | fn method_consume_fn(&self, _f: F) { } | ^^^^ @@ -782,7 +782,7 @@ 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:246:21 + --> $DIR/move-into-closure.rs:247:21 | LL | let x = X(Y); | - captured outer variable @@ -796,7 +796,7 @@ LL | let X(_t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -806,7 +806,7 @@ 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:249:34 + --> $DIR/move-into-closure.rs:250:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -821,7 +821,7 @@ LL | if let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -831,7 +831,7 @@ 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:252:37 + --> $DIR/move-into-closure.rs:253:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -846,7 +846,7 @@ LL | while let Either::One(_t) = e { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -856,7 +856,7 @@ 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:255:15 + --> $DIR/move-into-closure.rs:256:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -874,7 +874,7 @@ LL | Either::One(_t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -884,7 +884,7 @@ 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:261:15 + --> $DIR/move-into-closure.rs:262:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -902,7 +902,7 @@ LL | Either::One(_t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -912,7 +912,7 @@ 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:269:25 + --> $DIR/move-into-closure.rs:270:25 | LL | let x = X(Y); | - captured outer variable @@ -927,7 +927,7 @@ LL | let X(mut _t) = x; | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -937,7 +937,7 @@ 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:272:38 + --> $DIR/move-into-closure.rs:273:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -952,7 +952,7 @@ LL | if let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -962,7 +962,7 @@ 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:275:41 + --> $DIR/move-into-closure.rs:276:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -977,7 +977,7 @@ LL | while let Either::One(mut _t) = em { } | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -987,7 +987,7 @@ 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:278:15 + --> $DIR/move-into-closure.rs:279:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -1005,7 +1005,7 @@ LL | Either::One(mut _t) | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -1015,7 +1015,7 @@ 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:284:15 + --> $DIR/move-into-closure.rs:285:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -1033,7 +1033,7 @@ LL | Either::One(mut _t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ @@ -1043,7 +1043,7 @@ 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:291:15 + --> $DIR/move-into-closure.rs:292:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -1061,7 +1061,7 @@ LL | Either::One(mut _t) => (), | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> $DIR/move-into-closure.rs:25:21 + --> $DIR/move-into-closure.rs:26:21 | LL | fn consume_fnmut(_f: F) { } | ^^^^^^^ diff --git a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed index 434cc8470e5c3..97aad1dbee743 100644 --- a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed +++ b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@run-rustfix #![allow(unused)] diff --git a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs index 90d5f3c5c5f17..e7ab2d407a1da 100644 --- a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs +++ b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@run-rustfix #![allow(unused)] diff --git a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr index 8ddea4b222e98..ad1cb33afebb9 100644 --- a/tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr +++ b/tests/ui/suggestions/issue-105761-suggest-self-for-closure.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable - --> $DIR/issue-105761-suggest-self-for-closure.rs:11:9 + --> $DIR/issue-105761-suggest-self-for-closure.rs:12:9 | LL | let x = |v: i32| { | -------- immutable borrow occurs here @@ -23,7 +23,7 @@ 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 + --> $DIR/issue-105761-suggest-self-for-closure.rs:24:9 | LL | let y = || { | -- immutable borrow occurs here diff --git a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs index 34afd36312961..2011d4e01205e 100644 --- a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs +++ b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 fn main() {} fn foo(_src: &crate::Foo) -> Option { diff --git a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr index 9a3cfa9987ab1..a9b0931499d95 100644 --- a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr +++ b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr @@ -1,5 +1,5 @@ error[E0700]: hidden type for `impl Iterator` captures lifetime that does not appear in bounds - --> $DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:7:5 + --> $DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:8:5 | LL | fn bar(src: &crate::Foo) -> impl Iterator { | ------------------------- opaque type defined here @@ -8,7 +8,7 @@ LL | | LL | | .filter_map(|_| foo(src)) | |_________________________________^ | - = note: hidden type `FilterMap, {closure@$DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:9:21: 9:24}>` captures lifetime `'_` + = note: hidden type `FilterMap, {closure@$DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:10:21: 10:24}>` captures lifetime `'_` error: aborting due to 1 previous error diff --git a/tests/ui/test-attrs/test-should-panic-failed-show-span.rs b/tests/ui/test-attrs/test-should-panic-failed-show-span.rs index f400f614142de..22a6f4a835e23 100644 --- a/tests/ui/test-attrs/test-should-panic-failed-show-span.rs +++ b/tests/ui/test-attrs/test-should-panic-failed-show-span.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 //@ compile-flags: --test //@ run-flags: --test-threads=1 --nocapture //@ run-fail diff --git a/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stderr b/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stderr index 63bc10ef5eacf..ab36bc2beb9e6 100644 --- a/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stderr +++ b/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stderr @@ -1,13 +1,13 @@ -thread 'should_panic_with_any_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:14:5: +thread 'should_panic_with_any_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:15:5: Panic! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace -thread 'should_panic_with_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:20:5: +thread 'should_panic_with_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:21:5: message -thread 'should_panic_with_substring_panics_with_incorrect_string' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:38:5: +thread 'should_panic_with_substring_panics_with_incorrect_string' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:39:5: ZOMGWTFBBQ -thread 'should_panic_with_substring_panics_with_non_string_value' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:45:5: +thread 'should_panic_with_substring_panics_with_non_string_value' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:46:5: Box diff --git a/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout b/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout index 93204abb96873..492f54debc829 100644 --- a/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout +++ b/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout @@ -10,9 +10,9 @@ test should_panic_with_substring_panics_with_non_string_value - should panic ... failures: ---- should_panic_with_any_message_does_not_panic stdout ---- -note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:25:4 +note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:26:4 ---- should_panic_with_message_does_not_panic stdout ---- -note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:31:4 +note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:32:4 ---- should_panic_with_substring_panics_with_incorrect_string stdout ---- note: panic did not contain expected string panic message: "ZOMGWTFBBQ" diff --git a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed index aa5ec17a28d79..5cd8074fd5f8a 100644 --- a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed +++ b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Regression test of #43913. //@ run-rustfix diff --git a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs index 5ed8bc84e0da1..3772463487246 100644 --- a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs +++ b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // Regression test of #43913. //@ run-rustfix diff --git a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr index af4e4214be2db..1cb80148d5961 100644 --- a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr +++ b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr @@ -1,5 +1,5 @@ error[E0404]: expected trait, found type alias `Strings` - --> $DIR/suggest-trait-alias-instead-of-type.rs:10:18 + --> $DIR/suggest-trait-alias-instead-of-type.rs:11:18 | LL | struct Struct(S); | ^^^^^^^ type aliases cannot be used as traits diff --git a/tests/ui/traits/bound/not-on-struct.rs b/tests/ui/traits/bound/not-on-struct.rs index 8633e9d7a4cef..6b1bbde199bc4 100644 --- a/tests/ui/traits/bound/not-on-struct.rs +++ b/tests/ui/traits/bound/not-on-struct.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 // We don't need those errors. Ideally we would silence them, but to do so we need to move the // lint from being an early-lint during parsing to a late-lint, because it needs to be aware of // the types involved. diff --git a/tests/ui/traits/bound/not-on-struct.stderr b/tests/ui/traits/bound/not-on-struct.stderr index 1fb5b1c20670c..7214e88a0507e 100644 --- a/tests/ui/traits/bound/not-on-struct.stderr +++ b/tests/ui/traits/bound/not-on-struct.stderr @@ -1,23 +1,23 @@ error[E0226]: only a single explicit lifetime bound is permitted - --> $DIR/not-on-struct.rs:25:25 + --> $DIR/not-on-struct.rs:26:25 | LL | fn e() -> 'static + A + 'static { | ^^^^^^^ error[E0226]: only a single explicit lifetime bound is permitted - --> $DIR/not-on-struct.rs:29:53 + --> $DIR/not-on-struct.rs:30:53 | LL | fn f<'a,T,E>(iter: Iterator + 'a>) { | ^^ error[E0404]: expected trait, found struct `Foo` - --> $DIR/not-on-struct.rs:8:16 + --> $DIR/not-on-struct.rs:9:16 | LL | fn foo(_x: Box) { } | ^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:8:22 + --> $DIR/not-on-struct.rs:9:22 | LL | fn foo(_x: Box) { } | --- ^^^^ ...because of this bound @@ -25,19 +25,19 @@ LL | fn foo(_x: Box) { } | expected this type to be a trait... error[E0404]: expected trait, found struct `Vec` - --> $DIR/not-on-struct.rs:10:29 + --> $DIR/not-on-struct.rs:11:29 | LL | type TypeAlias = Box>; | ^^^^^^ not a trait error[E0404]: expected trait, found struct `A` - --> $DIR/not-on-struct.rs:13:11 + --> $DIR/not-on-struct.rs:14:11 | LL | fn a() -> A + 'static { | ^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:13:15 + --> $DIR/not-on-struct.rs:14:15 | LL | fn a() -> A + 'static { | - ^^^^^^^ ...because of this bound @@ -50,13 +50,13 @@ LL + fn a() -> A { | error[E0404]: expected trait, found enum `Result` - --> $DIR/not-on-struct.rs:16:34 + --> $DIR/not-on-struct.rs:17:34 | LL | fn b<'a,T,E>(iter: Iterator + 'a>) { | ^^^^^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:16:48 + --> $DIR/not-on-struct.rs:17:48 | LL | fn b<'a,T,E>(iter: Iterator + 'a>) { | ----------- ^^ ...because of this bound @@ -69,13 +69,13 @@ LL + fn b<'a,T,E>(iter: Iterator>) { | error[E0404]: expected trait, found struct `A` - --> $DIR/not-on-struct.rs:19:21 + --> $DIR/not-on-struct.rs:20:21 | LL | fn c() -> 'static + A { | ^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:19:11 + --> $DIR/not-on-struct.rs:20:11 | LL | fn c() -> 'static + A { | ^^^^^^^ - expected this type to be a trait... @@ -88,13 +88,13 @@ LL + fn c() -> A { | error[E0404]: expected trait, found enum `Result` - --> $DIR/not-on-struct.rs:22:39 + --> $DIR/not-on-struct.rs:23:39 | LL | fn d<'a,T,E>(iter: Iterator>) { | ^^^^^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:22:34 + --> $DIR/not-on-struct.rs:23:34 | LL | fn d<'a,T,E>(iter: Iterator>) { | ^^ ----------- expected this type to be a trait... @@ -107,13 +107,13 @@ LL + fn d<'a,T,E>(iter: Iterator>) { | error[E0404]: expected trait, found struct `A` - --> $DIR/not-on-struct.rs:25:21 + --> $DIR/not-on-struct.rs:26:21 | LL | fn e() -> 'static + A + 'static { | ^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:25:11 + --> $DIR/not-on-struct.rs:26:11 | LL | fn e() -> 'static + A + 'static { | ^^^^^^^ - ^^^^^^^ ...because of these bounds @@ -126,13 +126,13 @@ LL + fn e() -> A { | error[E0404]: expected trait, found enum `Result` - --> $DIR/not-on-struct.rs:29:39 + --> $DIR/not-on-struct.rs:30:39 | LL | fn f<'a,T,E>(iter: Iterator + 'a>) { | ^^^^^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:29:34 + --> $DIR/not-on-struct.rs:30:34 | LL | fn f<'a,T,E>(iter: Iterator + 'a>) { | ^^ ----------- ^^ ...because of these bounds @@ -145,7 +145,7 @@ LL + fn f<'a,T,E>(iter: Iterator>) { | error[E0404]: expected trait, found struct `Traitor` - --> $DIR/not-on-struct.rs:35:11 + --> $DIR/not-on-struct.rs:36:11 | LL | trait Trait {} | ----------- similarly named trait `Trait` defined here @@ -153,7 +153,7 @@ LL | fn g() -> Traitor + 'static { | ^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/not-on-struct.rs:35:21 + --> $DIR/not-on-struct.rs:36:21 | LL | fn g() -> Traitor + 'static { | ------- ^^^^^^^ ...because of this bound diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.rs b/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.rs index 6e404c6160a74..9a6a083953384 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.rs @@ -1,3 +1,4 @@ +//@ edition:2015..2021 #![allow(unused)] fn foo(f: F) diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr b/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr index cc81ce9bc3609..d811cead513c7 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr @@ -1,5 +1,5 @@ error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` - --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:14:13 + --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:15:13 | LL | let c = || drop(y.0); | ^^ --- closure is `FnOnce` because it moves the variable `y` out of its environment @@ -11,7 +11,7 @@ LL | foo(c); | required by a bound introduced by this call | note: required by a bound in `foo` - --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:4:14 + --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:5:14 | LL | fn foo(f: F) | --- required by a bound in this function