From 7ae2823bc6c17c2d27e445fd82b668ec7bdb4bac Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Fri, 5 Sep 2025 14:54:43 -0500 Subject: [PATCH] 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 +- .../cfg-arg-invalid-7.rs | 1 + 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 | 18 +- ...plicit-hrtb-without-dyn.edition2021.stderr | 4 +- ...h-implicit-hrtb-without-dyn.pre2021.stderr | 9 + .../generic-with-implicit-hrtb-without-dyn.rs | 7 +- 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 + .../macro-expansion-empty-span-147408.rs | 1 + .../macro-expansion-empty-span-147408.stderr | 4 +- 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 | 92 +++++----- ...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 | 8 +- 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 + .../proc-macro/auxiliary/nonfatal-parsing.rs | 1 + tests/ui/proc-macro/issue-83510.rs | 1 + tests/ui/proc-macro/issue-83510.stderr | 8 +- tests/ui/proc-macro/nonfatal-parsing.stderr | 20 ++- .../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 +- 252 files changed, 965 insertions(+), 797 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 4f2f3517ddd7..d8d3339d2ddf 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 5ed42a9ddd21..0c80ae8acc43 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 84cc4dbca9cf..6418ace82f2d 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 ee75cb96afd3..32192e149001 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 c80b32dc3d8f..ad97df377b75 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 6a63b3e09367..63ebbddea76f 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 526f425b21e7..196ad85f084e 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 cbad6a27c1dc..cc5de837f67a 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 71ca8ffe2a8e..1f4a700edccc 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 a8225f2faf16..17702ed07723 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 8a7870e0c44a..165a9b01575c 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 d7e187a2b395..4229982b7f43 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 537ec9895e10..46b41a0c8194 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 50c6f2c585ed..cf900c162753 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 105a0b05189e..6f229b9a3a71 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 32057d5c126e..b36df1a4fda7 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 9066891d2985..3764e4391d36 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 63a75cdff42d..644ef1429a47 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 fe8e7a29e248..527e246b1f2d 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 cdff8f9e890c..13fbe7311328 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 21e329f43293..11f75b4bd628 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 0dd004769105..e53f15b8e9d8 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 669dd614f52d..ca2112cdc62c 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 67f91dfa8420..039a5db05022 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 613df9f2100c..792d92f4340d 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 df967e611893..ee07879c9164 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 a1ac45795fae..89b9dd4123e6 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 d2234e17ac75..a8d02fa09c25 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 317423ecf61f..3d0e52d2b1d1 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 e22bf42e0214..81363f0c3f72 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 6fc8d3a6c35c..af44eca7e7f1 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 c9e043577ed6..13c7c3ef6182 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 98fb49824ae9..36a69f7d822b 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 3bbac007b4f8..d4720fc99bdb 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 cb11832d06c8..12b015eaaacd 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 94bbd79cbb4f..a10a8de4872c 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 c1d88cbdf837..36938c038322 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 6b452fcdaf11..2d9974b301e8 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 b981ef69b4fa..acbac1901c2a 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 2784a6036443..44c7858f3481 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 e5de7ba3c623..24f2a72a6d04 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 3381b9e334b4..3518c797be02 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 8946642892ff..b91dcc58d80d 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 f50b985298d7..5f0f7daf906f 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 7d90b7bf72bd..ed477b3399e4 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 b87c398da396..6b256115d67b 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 5e763b0239ae..b449947e94b2 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 7d937f512493..956ccea6ed91 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 3ff73bf4681c..6b73969d1e9c 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 21f1a9515a6a..9fdbf7c20a80 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 6a9266ecc544..f94451bd1fa0 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 8bbd7fab569c..8ad71f3825d5 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 62fe1581bac0..3d4e74708f48 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 81ffe866c837..0c9a56473c6e 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 5743f9984be2..072ed468186d 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 2ddd2535c727..68af3b66734a 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 5fb7675207f4..d17f0f6f968e 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 8aa07cd5442a..bde9d5ccdbb6 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 b53461d14df3..92bf4f5fc8a1 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 3f4d38aefe7a..7c3308ae1667 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 7327d8256685..e54194c1ad68 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 85df5c1e5b3d..798c3bc81569 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 80938e50b67a..207b03620b66 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 785cc8a3032e..9bc5f8ef2412 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 7dd0e51797d8..f420fc342cd2 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 6fe6840b35b3..22b7be4c729b 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 cecb08f006fd..8b96e1d15ef1 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 aed673fe1ab5..4141dd91cd33 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 a27a6160142a..260714ed0b24 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 d050fb60c3db..0f048deb8c92 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 504b4adbeb9b..277e5ef06f34 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 41cad279f7b9..a7e7c751b921 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 e24fc6707098..fc1c9b7efa7c 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 75aa3c934799..317b0d12eb0c 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/conditional-compilation/cfg-arg-invalid-7.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-7.rs index d90075da3e63..aeb1a429e1f3 100644 --- a/tests/ui/conditional-compilation/cfg-arg-invalid-7.rs +++ b/tests/ui/conditional-compilation/cfg-arg-invalid-7.rs @@ -1,5 +1,6 @@ // Regression test for issue #89358. +//@ edition: 2015..2021 //@ compile-flags: --cfg a" //~? RAW unterminated double quote string diff --git a/tests/ui/consts/const-eval/const_panic.rs b/tests/ui/consts/const-eval/const_panic.rs index 367396bab946..e4f3a4eec1b1 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 46b36ecfa6a3..a2036e834b0b 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 6ae40ae6ddbf..a5a961658c76 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 fa1bbf2187f7..70eae7309a63 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 b434970b6775..89512c03f5e8 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 de1e1f8a2bea..bf8de4817963 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 197222829842..c5bf074ec462 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 2256970e3374..c775b491a809 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 241643a83be9..5dfd977a3d39 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 9d82d5a42bdb..d2af174bee1c 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 5540d4f2d222..6cd791b949c9 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 976f64c7fd91..1ec2feb045a3 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 b6f2e014e0a8..29adeaec3e16 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 9331c1fa1d58..ef7508affa81 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 78fdeec972f7..23ef764f1c34 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 2600d0b4124b..ed851efda5d2 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 7c9b766457db..0b2cc92f4b4a 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 1bd75e1852c4..8315985f9a97 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 4d4274251f05..8dc87aa1b051 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 62cb85765520..bcc9d65405bd 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 e80d0d4b649a..1c403b53914a 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 283405c79d61..703fa225e71b 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 c24a4cc5094b..ed1b2caa5739 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 5f48059ebff2..7cc88ae1fd52 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 3e39d9a63c59..136b6e4c2c42 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 53d98d7e13fe..1b9620eb1ea2 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 c2658bef6197..68bd342ef472 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 582669593336..c4cbc834ad98 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 8562ae305f82..1c70cc41f029 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 22f4918fb191..cd45ba3a70d2 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 23199fae28b5..fcfce28d2693 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:12:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:13: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:12:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:13: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>; | ^ -- 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 112341287f8a..27f5f8676b8d 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 000000000000..82a2c6693826 --- /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 df43250f1515..a419f3a2acf1 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 -//@[edition2021]edition:2021 +//@ 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/where-allowed-2.rs b/tests/ui/impl-trait/where-allowed-2.rs index 1a1210d00726..d2e323af6a1a 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 c421e587a9ef..83364e6e7724 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 04a95f7f6f01..7667c6c8f7a7 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 4d8f23bf7ca6..6cab4fabb1ff 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 9c6188350e3f..66a3fadac8d9 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 0ed12d3a2e97..e294d8830de0 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 bd0317b1ffb7..efc681c31800 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 b2324af6d5e4..8bec119ddbc0 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 be754a28ffa9..848b13750d77 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 e4dddb325cd3..a505ba8313f5 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 a3eb3133a00f..b173eb01d22e 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 078c3a59eb3e..df14f68a0fb5 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 ada37ccd6401..6eba47ed585e 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 67066c3bee3f..f14d37d4d91d 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 d5fdaef42d87..e96350f09983 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 f9b6f5f51805..6046278c1bdf 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 16f68dfcf9b6..e0fd82847b77 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 7582c8e8659b..2af779a467a3 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 7582c8e8659b..2af779a467a3 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 2d5f2bda2edf..431297bd55f1 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 35be93b05903..ba6079c551ff 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 a319c405eb6e..7b42a77c64df 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 fe75188efd20..46fe69702cd5 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 ec0302ee287e..31ea2382eb5b 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 14ac1dd42124..1ffa840c0e7f 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-expansion-empty-span-147408.rs b/tests/ui/macros/macro-expansion-empty-span-147408.rs index 6df96d7b05d4..a5f31d6d01a9 100644 --- a/tests/ui/macros/macro-expansion-empty-span-147408.rs +++ b/tests/ui/macros/macro-expansion-empty-span-147408.rs @@ -1,5 +1,6 @@ //@ check-pass //@ compile-flags: -Afor_loops_over_fallibles -Warray_into_iter +//@ edition: 2015..2021 fn main() { macro_rules! mac { diff --git a/tests/ui/macros/macro-expansion-empty-span-147408.stderr b/tests/ui/macros/macro-expansion-empty-span-147408.stderr index c4faaa20101d..97eab0dc7233 100644 --- a/tests/ui/macros/macro-expansion-empty-span-147408.stderr +++ b/tests/ui/macros/macro-expansion-empty-span-147408.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/macro-expansion-empty-span-147408.rs:19:27 + --> $DIR/macro-expansion-empty-span-147408.rs:20:27 | LL | for _ in dbg!([1, 2]).into_iter() {} | ^^^^^^^^^ @@ -19,7 +19,7 @@ LL + for _ in dbg!([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/macro-expansion-empty-span-147408.rs:10:16 + --> $DIR/macro-expansion-empty-span-147408.rs:11:16 | LL | $e.into_iter() | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` diff --git a/tests/ui/macros/macro-follow-rpass.rs b/tests/ui/macros/macro-follow-rpass.rs index 835088792253..8551b1887708 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 8054418d9b89..923c9bd6cedc 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 61ae79d235ee..92491dc26d12 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 9a5bdb08a8ec..205a3983c188 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 542486927dfd..11960db98743 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 d584e919a2a0..59d26a9af2e1 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 55e547ee72b0..e9f39edcd3c7 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 a6312a843f39..e154043fa97d 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 b102dba17319..2bfb9d98d577 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 9277529c6d42..a71ee988ba82 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 1787316b48bb..43f59782ee72 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); | ^ @@ -144,19 +144,6 @@ help: add a "{}" format string to `Display` the message LL | panic!("{}", S); | +++++ -warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:34:18 - | -LL | unreachable!(S); - | ^ - | - = note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see -help: add a "{}" format string to `Display` the message - | -LL | unreachable!("{}", S); - | +++++ - warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:35:18 | @@ -171,7 +158,20 @@ LL | unreachable!("{}", S); | +++++ warning: panic message is not a string literal - --> $DIR/non-fmt-panic.rs:36:17 + --> $DIR/non-fmt-panic.rs:36:18 + | +LL | unreachable!(S); + | ^ + | + = note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021 + = note: for more information, see +help: add a "{}" format string to `Display` the message + | +LL | unreachable!("{}", S); + | +++++ + +warning: panic message is not a string literal + --> $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 05dbdfdee0e3..f59cdac9d665 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 b0cf1591f5ee..9a8158613278 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 cbcbeea4d4cd..e1cd087208a0 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 c53d7afe4e2d..0b58fbfa4af1 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 7a5b2182e26d..9e8dd0c0afbf 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 0cde6119308e..f8304a692de6 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 ded13e2707f5..90d0d4260d2d 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 399bd72561b4..c7c624bdce6e 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 49dc602a532a..c23b39590a3f 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 `()` @@ -8,13 +8,13 @@ LL | panic!() | -------- return type was inferred to be `_` here | help: the trait `T` is implemented for `i32` - --> $DIR/impl_trait_fallback2.rs:6:1 + --> $DIR/impl_trait_fallback2.rs:7:1 | LL | impl T 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 `()` @@ -23,7 +23,7 @@ LL | panic!() | -------- return type was inferred to be `_` here | help: the trait `T` is implemented for `i32` - --> $DIR/impl_trait_fallback2.rs:6:1 + --> $DIR/impl_trait_fallback2.rs:7:1 | LL | impl T for i32 {} | ^^^^^^^^^^^^^^ diff --git a/tests/ui/never_type/impl_trait_fallback3.rs b/tests/ui/never_type/impl_trait_fallback3.rs index 3740aad73f0b..03cd6fc25c2b 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 11425a749534..259aea18d688 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 2fa3d0028be8..52ddd74f9161 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 c4fc949373ae..f9de4b6a4944 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 65617e36c6d6..802bfa5f79bf 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 2a59e80b25cd..68d1232abb72 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 a8024a8c20b9..dc26ebbcfb19 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 b38f7900e8e5..2ecab122da66 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 c466cad25d2e..8ae792f7030c 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 16d90b971745..4dbd646a4cc4 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 80ac033351aa..545bb38479ab 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` @@ -60,7 +60,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` @@ -75,7 +75,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 @@ -86,7 +86,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` @@ -103,7 +103,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 @@ -114,7 +114,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` @@ -129,7 +129,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` @@ -144,7 +144,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 491c186ecb5a..bf7b7bc8a70c 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 050b220e6263..8d832e29a23d 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 d17d6f07f687..156ec9e78f5c 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 a37639883d2b..9ca85a735129 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 9c3e7e9978ec..cbb00daa8c39 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 5cd0982526b3..900ae8f8ab53 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 cff9e963e272..e7a9ab659f1b 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 e4d0cf311127..e81b8b1004cc 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 ac06b2b01028..b5e7bd193608 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 5eb7a25bf9f5..59ef7469655a 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 cdf0bd3647d9..ac5e812ed079 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 0ec0179e846f..35d14b98a6ac 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 e3f44467550c..d3aaf9cc9a6a 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 dcdedf7d4c51..b8d5e65c5260 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 b0c3d8b878d3..6c2f64de62e8 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 cd1f457a1306..19a08472c0aa 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 4749e3b8e453..0cebd07d8665 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 9c0785cc9640..a379b5f9c26e 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 3468c5ad3729..7dc5ef155cdf 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 4393a3b41697..ba70f29a6509 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 56bd41051e27..3bb9af5c6401 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 25a9652ba4f3..4c6d10db033f 100644 --- a/tests/ui/or-patterns/binding-typo-2.rs +++ b/tests/ui/or-patterns/binding-typo-2.rs @@ -64,8 +64,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 e5728ef1e20c..7d1afcccaaba 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 21428d876e22..b276541d2ed8 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 32aa6a3502ee..49a1ecc455b6 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 e3a2dc6eed42..53fa41b706c7 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 1392929b65c2..2b706b0111a9 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 61c07a97c700..a3003d050394 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 48a12b59b69b..7876f8449543 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 660530f0eada..28556304be62 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 a652eb211285..1efd7dc59b59 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 41fb6e9950e6..0468bffbe444 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 31fcda89a1bf..6ad72bbb43ca 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 1380974538a5..18f7b80fc9ce 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 5d94a8dcbdb8..86ef1ca681cf 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 bc5af04ecbc0..97dc1cff2288 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 700b1ec911b3..73aff965b88d 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 9a6bd4442e56..447149ed419d 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 bb047a4b4314..c53e52f2eca3 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 7c2559ce89fd..de3bece8176d 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 85568f0fe1b1..a21128cb92c0 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 a291a8e229c4..b0154773ca8f 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 189dac4feedb..2f57e54297fc 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 a6144c9497d0..6cf59debcaa2 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 5c4446cbc17b..15762954254c 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 it cannot be written to @@ -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 it cannot be written to @@ -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 ebb1683af7de..a89238cecd2b 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 deb14d141a92..6bd0e3beb83d 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 cd619cc41eb2..d281f280aa52 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 eba65a61803d..e986be0d4dfb 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 153357887894..a255ce226ee6 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 339bbddfc2a9..28d3f9cca1b0 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 50bdd36607d5..71914e402c48 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/auxiliary/nonfatal-parsing.rs b/tests/ui/proc-macro/auxiliary/nonfatal-parsing.rs index 75db8ee3c5fc..701510c47db5 100644 --- a/tests/ui/proc-macro/auxiliary/nonfatal-parsing.rs +++ b/tests/ui/proc-macro/auxiliary/nonfatal-parsing.rs @@ -1,3 +1,4 @@ +//@ edition: 2024 extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/issue-83510.rs b/tests/ui/proc-macro/issue-83510.rs index d49e1867f1d6..7f90906f4138 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 a7c3f5a1d5b6..50209a8facb9 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/proc-macro/nonfatal-parsing.stderr b/tests/ui/proc-macro/nonfatal-parsing.stderr index 00c5c6ecfa8e..a44f77e7d534 100644 --- a/tests/ui/proc-macro/nonfatal-parsing.stderr +++ b/tests/ui/proc-macro/nonfatal-parsing.stderr @@ -22,6 +22,24 @@ help: consider inserting whitespace here LL | c 'r' | + +error: prefix `r` is unknown + --> $DIR/nonfatal-parsing.rs:15:5 + | +LL | nonfatal_parsing::run!(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ unknown prefix + | + = note: prefixed identifiers and literals are reserved since Rust 2021 + = note: this error originates in the macro `nonfatal_parsing::run` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: prefix `c` is unknown + --> $DIR/nonfatal-parsing.rs:15:5 + | +LL | nonfatal_parsing::run!(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ unknown prefix + | + = note: prefixed identifiers and literals are reserved since Rust 2021 + = note: this error originates in the macro `nonfatal_parsing::run` (in Nightly builds, run with -Z macro-backtrace for more info) + error: unexpected closing delimiter: `)` --> $DIR/nonfatal-parsing.rs:15:5 | @@ -192,6 +210,6 @@ error: invalid digit for a base 2 literal LL | /*a*/ 0b2 // | ^ -error: aborting due to 22 previous errors +error: aborting due to 24 previous errors For more information about this error, try `rustc --explain E0768`. diff --git a/tests/ui/regions/regions-addr-of-upvar-self.rs b/tests/ui/regions/regions-addr-of-upvar-self.rs index 171eca32e296..945726d7d2dc 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 3a028cc9e211..0aa9aca03215 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 2dc33d5671ff..c9d3f6b13953 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 8353587c6463..4a89bfbd9d5b 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 78d93b0ece5b..e118b8cf7441 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 706595ae87f7..39bd7c6a890b 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 d534c37496d1..13c02d2b7958 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 881d9e03cdfa..86f5cac5314f 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 5818a94bcb1e..ecf78b657c53 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 24a2c9089f5b..fef4d3721a9b 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 dbc3b190068e..3719bd50ad8c 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 7a6910065fc3..eac25890deb1 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 34088f219b2b..fadc2768a2d6 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 39c2fabf9eb1..99409dfd5c5e 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 434cc8470e5c..97aad1dbee74 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 90d5f3c5c5f1..e7ab2d407a1d 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 8ddea4b222e9..ad1cb33afebb 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 34afd3631296..2011d4e01205 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 9a3cfa9987ab..a9b0931499d9 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 f400f614142d..22a6f4a835e2 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 63bc10ef5eac..ab36bc2beb9e 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 93204abb9687..492f54debc82 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 aa5ec17a28d7..5cd8074fd5f8 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 5ed8bc84e0da..377246348724 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 af4e4214be2d..1cb80148d596 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 8633e9d7a4ce..6b1bbde199bc 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 1fb5b1c20670..7214e88a0507 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 6e404c6160a7..9a6a08395338 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 cc81ce9bc360..d811cead513c 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