From 410dcc96741716bf1b4dc9b3bf33f408f220384d Mon Sep 17 00:00:00 2001 From: Jack Huey <31162821+jackh726@users.noreply.github.com> Date: Fri, 1 Apr 2022 13:13:25 -0400 Subject: [PATCH] Fully stabilize NLL --- compiler/rustc_apfloat/src/lib.rs | 1 - compiler/rustc_ast/src/lib.rs | 1 - compiler/rustc_builtin_macros/src/lib.rs | 1 - compiler/rustc_codegen_llvm/src/lib.rs | 1 - compiler/rustc_codegen_ssa/src/lib.rs | 1 - compiler/rustc_driver/src/lib.rs | 1 - .../src/error_codes/E0312.md | 4 +- .../src/error_codes/E0477.md | 4 +- .../src/error_codes/E0495.md | 4 +- .../src/error_codes/E0623.md | 65 +++-- .../src/error_codes/E0713.md | 2 - .../src/error_codes/E0759.md | 4 +- .../src/error_codes/E0772.md | 4 +- compiler/rustc_errors/src/lib.rs | 1 - compiler/rustc_feature/src/accepted.rs | 2 + compiler/rustc_feature/src/active.rs | 2 - compiler/rustc_graphviz/src/lib.rs | 1 - compiler/rustc_incremental/src/lib.rs | 1 - .../src/infer/lexical_region_resolve/mod.rs | 13 +- compiler/rustc_infer/src/infer/mod.rs | 25 +- compiler/rustc_interface/src/lib.rs | 1 - compiler/rustc_interface/src/tests.rs | 1 - compiler/rustc_lint/src/lib.rs | 1 - compiler/rustc_llvm/src/lib.rs | 1 - compiler/rustc_metadata/src/lib.rs | 1 - compiler/rustc_middle/src/lib.rs | 1 - compiler/rustc_middle/src/ty/context.rs | 40 +-- compiler/rustc_passes/src/lib.rs | 1 - compiler/rustc_plugin_impl/src/lib.rs | 1 - compiler/rustc_privacy/src/lib.rs | 1 - compiler/rustc_query_impl/src/lib.rs | 1 - compiler/rustc_resolve/src/lib.rs | 2 +- compiler/rustc_save_analysis/src/lib.rs | 1 - compiler/rustc_serialize/src/lib.rs | 1 - compiler/rustc_session/src/config.rs | 12 - compiler/rustc_session/src/options.rs | 5 - compiler/rustc_span/src/lib.rs | 1 - compiler/rustc_symbol_mangling/src/lib.rs | 1 - compiler/rustc_target/src/lib.rs | 1 - compiler/rustc_traits/src/lib.rs | 1 - compiler/rustc_ty_utils/src/lib.rs | 1 - compiler/rustc_typeck/src/check/regionck.rs | 4 +- compiler/rustc_typeck/src/lib.rs | 1 - library/alloc/src/lib.rs | 1 - library/panic_abort/src/lib.rs | 1 - library/panic_unwind/src/lib.rs | 1 - library/proc_macro/src/lib.rs | 1 - library/profiler_builtins/src/lib.rs | 1 - library/std/src/keyword_docs.rs | 2 +- library/std/src/lib.rs | 2 +- library/test/src/lib.rs | 1 - library/unwind/src/lib.rs | 1 - src/bootstrap/flags.rs | 2 +- src/bootstrap/test.rs | 7 +- src/librustdoc/lib.rs | 2 +- ...s.full_tested_match.PromoteTemps.after.mir | 126 ++++----- ...full_tested_match2.PromoteTemps.before.mir | 120 ++++----- ...h_false_edges.main.PromoteTemps.before.mir | 174 ++++++------- src/test/mir-opt/match_false_edges.rs | 2 - src/test/mir-opt/nll/named-lifetimes-basic.rs | 4 +- .../mir-opt/nll/region-subtyping-basic.rs | 4 +- .../rustdoc-error-lines/input.rs | 6 +- .../implied-region-constraints.base.stderr | 21 -- .../implied-region-constraints.rs | 10 +- ...derr => implied-region-constraints.stderr} | 4 +- .../associated-types-eq-hr.base.stderr | 92 ------- .../associated-types-eq-hr.rs | 9 - ...l.stderr => associated-types-eq-hr.stderr} | 12 +- ...s-project-from-hrtb-in-fn-body.base.stderr | 14 - ...ated-types-project-from-hrtb-in-fn-body.rs | 9 +- ...types-project-from-hrtb-in-fn-body.stderr} | 4 +- .../associated-types-subtyping-1.base.stderr | 21 -- .../associated-types-subtyping-1.rs | 10 +- ...rr => associated-types-subtyping-1.stderr} | 4 +- ...fn-ret-contravariant-nll.krisskross.stderr | 25 -- .../cache/project-fn-ret-contravariant-nll.rs | 55 ---- ...-fn-ret-contravariant-nll.transmute.stderr | 11 - ...ect-fn-ret-contravariant.krisskross.stderr | 31 ++- .../cache/project-fn-ret-contravariant.rs | 12 +- ...ject-fn-ret-contravariant.transmute.stderr | 9 +- ...ect-fn-ret-invariant-nll.krisskross.stderr | 36 --- ...project-fn-ret-invariant-nll.oneuse.stderr | 36 --- .../cache/project-fn-ret-invariant-nll.rs | 69 ----- ...ject-fn-ret-invariant-nll.transmute.stderr | 15 -- ...project-fn-ret-invariant.krisskross.stderr | 46 ++-- .../project-fn-ret-invariant.oneuse.stderr | 42 ++- .../cache/project-fn-ret-invariant.rs | 17 +- .../project-fn-ret-invariant.transmute.stderr | 20 +- .../higher-ranked-projection.bad.nll.stderr | 17 -- .../higher-ranked-projection.bad.stderr | 6 +- .../higher-ranked-projection.badbase.stderr | 2 +- .../higher-ranked-projection.badnll.stderr | 17 +- .../higher-ranked-projection.rs | 9 +- .../ui/async-await/issue-76547.base.stderr | 31 --- src/test/ui/async-await/issue-76547.rs | 10 +- ...ue-76547.nll.stderr => issue-76547.stderr} | 4 +- .../issues/issue-62097.base.stderr | 18 -- src/test/ui/async-await/issues/issue-62097.rs | 9 +- ...ue-62097.nll.stderr => issue-62097.stderr} | 7 +- .../issues/issue-63388-1.base.stderr | 12 - .../ui/async-await/issues/issue-63388-1.rs | 7 +- ...3388-1.nll.stderr => issue-63388-1.stderr} | 3 +- .../issues/issue-72312.base.stderr | 23 -- src/test/ui/async-await/issues/issue-72312.rs | 21 +- ...ue-72312.nll.stderr => issue-72312.stderr} | 3 +- .../ret-impl-trait-one.base.stderr | 34 --- .../multiple-lifetimes/ret-impl-trait-one.rs | 7 +- ...e.nll.stderr => ret-impl-trait-one.stderr} | 5 +- .../ui/borrowck/borrowck-drop-from-guard.rs | 2 - .../borrowck/borrowck-drop-from-guard.stderr | 2 +- ...ature-nll-overrides-migrate.edition.stderr | 13 - .../borrowck-feature-nll-overrides-migrate.rs | 30 --- ...feature-nll-overrides-migrate.zflag.stderr | 13 - src/test/ui/borrowck/borrowck-local-borrow.rs | 3 - ...rrow-from-shorter-lived-andmut.base.stderr | 13 - ...owck-reborrow-from-shorter-lived-andmut.rs | 7 +- ...reborrow-from-shorter-lived-andmut.stderr} | 2 +- ...rowck-migrate-scans-parents.migrate.stderr | 54 ---- ...ue-55492-borrowck-migrate-scans-parents.rs | 26 +- ...492-borrowck-migrate-scans-parents.stderr} | 12 +- src/test/ui/borrowck/issue-71546.rs | 10 +- src/test/ui/borrowck/issue-71546.stderr | 59 ++++- ...ion-sharing-interference.nll_target.stderr | 8 +- ...o-phase-activation-sharing-interference.rs | 4 +- ...ccess-during-reservation.nll_target.stderr | 4 +- ...o-phase-allow-access-during-reservation.rs | 4 +- .../two-phase-cannot-nest-mut-self-calls.rs | 2 - ...wo-phase-cannot-nest-mut-self-calls.stderr | 2 +- .../ui/borrowck/two-phase-method-receivers.rs | 2 - .../two-phase-multiple-activations.rs | 2 - .../two-phase-nonrecv-autoref.base.stderr | 22 +- .../two-phase-nonrecv-autoref.nll.stderr | 93 ------- .../ui/borrowck/two-phase-nonrecv-autoref.rs | 5 +- ...rvation-sharing-interference-2.base.stderr | 25 -- ...-sharing-interference-2.migrate2015.stderr | 25 -- ...ervation-sharing-interference-2.nll.stderr | 25 -- ...tion-sharing-interference-2.nll2015.stderr | 25 -- ...tion-sharing-interference-2.nll2018.stderr | 25 -- ...hase-reservation-sharing-interference-2.rs | 14 +- ...reservation-sharing-interference-2.stderr} | 4 +- ...ion-sharing-interference.nll_target.stderr | 2 +- ...-phase-reservation-sharing-interference.rs | 4 +- src/test/ui/borrowck/two-phase-sneaky.rs | 2 - src/test/ui/borrowck/two-phase-sneaky.stderr | 2 +- .../expect-fn-supply-fn.base.stderr | 68 ----- .../expect-fn-supply-fn.rs | 10 +- ....nll.stderr => expect-fn-supply-fn.stderr} | 10 +- ...s-static-cant-capture-borrowed.base.stderr | 28 -- ...ure-bounds-static-cant-capture-borrowed.rs | 9 +- ...ounds-static-cant-capture-borrowed.stderr} | 8 +- .../expect-region-supply-region-2.base.stderr | 55 ---- .../expect-region-supply-region-2.rs | 10 +- ...r => expect-region-supply-region-2.stderr} | 4 +- .../ui/const-generics/invariant.base.stderr | 26 -- src/test/ui/const-generics/invariant.rs | 4 - ...{invariant.nll.stderr => invariant.stderr} | 4 +- .../ui/consts/const-blocks/migrate-fail.rs | 2 - .../consts/const-blocks/migrate-fail.stderr | 4 +- .../ui/consts/const-blocks/migrate-pass.rs | 2 - src/test/ui/consts/const-blocks/nll-fail.rs | 1 - .../ui/consts/const-blocks/nll-fail.stderr | 4 +- src/test/ui/consts/const-blocks/nll-pass.rs | 1 - ...E0161.migrate.stderr => E0161.base.stderr} | 2 +- src/test/ui/error-codes/E0161.edition.stderr | 9 - src/test/ui/error-codes/E0161.nll.stderr | 9 - src/test/ui/error-codes/E0161.rs | 26 +- src/test/ui/error-codes/E0161.zflags.stderr | 9 - src/test/ui/error-codes/E0490.base.stderr | 76 ------ src/test/ui/error-codes/E0490.nll.stderr | 28 -- src/test/ui/error-codes/E0490.rs | 14 - src/test/ui/feature-gates/feature-gate-nll.rs | 18 -- .../ui/feature-gates/feature-gate-nll.stderr | 14 - ...-bounds-unnorm-associated-type.base.stderr | 13 - .../implied-bounds-unnorm-associated-type.rs | 7 +- ...lied-bounds-unnorm-associated-type.stderr} | 2 +- .../generator/auto-trait-regions.base.stderr | 38 --- src/test/ui/generator/auto-trait-regions.rs | 10 +- ...s.nll.stderr => auto-trait-regions.stderr} | 8 +- .../generator-region-requirements.base.stderr | 15 -- .../generator-region-requirements.rs | 7 +- ...r => generator-region-requirements.stderr} | 2 +- .../resume-arg-late-bound.base.stderr | 49 ---- .../ui/generator/resume-arg-late-bound.rs | 5 - ...ll.stderr => resume-arg-late-bound.stderr} | 4 +- .../bugs/issue-89352.base.stderr | 22 -- .../extended/lending_iterator.base.stderr | 18 +- .../extended/lending_iterator.rs | 3 - .../{bugs => }/issue-89352.rs | 14 +- .../generic-associated-types/issue-91139.rs | 12 +- .../generic-associated-types/issue-92096.rs | 8 +- ...jection-type-lifetime-mismatch.base.stderr | 33 --- .../projection-type-lifetime-mismatch.rs | 13 +- ... projection-type-lifetime-mismatch.stderr} | 6 +- .../trait-objects.base.stderr | 4 +- .../trait-objects.extended.stderr | 15 +- .../generic-associated-types/trait-objects.rs | 4 +- .../issue-59311.base.stderr | 15 -- .../higher-rank-trait-bounds/issue-59311.rs | 9 +- ...ue-59311.nll.stderr => issue-59311.stderr} | 6 +- .../issue-71955.base.stderr | 20 -- .../issue-71955.migrate.stderr | 77 +++++- .../normalize-under-binder/issue-71955.rs | 14 +- ...ue-71955.nll.stderr => issue-71955.stderr} | 24 +- ...ll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr | 17 -- .../hr-subtype-nll.bound_a_vs_free_x.stderr | 17 -- ...pe-nll.bound_inv_a_b_vs_bound_inv_a.stderr | 31 --- ...ubtype-nll.free_inv_x_vs_free_inv_y.stderr | 42 --- .../hr-subtype-nll.free_x_vs_free_y.stderr | 19 -- src/test/ui/hr-subtype/hr-subtype-nll.rs | 117 --------- ...pe.bound_a_b_ret_a_vs_bound_a_ret_a.stderr | 4 +- .../hr-subtype.bound_a_vs_free_x.stderr | 6 +- ...ubtype.bound_inv_a_b_vs_bound_inv_a.stderr | 20 +- ...hr-subtype.free_inv_x_vs_free_inv_y.stderr | 69 ++--- .../hr-subtype.free_x_vs_free_y.stderr | 32 +-- src/test/ui/hr-subtype/hr-subtype.rs | 10 +- .../placeholder-pattern-fail.base.stderr | 42 --- .../ui/hr-subtype/placeholder-pattern-fail.rs | 6 - ...stderr => placeholder-pattern-fail.stderr} | 2 +- .../ui/hrtb/hrtb-conflate-regions.base.stderr | 11 - src/test/ui/hrtb/hrtb-conflate-regions.rs | 9 +- ...ll.stderr => hrtb-conflate-regions.stderr} | 4 +- ...sts-forall-trait-contravariant.base.stderr | 11 - .../hrtb-exists-forall-trait-contravariant.rs | 4 - ...-exists-forall-trait-contravariant.stderr} | 2 +- ...-exists-forall-trait-invariant.base.stderr | 11 - .../hrtb-exists-forall-trait-invariant.rs | 4 - ...hrtb-exists-forall-trait-invariant.stderr} | 2 +- .../ui/hrtb/hrtb-just-for-static.base.stderr | 20 -- src/test/ui/hrtb/hrtb-just-for-static.rs | 9 +- ...nll.stderr => hrtb-just-for-static.stderr} | 6 +- .../hrtb/hrtb-perfect-forwarding.base.stderr | 20 -- src/test/ui/hrtb/hrtb-perfect-forwarding.rs | 15 +- ....stderr => hrtb-perfect-forwarding.stderr} | 14 +- src/test/ui/hrtb/issue-30786.nll.stderr | 53 ---- src/test/ui/hrtb/issue-30786.rs | 4 - ...e-30786.base.stderr => issue-30786.stderr} | 28 +- src/test/ui/hrtb/issue-46989.base.stderr | 11 - src/test/ui/hrtb/issue-46989.rs | 4 - ...ue-46989.nll.stderr => issue-46989.stderr} | 2 +- .../dyn-trait.base.stderr | 17 -- .../impl-header-lifetime-elision/dyn-trait.rs | 7 +- ...{dyn-trait.nll.stderr => dyn-trait.stderr} | 2 +- .../ordinary-bounds-pick-original-elided.rs | 4 +- ...nds-pick-original-type-alias-impl-trait.rs | 2 - .../ordinary-bounds-pick-original.rs | 2 - .../ordinary-bounds-pick-other.rs | 2 - ..._outlive_least_region_or_bound.base.stderr | 227 ---------------- .../must_outlive_least_region_or_bound.rs | 23 +- ...must_outlive_least_region_or_bound.stderr} | 20 +- .../type_parameters_captured.base.stderr | 14 - .../ui/impl-trait/type_parameters_captured.rs | 7 +- ...stderr => type_parameters_captured.stderr} | 2 +- src/test/ui/issues/issue-10291.base.stderr | 25 -- src/test/ui/issues/issue-10291.rs | 7 +- ...ue-10291.nll.stderr => issue-10291.stderr} | 2 +- src/test/ui/issues/issue-13058.base.stderr | 12 - src/test/ui/issues/issue-13058.rs | 4 - ...ue-13058.nll.stderr => issue-13058.stderr} | 2 +- src/test/ui/issues/issue-15034.base.stderr | 11 - src/test/ui/issues/issue-15034.rs | 4 - ...ue-15034.nll.stderr => issue-15034.stderr} | 2 +- src/test/ui/issues/issue-16683.base.stderr | 32 --- src/test/ui/issues/issue-16683.rs | 7 +- ...ue-16683.nll.stderr => issue-16683.stderr} | 2 +- src/test/ui/issues/issue-16922.base.stderr | 16 -- src/test/ui/issues/issue-16922.rs | 7 +- ...ue-16922.nll.stderr => issue-16922.stderr} | 2 +- src/test/ui/issues/issue-17728.base.stderr | 39 --- src/test/ui/issues/issue-17728.rs | 5 - ...ue-17728.nll.stderr => issue-17728.stderr} | 2 +- src/test/ui/issues/issue-17758.base.stderr | 32 --- src/test/ui/issues/issue-17758.rs | 7 +- ...ue-17758.nll.stderr => issue-17758.stderr} | 2 +- src/test/ui/issues/issue-26217.base.stderr | 9 - src/test/ui/issues/issue-26217.rs | 7 +- ...ue-26217.nll.stderr => issue-26217.stderr} | 2 +- src/test/ui/issues/issue-40000.base.stderr | 12 - src/test/ui/issues/issue-40000.rs | 8 +- ...ue-40000.nll.stderr => issue-40000.stderr} | 4 +- src/test/ui/issues/issue-46983.base.stderr | 11 - src/test/ui/issues/issue-46983.rs | 7 +- ...ue-46983.nll.stderr => issue-46983.stderr} | 2 +- src/test/ui/issues/issue-52533.base.stderr | 20 -- src/test/ui/issues/issue-52533.rs | 7 +- ...ue-52533.nll.stderr => issue-52533.stderr} | 2 +- .../ui/issues/issue-54302-cases.base.stderr | 38 --- src/test/ui/issues/issue-54302-cases.rs | 4 - ...es.nll.stderr => issue-54302-cases.stderr} | 8 +- src/test/ui/issues/issue-54943.base.stderr | 15 -- src/test/ui/issues/issue-54943.rs | 4 - ...ue-54943.nll.stderr => issue-54943.stderr} | 2 +- src/test/ui/issues/issue-55731.base.stderr | 11 - src/test/ui/issues/issue-55731.rs | 4 - ...ue-55731.nll.stderr => issue-55731.stderr} | 2 +- src/test/ui/issues/issue-55796.base.stderr | 53 ---- src/test/ui/issues/issue-55796.rs | 10 +- ...ue-55796.nll.stderr => issue-55796.stderr} | 4 +- src/test/ui/issues/issue-75777.base.stderr | 30 --- src/test/ui/issues/issue-75777.rs | 7 +- ...ue-75777.nll.stderr => issue-75777.stderr} | 2 +- .../kindck-impl-type-params.base.stderr | 112 -------- src/test/ui/kindck/kindck-impl-type-params.rs | 5 - ....stderr => kindck-impl-type-params.stderr} | 24 +- .../ui/kindck/kindck-send-object1.base.stderr | 45 ---- src/test/ui/kindck/kindck-send-object1.rs | 5 - ....nll.stderr => kindck-send-object1.stderr} | 8 +- src/test/ui/lifetimes/copy_modulo_regions.rs | 2 - .../ui/lifetimes/copy_modulo_regions.stderr | 2 +- .../ui/lifetimes/issue-79187-2.base.stderr | 60 ----- src/test/ui/lifetimes/issue-79187-2.rs | 19 +- ...9187-2.nll.stderr => issue-79187-2.stderr} | 20 +- src/test/ui/lifetimes/issue-79187.base.stderr | 11 - src/test/ui/lifetimes/issue-79187.rs | 6 +- ...ue-79187.nll.stderr => issue-79187.stderr} | 8 +- .../issue-90170-elision-mismatch-nll.fixed | 15 -- .../issue-90170-elision-mismatch-nll.rs | 15 -- .../issue-90170-elision-mismatch-nll.stderr | 44 ---- .../issue-90170-elision-mismatch.fixed | 11 +- .../lifetimes/issue-90170-elision-mismatch.rs | 11 +- .../issue-90170-elision-mismatch.stderr | 37 ++- ...xpected-return-static-indirect.base.stderr | 14 - ...e-90600-expected-return-static-indirect.rs | 9 +- ...00-expected-return-static-indirect.stderr} | 6 +- ...time-bound-will-change-warning.base.stderr | 33 --- .../lifetime-bound-will-change-warning.rs | 10 +- ...lifetime-bound-will-change-warning.stderr} | 4 +- ...isting-name-if-else-using-impl.base.stderr | 14 - ...rn-one-existing-name-if-else-using-impl.rs | 7 +- ...e-existing-name-if-else-using-impl.stderr} | 2 +- ...sting-name-return-type-is-anon.base.stderr | 14 - ...n-one-existing-name-return-type-is-anon.rs | 7 +- ...-existing-name-return-type-is-anon.stderr} | 2 +- ...one-existing-name-self-is-anon.base.stderr | 14 - ...1-return-one-existing-name-self-is-anon.rs | 7 +- ...urn-one-existing-name-self-is-anon.stderr} | 2 +- .../ex2a-push-one-existing-name-2.base.stderr | 11 - .../ex2a-push-one-existing-name-2.rs | 4 - ...r => ex2a-push-one-existing-name-2.stderr} | 2 +- ...-one-existing-name-early-bound.base.stderr | 12 - ...ex2a-push-one-existing-name-early-bound.rs | 4 - ...push-one-existing-name-early-bound.stderr} | 2 +- .../ex2a-push-one-existing-name.base.stderr | 11 - .../ex2a-push-one-existing-name.rs | 4 - ...err => ex2a-push-one-existing-name.stderr} | 2 +- .../ex2b-push-no-existing-names.base.stderr | 11 - .../ex2b-push-no-existing-names.rs | 7 +- ...err => ex2b-push-no-existing-names.stderr} | 2 +- .../ex2c-push-inference-variable.base.stderr | 12 - .../ex2c-push-inference-variable.rs | 7 +- ...rr => ex2c-push-inference-variable.stderr} | 2 +- ...ex2d-push-inference-variable-2.base.stderr | 11 - .../ex2d-push-inference-variable-2.rs | 7 +- ... => ex2d-push-inference-variable-2.stderr} | 2 +- ...ex2e-push-inference-variable-3.base.stderr | 11 - .../ex2e-push-inference-variable-3.rs | 7 +- ... => ex2e-push-inference-variable-3.stderr} | 2 +- .../ex3-both-anon-regions-2.base.stderr | 17 -- .../ex3-both-anon-regions-2.rs | 7 +- ....stderr => ex3-both-anon-regions-2.stderr} | 2 +- .../ex3-both-anon-regions-3.base.stderr | 31 --- .../ex3-both-anon-regions-3.rs | 10 +- ....stderr => ex3-both-anon-regions-3.stderr} | 4 +- ...non-regions-both-are-structs-2.base.stderr | 11 - ...x3-both-anon-regions-both-are-structs-2.rs | 7 +- ...th-anon-regions-both-are-structs-2.stderr} | 2 +- ...non-regions-both-are-structs-3.base.stderr | 11 - ...x3-both-anon-regions-both-are-structs-3.rs | 7 +- ...th-anon-regions-both-are-structs-3.stderr} | 2 +- ...are-structs-earlybound-regions.base.stderr | 12 - ...ons-both-are-structs-earlybound-regions.rs | 7 +- ...oth-are-structs-earlybound-regions.stderr} | 2 +- ...-are-structs-latebound-regions.base.stderr | 11 - ...ions-both-are-structs-latebound-regions.rs | 7 +- ...both-are-structs-latebound-regions.stderr} | 2 +- ...-anon-regions-both-are-structs.base.stderr | 11 - .../ex3-both-anon-regions-both-are-structs.rs | 7 +- ...both-anon-regions-both-are-structs.stderr} | 2 +- ...anon-regions-latebound-regions.base.stderr | 11 - ...ex3-both-anon-regions-latebound-regions.rs | 7 +- ...oth-anon-regions-latebound-regions.stderr} | 2 +- ...h-anon-regions-one-is-struct-2.base.stderr | 13 - .../ex3-both-anon-regions-one-is-struct-2.rs | 9 +- ...-both-anon-regions-one-is-struct-2.stderr} | 4 +- ...h-anon-regions-one-is-struct-3.base.stderr | 11 - .../ex3-both-anon-regions-one-is-struct-3.rs | 7 +- ...-both-anon-regions-one-is-struct-3.stderr} | 2 +- ...h-anon-regions-one-is-struct-4.base.stderr | 11 - .../ex3-both-anon-regions-one-is-struct-4.rs | 7 +- ...-both-anon-regions-one-is-struct-4.stderr} | 2 +- ...oth-anon-regions-one-is-struct.base.stderr | 11 - .../ex3-both-anon-regions-one-is-struct.rs | 7 +- ...x3-both-anon-regions-one-is-struct.stderr} | 2 +- ...on-regions-return-type-is-anon.base.stderr | 19 -- ...3-both-anon-regions-return-type-is-anon.rs | 7 +- ...h-anon-regions-return-type-is-anon.stderr} | 2 +- ...both-anon-regions-self-is-anon.base.stderr | 19 -- .../ex3-both-anon-regions-self-is-anon.rs | 7 +- ...ex3-both-anon-regions-self-is-anon.stderr} | 2 +- ...th-anon-regions-using-fn-items.base.stderr | 17 -- .../ex3-both-anon-regions-using-fn-items.rs | 9 +- ...3-both-anon-regions-using-fn-items.stderr} | 4 +- ...-anon-regions-using-impl-items.base.stderr | 17 -- .../ex3-both-anon-regions-using-impl-items.rs | 7 +- ...both-anon-regions-using-impl-items.stderr} | 2 +- ...on-regions-using-trait-objects.base.stderr | 17 -- ...3-both-anon-regions-using-trait-objects.rs | 9 +- ...h-anon-regions-using-trait-objects.stderr} | 4 +- .../ex3-both-anon-regions.base.stderr | 17 -- .../lifetime-errors/ex3-both-anon-regions.rs | 7 +- ...ll.stderr => ex3-both-anon-regions.stderr} | 2 +- .../lifetime-errors/issue_74400.base.stderr | 11 - .../lifetimes/lifetime-errors/issue_74400.rs | 11 +- ...ue_74400.nll.stderr => issue_74400.stderr} | 8 +- .../lifetimes/re-empty-in-error.base.stderr | 15 -- src/test/ui/lifetimes/re-empty-in-error.rs | 10 +- ...or.nll.stderr => re-empty-in-error.stderr} | 2 +- .../old-lub-glb-hr-noteq1.basenoleak.stderr | 15 +- ...derr => old-lub-glb-hr-noteq1.leak.stderr} | 13 +- .../old-lub-glb-hr-noteq1.nllleak.stderr | 21 +- .../old-lub-glb-hr-noteq1.nllnoleak.stderr | 12 +- .../old-lub-glb-hr-noteq1.noleak.stderr | 12 + src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs | 13 +- ...derr => old-lub-glb-hr-noteq2.leak.stderr} | 4 +- .../old-lub-glb-hr-noteq2.nllleak.stderr | 21 -- src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs | 13 +- .../ui/lub-glb/old-lub-glb-object.base.stderr | 19 -- src/test/ui/lub-glb/old-lub-glb-object.rs | 9 +- ...t.nll.stderr => old-lub-glb-object.stderr} | 4 +- .../match-ref-mut-invariance.base.stderr | 22 -- src/test/ui/match/match-ref-mut-invariance.rs | 7 +- ...stderr => match-ref-mut-invariance.stderr} | 2 +- .../match-ref-mut-let-invariance.base.stderr | 22 -- .../ui/match/match-ref-mut-let-invariance.rs | 7 +- ...rr => match-ref-mut-let-invariance.stderr} | 2 +- .../meta-expected-error-wrong-rev.a.stderr | 2 +- .../ui/meta/meta-expected-error-wrong-rev.rs | 1 - .../closure-arg-type-mismatch.base.stderr | 102 -------- .../closure-arg-type-mismatch.rs | 8 - ...tderr => closure-arg-type-mismatch.stderr} | 6 +- .../closure-mismatch.base.stderr | 22 -- .../ui/mismatched_types/closure-mismatch.rs | 9 +- ...tch.nll.stderr => closure-mismatch.stderr} | 8 +- .../escape-argument-callee.rs | 2 +- .../closure-requirements/escape-argument.rs | 2 +- .../escape-upvar-nested.rs | 2 +- .../closure-requirements/escape-upvar-ref.rs | 2 +- .../propagate-approximated-fail-no-postdom.rs | 2 +- .../propagate-approximated-ref.rs | 2 +- ...horter-to-static-comparing-against-free.rs | 2 +- ...approximated-shorter-to-static-no-bound.rs | 2 +- ...roximated-shorter-to-static-wrong-bound.rs | 2 +- .../propagate-approximated-val.rs | 2 +- .../propagate-despite-same-free-region.rs | 2 +- ...te-fail-to-approximate-longer-no-bounds.rs | 2 +- ...fail-to-approximate-longer-wrong-bounds.rs | 2 +- .../propagate-from-trait-match.rs | 2 +- ...region-lbr-anon-does-not-outlive-static.rs | 2 +- ...egion-lbr-named-does-not-outlive-static.rs | 2 +- .../region-lbr1-does-not-outlive-ebr2.rs | 2 +- ...does-outlive-lbr2-because-implied-bound.rs | 2 +- .../return-wrong-bound-region.rs | 2 +- src/test/ui/nll/constant.rs | 1 - .../continue-after-missing-main.base.stderr | 19 -- .../ui/nll/continue-after-missing-main.rs | 5 - ...err => continue-after-missing-main.stderr} | 2 +- src/test/ui/nll/drop-may-dangle.rs | 1 - src/test/ui/nll/drop-no-may-dangle.rs | 2 - src/test/ui/nll/drop-no-may-dangle.stderr | 4 +- src/test/ui/nll/extra-unused-mut.rs | 2 +- .../ui/nll/generator-distinct-lifetime.rs | 2 +- src/test/ui/nll/generator-upvar-mutability.rs | 2 +- src/test/ui/nll/guarantor-issue-46974.rs | 2 - src/test/ui/nll/guarantor-issue-46974.stderr | 4 +- ...ssue-42574-diagnostic-in-nested-closure.rs | 2 - ...-42574-diagnostic-in-nested-closure.stderr | 4 +- .../nll/issue-45696-no-variant-box-recur.rs | 3 - src/test/ui/nll/issue-48070.rs | 1 - src/test/ui/nll/issue-50716.base.stderr | 18 -- src/test/ui/nll/issue-50716.rs | 4 - ...ue-50716.nll.stderr => issue-50716.stderr} | 2 +- src/test/ui/nll/issue-51770.rs | 1 - src/test/ui/nll/issue-52113.rs | 2 - src/test/ui/nll/issue-52113.stderr | 2 +- src/test/ui/nll/issue-52213.base.stderr | 32 --- src/test/ui/nll/issue-52213.rs | 7 +- ...ue-52213.nll.stderr => issue-52213.stderr} | 4 +- src/test/ui/nll/issue-52533-1.base.stderr | 22 -- src/test/ui/nll/issue-52533-1.rs | 7 +- ...2533-1.nll.stderr => issue-52533-1.stderr} | 2 +- src/test/ui/nll/issue-52742.base.stderr | 20 -- src/test/ui/nll/issue-52742.rs | 5 - ...ue-52742.nll.stderr => issue-52742.stderr} | 2 +- .../nll/issue-54779-anon-static-lifetime.rs | 2 - .../issue-54779-anon-static-lifetime.stderr | 2 +- src/test/ui/nll/issue-54943-3.rs | 1 - src/test/ui/nll/issue-55394.base.stderr | 32 --- src/test/ui/nll/issue-55394.rs | 4 - ...ue-55394.nll.stderr => issue-55394.stderr} | 2 +- src/test/ui/nll/issue-55401.base.stderr | 16 -- src/test/ui/nll/issue-55401.rs | 4 - ...ue-55401.nll.stderr => issue-55401.stderr} | 2 +- src/test/ui/nll/issue-55825-const-fn.rs | 2 - .../nll/issue-57642-higher-ranked-subtype.rs | 3 - .../issue-57642-higher-ranked-subtype.stderr | 8 +- src/test/ui/nll/issue-58053.rs | 2 - src/test/ui/nll/issue-58053.stderr | 4 +- src/test/ui/nll/issue-58299.rs | 2 - src/test/ui/nll/issue-58299.stderr | 4 +- src/test/ui/nll/issue-67007-escaping-data.rs | 2 - .../ui/nll/issue-67007-escaping-data.stderr | 2 +- src/test/ui/nll/issue-73159-rpit-static.rs | 2 - .../ui/nll/issue-73159-rpit-static.stderr | 2 +- src/test/ui/nll/issue-95272.rs | 2 - src/test/ui/nll/issue-95272.stderr | 2 +- src/test/ui/nll/lub-if.base.stderr | 29 --- src/test/ui/nll/lub-if.rs | 10 +- .../nll/{lub-if.nll.stderr => lub-if.stderr} | 4 +- src/test/ui/nll/lub-match.base.stderr | 29 --- src/test/ui/nll/lub-match.rs | 10 +- ...{lub-match.nll.stderr => lub-match.stderr} | 4 +- src/test/ui/nll/match-cfg-fake-edges2.rs | 2 - src/test/ui/nll/match-cfg-fake-edges2.stderr | 2 +- .../maybe-initialized-drop-uninitialized.rs | 1 - .../maybe-initialized-drop-with-fragment.rs | 2 - ...aybe-initialized-drop-with-fragment.stderr | 2 +- ...lized-drop-with-uninitialized-fragments.rs | 2 - ...d-drop-with-uninitialized-fragments.stderr | 2 +- src/test/ui/nll/maybe-initialized-drop.rs | 2 - src/test/ui/nll/maybe-initialized-drop.stderr | 2 +- src/test/ui/nll/mir_check_cast_closure.rs | 2 - src/test/ui/nll/mir_check_cast_closure.stderr | 2 +- src/test/ui/nll/mir_check_cast_reify.rs | 2 - src/test/ui/nll/mir_check_cast_reify.stderr | 2 +- src/test/ui/nll/mir_check_cast_unsafe_fn.rs | 2 - .../ui/nll/mir_check_cast_unsafe_fn.stderr | 2 +- src/test/ui/nll/mir_check_cast_unsize.rs | 2 - src/test/ui/nll/mir_check_cast_unsize.stderr | 2 +- src/test/ui/nll/outlives-suggestion-more.rs | 2 - .../ui/nll/outlives-suggestion-more.stderr | 14 +- src/test/ui/nll/outlives-suggestion-simple.rs | 2 - .../ui/nll/outlives-suggestion-simple.stderr | 18 +- .../ui/nll/polonius/assignment-kills-loans.rs | 3 +- .../polonius/assignment-to-differing-field.rs | 3 +- .../assignment-to-differing-field.stderr | 8 +- src/test/ui/nll/polonius/call-kills-loans.rs | 3 +- src/test/ui/nll/polonius/issue-46589.rs | 3 +- .../ui/nll/polonius/polonius-smoke-test.rs | 3 +- .../nll/polonius/polonius-smoke-test.stderr | 8 +- .../nll/polonius/storagedead-kills-loans.rs | 3 +- src/test/ui/nll/polonius/subset-relations.rs | 3 +- .../ui/nll/polonius/subset-relations.stderr | 2 +- src/test/ui/nll/projection-return.rs | 1 - src/test/ui/nll/relate_tys/fn-subtype.rs | 2 - src/test/ui/nll/relate_tys/fn-subtype.stderr | 2 +- .../ui/nll/relate_tys/hr-fn-aaa-as-aba.rs | 2 - .../ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr | 4 +- .../ui/nll/relate_tys/hr-fn-aau-eq-abu.rs | 2 - .../ui/nll/relate_tys/hr-fn-aba-as-aaa.rs | 2 - .../impl-fn-ignore-binder-via-bottom.rs | 6 +- .../impl-fn-ignore-binder-via-bottom.stderr | 4 +- src/test/ui/nll/relate_tys/opaque-hrtb.rs | 2 - src/test/ui/nll/relate_tys/opaque-hrtb.stderr | 2 +- src/test/ui/nll/relate_tys/trait-hrtb.rs | 2 - src/test/ui/nll/relate_tys/trait-hrtb.stderr | 2 +- .../ui/nll/relate_tys/universe-violation.rs | 2 - .../nll/relate_tys/universe-violation.stderr | 2 +- .../ui/nll/ty-outlives/impl-trait-captures.rs | 2 +- .../ui/nll/ty-outlives/impl-trait-outlives.rs | 2 +- .../ty-outlives/projection-implied-bounds.rs | 2 +- .../projection-no-regions-closure.rs | 2 +- .../ty-outlives/projection-no-regions-fn.rs | 2 +- .../projection-one-region-closure.rs | 2 +- ...ojection-one-region-trait-bound-closure.rs | 2 +- ...n-one-region-trait-bound-static-closure.rs | 2 +- ...ojection-two-region-trait-bound-closure.rs | 2 +- ...n-where-clause-env-wrong-bound.base.stderr | 17 -- ...projection-where-clause-env-wrong-bound.rs | 4 - ...ction-where-clause-env-wrong-bound.stderr} | 2 +- ...here-clause-env-wrong-lifetime.base.stderr | 17 -- ...jection-where-clause-env-wrong-lifetime.rs | 7 +- ...on-where-clause-env-wrong-lifetime.stderr} | 2 +- .../projection-where-clause-none.rs | 2 - .../projection-where-clause-none.stderr | 2 +- .../projection-where-clause-trait.rs | 2 - ...y-param-closure-approximate-lower-bound.rs | 2 +- ...param-closure-outlives-from-return-type.rs | 2 +- ...aram-closure-outlives-from-where-clause.rs | 2 +- .../ui/nll/ty-outlives/ty-param-fn-body.rs | 2 - .../nll/ty-outlives/ty-param-fn-body.stderr | 2 +- src/test/ui/nll/ty-outlives/ty-param-fn.rs | 2 - .../ui/nll/ty-outlives/ty-param-fn.stderr | 4 +- .../ty-outlives/ty-param-implied-bounds.rs | 2 +- src/test/ui/nll/ty-outlives/wf-unreachable.rs | 2 - .../ui/nll/ty-outlives/wf-unreachable.stderr | 16 +- .../nll/type-alias-free-regions.base.stderr | 65 ----- src/test/ui/nll/type-alias-free-regions.rs | 4 - ....stderr => type-alias-free-regions.stderr} | 4 +- .../ui/nll/type-check-pointer-coercions.rs | 2 - .../nll/type-check-pointer-coercions.stderr | 16 +- .../ui/nll/type-check-pointer-comparisons.rs | 2 - .../nll/type-check-pointer-comparisons.stderr | 12 +- .../ui/nll/user-annotations/closure-substs.rs | 2 - .../user-annotations/closure-substs.stderr | 8 +- .../constant-in-expr-inherent-1.base.stderr | 11 - .../constant-in-expr-inherent-1.rs | 4 - ...err => constant-in-expr-inherent-1.stderr} | 2 +- .../constant-in-expr-normalize.base.stderr | 16 -- .../constant-in-expr-normalize.rs | 4 - ...derr => constant-in-expr-normalize.stderr} | 2 +- .../constant-in-expr-trait-item-1.base.stderr | 16 -- .../constant-in-expr-trait-item-1.rs | 4 - ...r => constant-in-expr-trait-item-1.stderr} | 2 +- .../constant-in-expr-trait-item-2.base.stderr | 16 -- .../constant-in-expr-trait-item-2.rs | 4 - ...r => constant-in-expr-trait-item-2.stderr} | 2 +- .../constant-in-expr-trait-item-3.base.stderr | 28 -- .../constant-in-expr-trait-item-3.rs | 4 - ...r => constant-in-expr-trait-item-3.stderr} | 2 +- .../user-annotations/dump-adt-brace-struct.rs | 1 - .../dump-adt-brace-struct.stderr | 2 +- .../ui/nll/user-annotations/dump-fn-method.rs | 1 - .../user-annotations/dump-fn-method.stderr | 8 +- .../inherent-associated-constants.rs | 2 - .../inherent-associated-constants.stderr | 2 +- .../ui/nll/user-annotations/issue-54124.rs | 2 - .../nll/user-annotations/issue-54124.stderr | 4 +- ...ssue-55748-pat-types-constrain-bindings.rs | 2 - ...-55748-pat-types-constrain-bindings.stderr | 6 +- .../issue-57731-ascibed-coupled-types.rs | 2 +- .../method-ufcs-inherent-1.rs | 2 - .../method-ufcs-inherent-1.stderr | 2 +- .../method-ufcs-inherent-3.rs | 2 - .../method-ufcs-inherent-3.stderr | 2 +- src/test/ui/nll/user-annotations/patterns.rs | 2 - .../ui/nll/user-annotations/patterns.stderr | 38 +-- .../ui/nll/user-annotations/wf-self-type.rs | 2 - .../nll/user-annotations/wf-self-type.stderr | 2 +- src/test/ui/nll/where_clauses_in_functions.rs | 2 - .../ui/nll/where_clauses_in_functions.stderr | 2 +- src/test/ui/nll/where_clauses_in_structs.rs | 2 - .../ui/nll/where_clauses_in_structs.stderr | 2 +- ...bject-lifetime-default-elision.base.stderr | 61 ----- .../object-lifetime-default-elision.rs | 8 +- ...=> object-lifetime-default-elision.stderr} | 2 +- ...ifetime-default-from-box-error.base.stderr | 35 --- .../object-lifetime-default-from-box-error.rs | 9 +- ...ct-lifetime-default-from-box-error.stderr} | 6 +- ...me-default-from-rptr-box-error.base.stderr | 18 -- ...ct-lifetime-default-from-rptr-box-error.rs | 7 +- ...fetime-default-from-rptr-box-error.stderr} | 2 +- ...default-from-rptr-struct-error.base.stderr | 18 -- ...lifetime-default-from-rptr-struct-error.rs | 7 +- ...ime-default-from-rptr-struct-error.stderr} | 2 +- .../object-lifetime-default-mybox.base.stderr | 31 --- .../object-lifetime-default-mybox.rs | 10 +- ...r => object-lifetime-default-mybox.stderr} | 4 +- .../object-lifetime-default.rs | 2 - .../object-lifetime-default.stderr | 14 +- .../issues/issue-14303-fncall.full.stderr | 2 +- .../issue-14303-fncall.generic_arg.stderr | 2 +- .../ui/parser/issues/issue-14303-fncall.rs | 1 - src/test/ui/regions/issue-28848.base.stderr | 20 -- src/test/ui/regions/issue-28848.rs | 7 +- ...ue-28848.nll.stderr => issue-28848.stderr} | 2 +- ...262.nll.stderr => issue-78262.base.stderr} | 2 +- .../ui/regions/issue-78262.default.stderr | 18 -- .../ui/regions/issue-78262.polonius.stderr | 2 +- src/test/ui/regions/issue-78262.rs | 10 +- ...variant-static-error-reporting.base.stderr | 25 -- ...region-invariant-static-error-reporting.rs | 11 +- ...n-invariant-static-error-reporting.stderr} | 2 +- ...ime-bounds-on-fns-where-clause.base.stderr | 31 --- ...ion-lifetime-bounds-on-fns-where-clause.rs | 6 - ...ifetime-bounds-on-fns-where-clause.stderr} | 2 +- ...ime-bounds-on-fns-where-clause.base.stderr | 42 --- ...ple-lifetime-bounds-on-fns-where-clause.rs | 8 +- ...ifetime-bounds-on-fns-where-clause.stderr} | 2 +- .../region-object-lifetime-2.base.stderr | 30 --- .../ui/regions/region-object-lifetime-2.rs | 7 +- ...stderr => region-object-lifetime-2.stderr} | 2 +- .../region-object-lifetime-4.base.stderr | 30 --- .../ui/regions/region-object-lifetime-4.rs | 7 +- ...stderr => region-object-lifetime-4.stderr} | 2 +- ...on-object-lifetime-in-coercion.base.stderr | 98 ------- .../region-object-lifetime-in-coercion.rs | 16 +- ...region-object-lifetime-in-coercion.stderr} | 8 +- .../regions/regions-addr-of-self.base.stderr | 11 - src/test/ui/regions/regions-addr-of-self.rs | 7 +- ...nll.stderr => regions-addr-of-self.stderr} | 2 +- .../regions-addr-of-upvar-self.base.stderr | 26 -- .../ui/regions/regions-addr-of-upvar-self.rs | 11 +- ...derr => regions-addr-of-upvar-self.stderr} | 6 +- ...pertrait-outlives-container.migrate.stderr | 20 -- ...c-type-in-supertrait-outlives-container.rs | 11 +- ...e-in-supertrait-outlives-container.stderr} | 2 +- ...nded-by-trait-requiring-static.base.stderr | 75 ------ ...gions-bounded-by-trait-requiring-static.rs | 22 +- ...-bounded-by-trait-requiring-static.stderr} | 12 +- ...od-type-parameters-cross-crate.base.stderr | 12 - ...nded-method-type-parameters-cross-crate.rs | 6 +- ...method-type-parameters-cross-crate.stderr} | 2 +- ...od-type-parameters-trait-bound.base.stderr | 12 - ...nded-method-type-parameters-trait-bound.rs | 7 +- ...method-type-parameters-trait-bound.stderr} | 2 +- ...bounded-method-type-parameters.base.stderr | 15 -- .../regions-bounded-method-type-parameters.rs | 7 +- ...ons-bounded-method-type-parameters.stderr} | 2 +- .../ui/regions/regions-bounds.base.stderr | 41 --- src/test/ui/regions/regions-bounds.rs | 10 +- ...ounds.nll.stderr => regions-bounds.stderr} | 4 +- ...se-associated-type-into-object.base.stderr | 40 --- ...gions-close-associated-type-into-object.rs | 4 - ...-close-associated-type-into-object.stderr} | 8 +- ...ons-close-object-into-object-2.base.stderr | 27 -- .../regions-close-object-into-object-2.rs | 9 +- ...regions-close-object-into-object-2.stderr} | 4 +- ...ons-close-object-into-object-4.base.stderr | 27 -- .../regions-close-object-into-object-4.rs | 17 +- ...regions-close-object-into-object-4.stderr} | 12 +- ...ons-close-object-into-object-5.base.stderr | 95 ------- .../regions-close-object-into-object-5.rs | 9 +- ...regions-close-object-into-object-5.stderr} | 10 +- ...ons-close-over-type-parameter-1.nll.stderr | 26 -- .../regions-close-over-type-parameter-1.rs | 4 - ...egions-close-over-type-parameter-1.stderr} | 4 +- ...e-over-type-parameter-multiple.base.stderr | 32 --- ...ions-close-over-type-parameter-multiple.rs | 7 +- ...close-over-type-parameter-multiple.stderr} | 2 +- ...egions-close-param-into-object.base.stderr | 48 ---- .../regions-close-param-into-object.rs | 4 - ...=> regions-close-param-into-object.stderr} | 8 +- .../regions-creating-enums3.base.stderr | 13 - .../ui/regions/regions-creating-enums3.rs | 7 +- ....stderr => regions-creating-enums3.stderr} | 2 +- .../regions-creating-enums4.base.stderr | 34 --- .../ui/regions/regions-creating-enums4.rs | 7 +- ....stderr => regions-creating-enums4.stderr} | 2 +- ...gions-early-bound-error-method.base.stderr | 20 -- .../regions-early-bound-error-method.rs | 7 +- ...> regions-early-bound-error-method.stderr} | 2 +- .../regions-early-bound-error.base.stderr | 20 -- .../ui/regions/regions-early-bound-error.rs | 7 +- ...tderr => regions-early-bound-error.stderr} | 2 +- ...fn-subtyping-return-static-fail.nll.stderr | 19 -- ...regions-fn-subtyping-return-static-fail.rs | 4 - ...ns-fn-subtyping-return-static-fail.stderr} | 4 +- ...ns-free-region-ordering-callee.base.stderr | 25 -- .../regions-free-region-ordering-callee.rs | 10 +- ...egions-free-region-ordering-callee.stderr} | 4 +- ...free-region-ordering-caller.migrate.stderr | 54 ---- .../regions-free-region-ordering-caller.rs | 20 +- ...egions-free-region-ordering-caller.stderr} | 6 +- ...free-region-ordering-incorrect.base.stderr | 33 --- .../regions-free-region-ordering-incorrect.rs | 8 +- ...ons-free-region-ordering-incorrect.stderr} | 2 +- ...mplied-bounds-projection-gap-1.base.stderr | 14 - ...regions-implied-bounds-projection-gap-1.rs | 4 - ...ns-implied-bounds-projection-gap-1.stderr} | 2 +- ...ns-infer-bound-from-trait-self.base.stderr | 17 -- .../regions-infer-bound-from-trait-self.rs | 4 - ...egions-infer-bound-from-trait-self.stderr} | 2 +- ...regions-infer-bound-from-trait.base.stderr | 35 --- .../regions/regions-infer-bound-from-trait.rs | 4 - ... => regions-infer-bound-from-trait.stderr} | 4 +- ...fer-contravariance-due-to-decl.base.stderr | 15 -- ...egions-infer-contravariance-due-to-decl.rs | 7 +- ...s-infer-contravariance-due-to-decl.stderr} | 2 +- ...s-infer-covariance-due-to-decl.base.stderr | 14 - .../regions-infer-covariance-due-to-decl.rs | 7 +- ...gions-infer-covariance-due-to-decl.stderr} | 2 +- ...s-infer-invariance-due-to-decl.base.stderr | 18 -- .../regions-infer-invariance-due-to-decl.rs | 7 +- ...gions-infer-invariance-due-to-decl.stderr} | 2 +- ...invariance-due-to-mutability-3.base.stderr | 18 -- ...ns-infer-invariance-due-to-mutability-3.rs | 7 +- ...fer-invariance-due-to-mutability-3.stderr} | 2 +- ...invariance-due-to-mutability-4.base.stderr | 18 -- ...ns-infer-invariance-due-to-mutability-4.rs | 7 +- ...fer-invariance-due-to-mutability-4.stderr} | 2 +- .../regions-infer-not-param.base.stderr | 60 ----- .../ui/regions/regions-infer-not-param.rs | 17 +- ....stderr => regions-infer-not-param.stderr} | 6 +- .../regions-infer-paramd-indirect.base.stderr | 22 -- .../regions/regions-infer-paramd-indirect.rs | 10 +- ...r => regions-infer-paramd-indirect.stderr} | 2 +- ...regions-lifetime-bounds-on-fns.base.stderr | 31 --- .../regions/regions-lifetime-bounds-on-fns.rs | 6 - ... => regions-lifetime-bounds-on-fns.stderr} | 2 +- .../ui/regions/regions-nested-fns.base.stderr | 78 ------ src/test/ui/regions/regions-nested-fns.rs | 14 +- ...s.nll.stderr => regions-nested-fns.stderr} | 8 +- ...s-projection-container-hrtb.migrate.stderr | 37 --- ...ions-outlives-projection-container-hrtb.rs | 14 +- ...outlives-projection-container-hrtb.stderr} | 4 +- ...ves-projection-container-wc.migrate.stderr | 20 -- ...egions-outlives-projection-container-wc.rs | 11 +- ...s-outlives-projection-container-wc.stderr} | 2 +- ...-outlives-projection-container.base.stderr | 71 ----- .../regions-outlives-projection-container.rs | 16 +- ...ions-outlives-projection-container.stderr} | 8 +- .../regions-proc-bound-capture.base.stderr | 29 --- .../ui/regions/regions-proc-bound-capture.rs | 7 +- ...derr => regions-proc-bound-capture.stderr} | 2 +- ...w-from-shorter-mut-ref-mut-ref.base.stderr | 13 - ...s-reborrow-from-shorter-mut-ref-mut-ref.rs | 7 +- ...orrow-from-shorter-mut-ref-mut-ref.stderr} | 2 +- ...-reborrow-from-shorter-mut-ref.base.stderr | 13 - .../regions-reborrow-from-shorter-mut-ref.rs | 7 +- ...ions-reborrow-from-shorter-mut-ref.stderr} | 2 +- .../regions-ret-borrowed-1.base.stderr | 32 --- src/test/ui/regions/regions-ret-borrowed-1.rs | 7 +- ...l.stderr => regions-ret-borrowed-1.stderr} | 2 +- .../regions/regions-ret-borrowed.base.stderr | 32 --- src/test/ui/regions/regions-ret-borrowed.rs | 7 +- ...nll.stderr => regions-ret-borrowed.stderr} | 2 +- .../regions/regions-static-bound.base.stderr | 62 ----- src/test/ui/regions/regions-static-bound.rs | 13 +- ...nll.stderr => regions-static-bound.stderr} | 10 +- ...regions-trait-object-subtyping.base.stderr | 69 ----- .../regions/regions-trait-object-subtyping.rs | 11 +- ... => regions-trait-object-subtyping.stderr} | 4 +- ...e-covariant-in-second-position.base.stderr | 12 - ...ariant-use-covariant-in-second-position.rs | 7 +- ...t-use-covariant-in-second-position.stderr} | 2 +- ...ce-contravariant-use-covariant.base.stderr | 15 -- ...ns-variance-contravariant-use-covariant.rs | 7 +- ...riance-contravariant-use-covariant.stderr} | 2 +- ...ce-covariant-use-contravariant.base.stderr | 14 - ...ns-variance-covariant-use-contravariant.rs | 7 +- ...riance-covariant-use-contravariant.stderr} | 2 +- ...ce-invariant-use-contravariant.base.stderr | 14 - ...ns-variance-invariant-use-contravariant.rs | 7 +- ...riance-invariant-use-contravariant.stderr} | 2 +- ...riance-invariant-use-covariant.base.stderr | 18 -- ...egions-variance-invariant-use-covariant.rs | 7 +- ...s-variance-invariant-use-covariant.stderr} | 2 +- src/test/ui/rfc1623.base.stderr | 11 - src/test/ui/rfc1623.rs | 13 +- .../ui/{rfc1623.nll.stderr => rfc1623.stderr} | 8 +- ...es_pin_lifetime_mismatch-async.base.stderr | 39 --- ..._self_types_pin_lifetime_mismatch-async.rs | 12 +- ..._types_pin_lifetime_mismatch-async.stderr} | 6 +- ...lf_types_pin_lifetime_mismatch.base.stderr | 39 --- ...itrary_self_types_pin_lifetime_mismatch.rs | 13 +- ...y_self_types_pin_lifetime_mismatch.stderr} | 6 +- .../elision/lt-ref-self-async.base.stderr | 99 ------- src/test/ui/self/elision/lt-ref-self-async.rs | 21 +- ...nc.nll.stderr => lt-ref-self-async.stderr} | 12 +- .../ui/self/elision/lt-ref-self.base.stderr | 99 ------- src/test/ui/self/elision/lt-ref-self.rs | 22 +- ...ref-self.nll.stderr => lt-ref-self.stderr} | 12 +- .../elision/ref-mut-self-async.base.stderr | 99 ------- .../ui/self/elision/ref-mut-self-async.rs | 21 +- ...c.nll.stderr => ref-mut-self-async.stderr} | 12 +- .../ui/self/elision/ref-mut-self.base.stderr | 99 ------- src/test/ui/self/elision/ref-mut-self.rs | 22 +- ...ut-self.nll.stderr => ref-mut-self.stderr} | 12 +- .../elision/ref-mut-struct-async.base.stderr | 83 ------ .../ui/self/elision/ref-mut-struct-async.rs | 18 +- ...nll.stderr => ref-mut-struct-async.stderr} | 10 +- .../self/elision/ref-mut-struct.base.stderr | 83 ------ src/test/ui/self/elision/ref-mut-struct.rs | 19 +- ...truct.nll.stderr => ref-mut-struct.stderr} | 10 +- .../self/elision/ref-self-async.base.stderr | 115 --------- src/test/ui/self/elision/ref-self-async.rs | 24 +- ...async.nll.stderr => ref-self-async.stderr} | 14 +- src/test/ui/self/elision/ref-self.base.stderr | 115 --------- src/test/ui/self/elision/ref-self.rs | 25 +- .../{ref-self.nll.stderr => ref-self.stderr} | 14 +- .../self/elision/ref-struct-async.base.stderr | 83 ------ src/test/ui/self/elision/ref-struct-async.rs | 18 +- ...ync.nll.stderr => ref-struct-async.stderr} | 10 +- .../ui/self/elision/ref-struct.base.stderr | 83 ------ src/test/ui/self/elision/ref-struct.rs | 19 +- ...ef-struct.nll.stderr => ref-struct.stderr} | 10 +- ...bound-needing-more-suggestions.base.stderr | 42 --- ...t-static-bound-needing-more-suggestions.rs | 6 +- ...tic-bound-needing-more-suggestions.stderr} | 6 +- ...yn-trait-with-implicit-static-bound-nll.rs | 118 --------- ...rait-with-implicit-static-bound-nll.stderr | 105 -------- ...dyn-trait-with-implicit-static-bound.fixed | 117 --------- ...on-dyn-trait-with-implicit-static-bound.rs | 19 +- ...yn-trait-with-implicit-static-bound.stderr | 126 ++++----- ...ssing-lifetimes-in-signature-2.base.stderr | 28 -- .../missing-lifetimes-in-signature-2.rs | 4 - ...> missing-lifetimes-in-signature-2.stderr} | 6 +- ...missing-lifetimes-in-signature.base.stderr | 114 -------- .../missing-lifetimes-in-signature.rs | 21 +- ... => missing-lifetimes-in-signature.stderr} | 34 +-- ...it-object-nested-in-impl-trait.base.stderr | 95 ------- .../trait-object-nested-in-impl-trait.rs | 16 +- ... trait-object-nested-in-impl-trait.stderr} | 12 +- .../suggest-impl-trait-lifetime-nll.fixed | 24 -- .../suggest-impl-trait-lifetime-nll.rs | 24 -- .../suggest-impl-trait-lifetime-nll.stderr | 14 - .../suggest-impl-trait-lifetime.fixed | 7 +- .../suggest-impl-trait-lifetime.rs | 7 +- .../suggest-impl-trait-lifetime.stderr | 9 +- .../supertrait-lifetime-bound.base.stderr | 15 -- .../object/supertrait-lifetime-bound.rs | 7 +- ...tderr => supertrait-lifetime-bound.stderr} | 2 +- .../ui/traits/trait-upcasting/lifetime.rs | 1 - .../type-checking-test-3.base.stderr | 33 --- .../trait-upcasting/type-checking-test-3.rs | 10 +- ...nll.stderr => type-checking-test-3.stderr} | 4 +- .../type-checking-test-4.base.stderr | 123 --------- .../trait-upcasting/type-checking-test-4.rs | 22 +- ...nll.stderr => type-checking-test-4.stderr} | 14 +- ..._type_does_not_live_long_enough.nll.stderr | 32 --- .../generic_type_does_not_live_long_enough.rs | 4 - ...ric_type_does_not_live_long_enough.stderr} | 8 +- .../issue-57611-trait-alias.base.stderr | 11 - .../issue-57611-trait-alias.rs | 4 - ....stderr => issue-57611-trait-alias.stderr} | 6 +- .../unboxed-closures/issue-30906.base.stderr | 11 - src/test/ui/unboxed-closures/issue-30906.rs | 4 - ...ue-30906.nll.stderr => issue-30906.stderr} | 2 +- ...ment-types-two-region-pointers.base.stderr | 30 --- ...nfer-argument-types-two-region-pointers.rs | 7 +- ...argument-types-two-region-pointers.stderr} | 2 +- .../dyn-trait-underscore.base.stderr | 27 -- .../dyn-trait-underscore.rs | 7 +- ...nll.stderr => dyn-trait-underscore.stderr} | 2 +- ...score-lifetime-elison-mismatch.base.stderr | 17 -- .../underscore-lifetime-elison-mismatch.rs | 7 +- ...nderscore-lifetime-elison-mismatch.stderr} | 2 +- .../variance-associated-types2.base.stderr | 18 -- .../ui/variance/variance-associated-types2.rs | 7 +- ...derr => variance-associated-types2.stderr} | 2 +- ...variance-btree-invariant-types.base.stderr | 243 ------------------ .../variance-btree-invariant-types.rs | 52 ++-- ... => variance-btree-invariant-types.stderr} | 32 +-- .../variance-cell-is-invariant.base.stderr | 15 -- .../ui/variance/variance-cell-is-invariant.rs | 7 +- ...derr => variance-cell-is-invariant.stderr} | 2 +- ...iance-contravariant-arg-object.base.stderr | 41 --- .../variance-contravariant-arg-object.rs | 10 +- ... variance-contravariant-arg-object.stderr} | 4 +- ...-contravariant-arg-trait-match.base.stderr | 41 --- .../variance-contravariant-arg-trait-match.rs | 10 +- ...ance-contravariant-arg-trait-match.stderr} | 4 +- ...contravariant-self-trait-match.base.stderr | 41 --- ...variance-contravariant-self-trait-match.rs | 10 +- ...nce-contravariant-self-trait-match.stderr} | 4 +- .../variance-covariant-arg-object.base.stderr | 41 --- .../variance/variance-covariant-arg-object.rs | 10 +- ...r => variance-covariant-arg-object.stderr} | 4 +- ...ance-covariant-arg-trait-match.base.stderr | 41 --- .../variance-covariant-arg-trait-match.rs | 10 +- ...variance-covariant-arg-trait-match.stderr} | 4 +- ...nce-covariant-self-trait-match.base.stderr | 41 --- .../variance-covariant-self-trait-match.rs | 10 +- ...ariance-covariant-self-trait-match.stderr} | 4 +- .../variance-invariant-arg-object.base.stderr | 41 --- .../variance/variance-invariant-arg-object.rs | 10 +- ...r => variance-invariant-arg-object.stderr} | 4 +- ...ance-invariant-arg-trait-match.base.stderr | 41 --- .../variance-invariant-arg-trait-match.rs | 10 +- ...variance-invariant-arg-trait-match.stderr} | 4 +- ...nce-invariant-self-trait-match.base.stderr | 41 --- .../variance-invariant-self-trait-match.rs | 10 +- ...ariance-invariant-self-trait-match.stderr} | 4 +- .../variance-trait-matching.base.stderr | 12 - .../ui/variance/variance-trait-matching.rs | 4 - ....stderr => variance-trait-matching.stderr} | 2 +- ...nce-use-contravariant-struct-1.base.stderr | 22 -- .../variance-use-contravariant-struct-1.rs | 7 +- ...ariance-use-contravariant-struct-1.stderr} | 2 +- ...ariance-use-covariant-struct-1.base.stderr | 22 -- .../variance-use-covariant-struct-1.rs | 7 +- ...=> variance-use-covariant-struct-1.stderr} | 2 +- ...ariance-use-invariant-struct-1.base.stderr | 41 --- .../variance-use-invariant-struct-1.rs | 10 +- ...=> variance-use-invariant-struct-1.stderr} | 4 +- src/test/ui/wf/wf-static-method.base.stderr | 136 ---------- src/test/ui/wf/wf-static-method.rs | 22 +- ...hod.nll.stderr => wf-static-method.stderr} | 12 +- .../where-for-self-2.base.stderr | 11 - src/test/ui/where-clauses/where-for-self-2.rs | 4 - ...f-2.nll.stderr => where-for-self-2.stderr} | 2 +- .../clippy/tests/ui/crashes/ice-6256.stderr | 22 +- src/tools/compiletest/src/common.rs | 3 - src/tools/compiletest/src/header.rs | 1 - src/tools/compiletest/src/runtest.rs | 13 +- src/tools/tidy/src/error_codes_check.rs | 4 +- 985 files changed, 1824 insertions(+), 12137 deletions(-) delete mode 100644 src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr rename src/test/ui/associated-type-bounds/{implied-region-constraints.nll.stderr => implied-region-constraints.stderr} (91%) delete mode 100644 src/test/ui/associated-types/associated-types-eq-hr.base.stderr rename src/test/ui/associated-types/{associated-types-eq-hr.nll.stderr => associated-types-eq-hr.stderr} (87%) delete mode 100644 src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr rename src/test/ui/associated-types/{associated-types-project-from-hrtb-in-fn-body.nll.stderr => associated-types-project-from-hrtb-in-fn-body.stderr} (87%) delete mode 100644 src/test/ui/associated-types/associated-types-subtyping-1.base.stderr rename src/test/ui/associated-types/{associated-types-subtyping-1.nll.stderr => associated-types-subtyping-1.stderr} (89%) delete mode 100644 src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr delete mode 100644 src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs delete mode 100644 src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr delete mode 100644 src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr delete mode 100644 src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr delete mode 100644 src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs delete mode 100644 src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr delete mode 100644 src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr delete mode 100644 src/test/ui/async-await/issue-76547.base.stderr rename src/test/ui/async-await/{issue-76547.nll.stderr => issue-76547.stderr} (94%) delete mode 100644 src/test/ui/async-await/issues/issue-62097.base.stderr rename src/test/ui/async-await/issues/{issue-62097.nll.stderr => issue-62097.stderr} (93%) delete mode 100644 src/test/ui/async-await/issues/issue-63388-1.base.stderr rename src/test/ui/async-await/issues/{issue-63388-1.nll.stderr => issue-63388-1.stderr} (91%) delete mode 100644 src/test/ui/async-await/issues/issue-72312.base.stderr rename src/test/ui/async-await/issues/{issue-72312.nll.stderr => issue-72312.stderr} (95%) delete mode 100644 src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr rename src/test/ui/async-await/multiple-lifetimes/{ret-impl-trait-one.nll.stderr => ret-impl-trait-one.stderr} (94%) delete mode 100644 src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr delete mode 100644 src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs delete mode 100644 src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr delete mode 100644 src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr rename src/test/ui/borrowck/{borrowck-reborrow-from-shorter-lived-andmut.nll.stderr => borrowck-reborrow-from-shorter-lived-andmut.stderr} (89%) delete mode 100644 src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr rename src/test/ui/borrowck/{issue-55492-borrowck-migrate-scans-parents.nll.stderr => issue-55492-borrowck-migrate-scans-parents.stderr} (84%) delete mode 100644 src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr delete mode 100644 src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.base.stderr delete mode 100644 src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr delete mode 100644 src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr delete mode 100644 src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr delete mode 100644 src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr rename src/test/ui/borrowck/{two-phase-reservation-sharing-interference-2.migrate2018.stderr => two-phase-reservation-sharing-interference-2.stderr} (84%) delete mode 100644 src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr rename src/test/ui/closure-expected-type/{expect-fn-supply-fn.nll.stderr => expect-fn-supply-fn.stderr} (90%) delete mode 100644 src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr rename src/test/ui/closures/{closure-bounds-static-cant-capture-borrowed.nll.stderr => closure-bounds-static-cant-capture-borrowed.stderr} (85%) delete mode 100644 src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr rename src/test/ui/closures/closure-expected-type/{expect-region-supply-region-2.nll.stderr => expect-region-supply-region-2.stderr} (87%) delete mode 100644 src/test/ui/const-generics/invariant.base.stderr rename src/test/ui/const-generics/{invariant.nll.stderr => invariant.stderr} (94%) rename src/test/ui/error-codes/{E0161.migrate.stderr => E0161.base.stderr} (90%) delete mode 100644 src/test/ui/error-codes/E0161.edition.stderr delete mode 100644 src/test/ui/error-codes/E0161.nll.stderr delete mode 100644 src/test/ui/error-codes/E0161.zflags.stderr delete mode 100644 src/test/ui/error-codes/E0490.base.stderr delete mode 100644 src/test/ui/error-codes/E0490.nll.stderr delete mode 100644 src/test/ui/error-codes/E0490.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-nll.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-nll.stderr delete mode 100644 src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr rename src/test/ui/fn/{implied-bounds-unnorm-associated-type.nll.stderr => implied-bounds-unnorm-associated-type.stderr} (88%) delete mode 100644 src/test/ui/generator/auto-trait-regions.base.stderr rename src/test/ui/generator/{auto-trait-regions.nll.stderr => auto-trait-regions.stderr} (92%) delete mode 100644 src/test/ui/generator/generator-region-requirements.base.stderr rename src/test/ui/generator/{generator-region-requirements.nll.stderr => generator-region-requirements.stderr} (88%) delete mode 100644 src/test/ui/generator/resume-arg-late-bound.base.stderr rename src/test/ui/generator/{resume-arg-late-bound.nll.stderr => resume-arg-late-bound.stderr} (85%) delete mode 100644 src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr rename src/test/ui/generic-associated-types/{bugs => }/issue-89352.rs (58%) delete mode 100644 src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr rename src/test/ui/generic-associated-types/{projection-type-lifetime-mismatch.nll.stderr => projection-type-lifetime-mismatch.stderr} (89%) delete mode 100644 src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr rename src/test/ui/higher-rank-trait-bounds/{issue-59311.nll.stderr => issue-59311.stderr} (69%) delete mode 100644 src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr rename src/test/ui/higher-rank-trait-bounds/normalize-under-binder/{issue-71955.nll.stderr => issue-71955.stderr} (87%) delete mode 100644 src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr delete mode 100644 src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr delete mode 100644 src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr delete mode 100644 src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr delete mode 100644 src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr delete mode 100644 src/test/ui/hr-subtype/hr-subtype-nll.rs delete mode 100644 src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr rename src/test/ui/hr-subtype/{placeholder-pattern-fail.nll.stderr => placeholder-pattern-fail.stderr} (90%) delete mode 100644 src/test/ui/hrtb/hrtb-conflate-regions.base.stderr rename src/test/ui/hrtb/{hrtb-conflate-regions.nll.stderr => hrtb-conflate-regions.stderr} (91%) delete mode 100644 src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr rename src/test/ui/hrtb/{hrtb-exists-forall-trait-contravariant.nll.stderr => hrtb-exists-forall-trait-contravariant.stderr} (85%) delete mode 100644 src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr rename src/test/ui/hrtb/{hrtb-exists-forall-trait-invariant.nll.stderr => hrtb-exists-forall-trait-invariant.stderr} (87%) delete mode 100644 src/test/ui/hrtb/hrtb-just-for-static.base.stderr rename src/test/ui/hrtb/{hrtb-just-for-static.nll.stderr => hrtb-just-for-static.stderr} (89%) delete mode 100644 src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr rename src/test/ui/hrtb/{hrtb-perfect-forwarding.nll.stderr => hrtb-perfect-forwarding.stderr} (89%) delete mode 100644 src/test/ui/hrtb/issue-30786.nll.stderr rename src/test/ui/hrtb/{issue-30786.base.stderr => issue-30786.stderr} (69%) delete mode 100644 src/test/ui/hrtb/issue-46989.base.stderr rename src/test/ui/hrtb/{issue-46989.nll.stderr => issue-46989.stderr} (92%) delete mode 100644 src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr rename src/test/ui/impl-header-lifetime-elision/{dyn-trait.nll.stderr => dyn-trait.stderr} (95%) delete mode 100644 src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr rename src/test/ui/impl-trait/{must_outlive_least_region_or_bound.nll.stderr => must_outlive_least_region_or_bound.stderr} (90%) delete mode 100644 src/test/ui/impl-trait/type_parameters_captured.base.stderr rename src/test/ui/impl-trait/{type_parameters_captured.nll.stderr => type_parameters_captured.stderr} (90%) delete mode 100644 src/test/ui/issues/issue-10291.base.stderr rename src/test/ui/issues/{issue-10291.nll.stderr => issue-10291.stderr} (91%) delete mode 100644 src/test/ui/issues/issue-13058.base.stderr rename src/test/ui/issues/{issue-13058.nll.stderr => issue-13058.stderr} (94%) delete mode 100644 src/test/ui/issues/issue-15034.base.stderr rename src/test/ui/issues/{issue-15034.nll.stderr => issue-15034.stderr} (93%) delete mode 100644 src/test/ui/issues/issue-16683.base.stderr rename src/test/ui/issues/{issue-16683.nll.stderr => issue-16683.stderr} (92%) delete mode 100644 src/test/ui/issues/issue-16922.base.stderr rename src/test/ui/issues/{issue-16922.nll.stderr => issue-16922.stderr} (94%) delete mode 100644 src/test/ui/issues/issue-17728.base.stderr rename src/test/ui/issues/{issue-17728.nll.stderr => issue-17728.stderr} (95%) delete mode 100644 src/test/ui/issues/issue-17758.base.stderr rename src/test/ui/issues/{issue-17758.nll.stderr => issue-17758.stderr} (92%) delete mode 100644 src/test/ui/issues/issue-26217.base.stderr rename src/test/ui/issues/{issue-26217.nll.stderr => issue-26217.stderr} (88%) delete mode 100644 src/test/ui/issues/issue-40000.base.stderr rename src/test/ui/issues/{issue-40000.nll.stderr => issue-40000.stderr} (90%) delete mode 100644 src/test/ui/issues/issue-46983.base.stderr rename src/test/ui/issues/{issue-46983.nll.stderr => issue-46983.stderr} (90%) delete mode 100644 src/test/ui/issues/issue-52533.base.stderr rename src/test/ui/issues/{issue-52533.nll.stderr => issue-52533.stderr} (91%) delete mode 100644 src/test/ui/issues/issue-54302-cases.base.stderr rename src/test/ui/issues/{issue-54302-cases.nll.stderr => issue-54302-cases.stderr} (92%) delete mode 100644 src/test/ui/issues/issue-54943.base.stderr rename src/test/ui/issues/{issue-54943.nll.stderr => issue-54943.stderr} (89%) delete mode 100644 src/test/ui/issues/issue-55731.base.stderr rename src/test/ui/issues/{issue-55731.nll.stderr => issue-55731.stderr} (94%) delete mode 100644 src/test/ui/issues/issue-55796.base.stderr rename src/test/ui/issues/{issue-55796.nll.stderr => issue-55796.stderr} (91%) delete mode 100644 src/test/ui/issues/issue-75777.base.stderr rename src/test/ui/issues/{issue-75777.nll.stderr => issue-75777.stderr} (93%) delete mode 100644 src/test/ui/kindck/kindck-impl-type-params.base.stderr rename src/test/ui/kindck/{kindck-impl-type-params.nll.stderr => kindck-impl-type-params.stderr} (87%) delete mode 100644 src/test/ui/kindck/kindck-send-object1.base.stderr rename src/test/ui/kindck/{kindck-send-object1.nll.stderr => kindck-send-object1.stderr} (89%) delete mode 100644 src/test/ui/lifetimes/issue-79187-2.base.stderr rename src/test/ui/lifetimes/{issue-79187-2.nll.stderr => issue-79187-2.stderr} (87%) delete mode 100644 src/test/ui/lifetimes/issue-79187.base.stderr rename src/test/ui/lifetimes/{issue-79187.nll.stderr => issue-79187.stderr} (88%) delete mode 100644 src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed delete mode 100644 src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs delete mode 100644 src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr delete mode 100644 src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr rename src/test/ui/lifetimes/{issue-90600-expected-return-static-indirect.nll.stderr => issue-90600-expected-return-static-indirect.stderr} (85%) delete mode 100644 src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr rename src/test/ui/lifetimes/{lifetime-bound-will-change-warning.nll.stderr => lifetime-bound-will-change-warning.stderr} (90%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex1-return-one-existing-name-if-else-using-impl.nll.stderr => ex1-return-one-existing-name-if-else-using-impl.stderr} (87%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex1-return-one-existing-name-return-type-is-anon.nll.stderr => ex1-return-one-existing-name-return-type-is-anon.stderr} (85%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex1-return-one-existing-name-self-is-anon.nll.stderr => ex1-return-one-existing-name-self-is-anon.stderr} (88%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex2a-push-one-existing-name-2.nll.stderr => ex2a-push-one-existing-name-2.stderr} (88%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex2a-push-one-existing-name-early-bound.nll.stderr => ex2a-push-one-existing-name-early-bound.stderr} (87%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex2a-push-one-existing-name.nll.stderr => ex2a-push-one-existing-name.stderr} (89%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex2b-push-no-existing-names.nll.stderr => ex2b-push-no-existing-names.stderr} (87%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex2c-push-inference-variable.nll.stderr => ex2c-push-inference-variable.stderr} (90%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex2d-push-inference-variable-2.nll.stderr => ex2d-push-inference-variable-2.stderr} (89%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex2e-push-inference-variable-3.nll.stderr => ex2e-push-inference-variable-3.stderr} (89%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-2.nll.stderr => ex3-both-anon-regions-2.stderr} (93%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-3.nll.stderr => ex3-both-anon-regions-3.stderr} (93%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-both-are-structs-2.nll.stderr => ex3-both-anon-regions-both-are-structs-2.stderr} (83%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-both-are-structs-3.nll.stderr => ex3-both-anon-regions-both-are-structs-3.stderr} (83%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr => ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr} (97%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr => ex3-both-anon-regions-both-are-structs-latebound-regions.stderr} (97%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-both-are-structs.nll.stderr => ex3-both-anon-regions-both-are-structs.stderr} (84%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-latebound-regions.nll.stderr => ex3-both-anon-regions-latebound-regions.stderr} (86%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-one-is-struct-2.nll.stderr => ex3-both-anon-regions-one-is-struct-2.stderr} (85%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-one-is-struct-3.nll.stderr => ex3-both-anon-regions-one-is-struct-3.stderr} (85%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-one-is-struct-4.nll.stderr => ex3-both-anon-regions-one-is-struct-4.stderr} (85%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-one-is-struct.nll.stderr => ex3-both-anon-regions-one-is-struct.stderr} (85%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-return-type-is-anon.nll.stderr => ex3-both-anon-regions-return-type-is-anon.stderr} (90%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-self-is-anon.nll.stderr => ex3-both-anon-regions-self-is-anon.stderr} (92%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-using-fn-items.nll.stderr => ex3-both-anon-regions-using-fn-items.stderr} (89%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-using-impl-items.nll.stderr => ex3-both-anon-regions-using-impl-items.stderr} (91%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions-using-trait-objects.nll.stderr => ex3-both-anon-regions-using-trait-objects.stderr} (89%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{ex3-both-anon-regions.nll.stderr => ex3-both-anon-regions.stderr} (93%) delete mode 100644 src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr rename src/test/ui/lifetimes/lifetime-errors/{issue_74400.nll.stderr => issue_74400.stderr} (90%) delete mode 100644 src/test/ui/lifetimes/re-empty-in-error.base.stderr rename src/test/ui/lifetimes/{re-empty-in-error.nll.stderr => re-empty-in-error.stderr} (82%) rename src/test/ui/lub-glb/{old-lub-glb-hr-noteq2.basenoleak.stderr => old-lub-glb-hr-noteq1.leak.stderr} (54%) create mode 100644 src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr rename src/test/ui/lub-glb/{old-lub-glb-hr-noteq2.baseleak.stderr => old-lub-glb-hr-noteq2.leak.stderr} (91%) delete mode 100644 src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr delete mode 100644 src/test/ui/lub-glb/old-lub-glb-object.base.stderr rename src/test/ui/lub-glb/{old-lub-glb-object.nll.stderr => old-lub-glb-object.stderr} (89%) delete mode 100644 src/test/ui/match/match-ref-mut-invariance.base.stderr rename src/test/ui/match/{match-ref-mut-invariance.nll.stderr => match-ref-mut-invariance.stderr} (94%) delete mode 100644 src/test/ui/match/match-ref-mut-let-invariance.base.stderr rename src/test/ui/match/{match-ref-mut-let-invariance.nll.stderr => match-ref-mut-let-invariance.stderr} (93%) delete mode 100644 src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr rename src/test/ui/mismatched_types/{closure-arg-type-mismatch.nll.stderr => closure-arg-type-mismatch.stderr} (91%) delete mode 100644 src/test/ui/mismatched_types/closure-mismatch.base.stderr rename src/test/ui/mismatched_types/{closure-mismatch.nll.stderr => closure-mismatch.stderr} (86%) delete mode 100644 src/test/ui/nll/continue-after-missing-main.base.stderr rename src/test/ui/nll/{continue-after-missing-main.nll.stderr => continue-after-missing-main.stderr} (85%) delete mode 100644 src/test/ui/nll/issue-50716.base.stderr rename src/test/ui/nll/{issue-50716.nll.stderr => issue-50716.stderr} (90%) delete mode 100644 src/test/ui/nll/issue-52213.base.stderr rename src/test/ui/nll/{issue-52213.nll.stderr => issue-52213.stderr} (90%) delete mode 100644 src/test/ui/nll/issue-52533-1.base.stderr rename src/test/ui/nll/{issue-52533-1.nll.stderr => issue-52533-1.stderr} (91%) delete mode 100644 src/test/ui/nll/issue-52742.base.stderr rename src/test/ui/nll/{issue-52742.nll.stderr => issue-52742.stderr} (92%) delete mode 100644 src/test/ui/nll/issue-55394.base.stderr rename src/test/ui/nll/{issue-55394.nll.stderr => issue-55394.stderr} (93%) delete mode 100644 src/test/ui/nll/issue-55401.base.stderr rename src/test/ui/nll/{issue-55401.nll.stderr => issue-55401.stderr} (92%) delete mode 100644 src/test/ui/nll/lub-if.base.stderr rename src/test/ui/nll/{lub-if.nll.stderr => lub-if.stderr} (91%) delete mode 100644 src/test/ui/nll/lub-match.base.stderr rename src/test/ui/nll/{lub-match.nll.stderr => lub-match.stderr} (90%) delete mode 100644 src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.base.stderr rename src/test/ui/nll/ty-outlives/{projection-where-clause-env-wrong-bound.nll.stderr => projection-where-clause-env-wrong-bound.stderr} (88%) delete mode 100644 src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr rename src/test/ui/nll/ty-outlives/{projection-where-clause-env-wrong-lifetime.nll.stderr => projection-where-clause-env-wrong-lifetime.stderr} (88%) delete mode 100644 src/test/ui/nll/type-alias-free-regions.base.stderr rename src/test/ui/nll/{type-alias-free-regions.nll.stderr => type-alias-free-regions.stderr} (90%) delete mode 100644 src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr rename src/test/ui/nll/user-annotations/{constant-in-expr-inherent-1.nll.stderr => constant-in-expr-inherent-1.stderr} (85%) delete mode 100644 src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr rename src/test/ui/nll/user-annotations/{constant-in-expr-normalize.nll.stderr => constant-in-expr-normalize.stderr} (86%) delete mode 100644 src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr rename src/test/ui/nll/user-annotations/{constant-in-expr-trait-item-1.nll.stderr => constant-in-expr-trait-item-1.stderr} (85%) delete mode 100644 src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr rename src/test/ui/nll/user-annotations/{constant-in-expr-trait-item-2.nll.stderr => constant-in-expr-trait-item-2.stderr} (85%) delete mode 100644 src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr rename src/test/ui/nll/user-annotations/{constant-in-expr-trait-item-3.nll.stderr => constant-in-expr-trait-item-3.stderr} (84%) delete mode 100644 src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr rename src/test/ui/object-lifetime/{object-lifetime-default-elision.nll.stderr => object-lifetime-default-elision.stderr} (89%) delete mode 100644 src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr rename src/test/ui/object-lifetime/{object-lifetime-default-from-box-error.nll.stderr => object-lifetime-default-from-box-error.stderr} (87%) delete mode 100644 src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr rename src/test/ui/object-lifetime/{object-lifetime-default-from-rptr-box-error.nll.stderr => object-lifetime-default-from-rptr-box-error.stderr} (81%) delete mode 100644 src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr rename src/test/ui/object-lifetime/{object-lifetime-default-from-rptr-struct-error.nll.stderr => object-lifetime-default-from-rptr-struct-error.stderr} (81%) delete mode 100644 src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr rename src/test/ui/object-lifetime/{object-lifetime-default-mybox.nll.stderr => object-lifetime-default-mybox.stderr} (90%) delete mode 100644 src/test/ui/regions/issue-28848.base.stderr rename src/test/ui/regions/{issue-28848.nll.stderr => issue-28848.stderr} (92%) rename src/test/ui/regions/{issue-78262.nll.stderr => issue-78262.base.stderr} (94%) delete mode 100644 src/test/ui/regions/issue-78262.default.stderr delete mode 100644 src/test/ui/regions/region-invariant-static-error-reporting.base.stderr rename src/test/ui/regions/{region-invariant-static-error-reporting.nll.stderr => region-invariant-static-error-reporting.stderr} (93%) delete mode 100644 src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr rename src/test/ui/regions/{region-lifetime-bounds-on-fns-where-clause.nll.stderr => region-lifetime-bounds-on-fns-where-clause.stderr} (88%) delete mode 100644 src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr rename src/test/ui/regions/{region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr => region-multiple-lifetime-bounds-on-fns-where-clause.stderr} (98%) delete mode 100644 src/test/ui/regions/region-object-lifetime-2.base.stderr rename src/test/ui/regions/{region-object-lifetime-2.nll.stderr => region-object-lifetime-2.stderr} (92%) delete mode 100644 src/test/ui/regions/region-object-lifetime-4.base.stderr rename src/test/ui/regions/{region-object-lifetime-4.nll.stderr => region-object-lifetime-4.stderr} (92%) delete mode 100644 src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr rename src/test/ui/regions/{region-object-lifetime-in-coercion.nll.stderr => region-object-lifetime-in-coercion.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-addr-of-self.base.stderr rename src/test/ui/regions/{regions-addr-of-self.nll.stderr => regions-addr-of-self.stderr} (89%) delete mode 100644 src/test/ui/regions/regions-addr-of-upvar-self.base.stderr rename src/test/ui/regions/{regions-addr-of-upvar-self.nll.stderr => regions-addr-of-upvar-self.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr rename src/test/ui/regions/{regions-assoc-type-in-supertrait-outlives-container.nll.stderr => regions-assoc-type-in-supertrait-outlives-container.stderr} (98%) delete mode 100644 src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr rename src/test/ui/regions/{regions-bounded-by-trait-requiring-static.nll.stderr => regions-bounded-by-trait-requiring-static.stderr} (84%) delete mode 100644 src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr rename src/test/ui/regions/{regions-bounded-method-type-parameters-cross-crate.nll.stderr => regions-bounded-method-type-parameters-cross-crate.stderr} (99%) delete mode 100644 src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr rename src/test/ui/regions/{regions-bounded-method-type-parameters-trait-bound.nll.stderr => regions-bounded-method-type-parameters-trait-bound.stderr} (99%) delete mode 100644 src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr rename src/test/ui/regions/{regions-bounded-method-type-parameters.nll.stderr => regions-bounded-method-type-parameters.stderr} (82%) delete mode 100644 src/test/ui/regions/regions-bounds.base.stderr rename src/test/ui/regions/{regions-bounds.nll.stderr => regions-bounds.stderr} (92%) delete mode 100644 src/test/ui/regions/regions-close-associated-type-into-object.base.stderr rename src/test/ui/regions/{regions-close-associated-type-into-object.nll.stderr => regions-close-associated-type-into-object.stderr} (85%) delete mode 100644 src/test/ui/regions/regions-close-object-into-object-2.base.stderr rename src/test/ui/regions/{regions-close-object-into-object-2.nll.stderr => regions-close-object-into-object-2.stderr} (91%) delete mode 100644 src/test/ui/regions/regions-close-object-into-object-4.base.stderr rename src/test/ui/regions/{regions-close-object-into-object-4.nll.stderr => regions-close-object-into-object-4.stderr} (88%) delete mode 100644 src/test/ui/regions/regions-close-object-into-object-5.base.stderr rename src/test/ui/regions/{regions-close-object-into-object-5.nll.stderr => regions-close-object-into-object-5.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr rename src/test/ui/regions/{regions-close-over-type-parameter-1.base.stderr => regions-close-over-type-parameter-1.stderr} (89%) delete mode 100644 src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr rename src/test/ui/regions/{regions-close-over-type-parameter-multiple.nll.stderr => regions-close-over-type-parameter-multiple.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-close-param-into-object.base.stderr rename src/test/ui/regions/{regions-close-param-into-object.nll.stderr => regions-close-param-into-object.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-creating-enums3.base.stderr rename src/test/ui/regions/{regions-creating-enums3.nll.stderr => regions-creating-enums3.stderr} (91%) delete mode 100644 src/test/ui/regions/regions-creating-enums4.base.stderr rename src/test/ui/regions/{regions-creating-enums4.nll.stderr => regions-creating-enums4.stderr} (92%) delete mode 100644 src/test/ui/regions/regions-early-bound-error-method.base.stderr rename src/test/ui/regions/{regions-early-bound-error-method.nll.stderr => regions-early-bound-error-method.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-early-bound-error.base.stderr rename src/test/ui/regions/{regions-early-bound-error.nll.stderr => regions-early-bound-error.stderr} (91%) delete mode 100644 src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr rename src/test/ui/regions/{regions-fn-subtyping-return-static-fail.base.stderr => regions-fn-subtyping-return-static-fail.stderr} (80%) delete mode 100644 src/test/ui/regions/regions-free-region-ordering-callee.base.stderr rename src/test/ui/regions/{regions-free-region-ordering-callee.nll.stderr => regions-free-region-ordering-callee.stderr} (89%) delete mode 100644 src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr rename src/test/ui/regions/{regions-free-region-ordering-caller.nll.stderr => regions-free-region-ordering-caller.stderr} (88%) delete mode 100644 src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr rename src/test/ui/regions/{regions-free-region-ordering-incorrect.nll.stderr => regions-free-region-ordering-incorrect.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr rename src/test/ui/regions/{regions-implied-bounds-projection-gap-1.nll.stderr => regions-implied-bounds-projection-gap-1.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr rename src/test/ui/regions/{regions-infer-bound-from-trait-self.nll.stderr => regions-infer-bound-from-trait-self.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-infer-bound-from-trait.base.stderr rename src/test/ui/regions/{regions-infer-bound-from-trait.nll.stderr => regions-infer-bound-from-trait.stderr} (94%) delete mode 100644 src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr rename src/test/ui/regions/{regions-infer-contravariance-due-to-decl.nll.stderr => regions-infer-contravariance-due-to-decl.stderr} (88%) delete mode 100644 src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr rename src/test/ui/regions/{regions-infer-covariance-due-to-decl.nll.stderr => regions-infer-covariance-due-to-decl.stderr} (88%) delete mode 100644 src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr rename src/test/ui/regions/{regions-infer-invariance-due-to-decl.nll.stderr => regions-infer-invariance-due-to-decl.stderr} (91%) delete mode 100644 src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr rename src/test/ui/regions/{regions-infer-invariance-due-to-mutability-3.nll.stderr => regions-infer-invariance-due-to-mutability-3.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr rename src/test/ui/regions/{regions-infer-invariance-due-to-mutability-4.nll.stderr => regions-infer-invariance-due-to-mutability-4.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-infer-not-param.base.stderr rename src/test/ui/regions/{regions-infer-not-param.nll.stderr => regions-infer-not-param.stderr} (93%) delete mode 100644 src/test/ui/regions/regions-infer-paramd-indirect.base.stderr rename src/test/ui/regions/{regions-infer-paramd-indirect.nll.stderr => regions-infer-paramd-indirect.stderr} (88%) delete mode 100644 src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr rename src/test/ui/regions/{regions-lifetime-bounds-on-fns.nll.stderr => regions-lifetime-bounds-on-fns.stderr} (90%) delete mode 100644 src/test/ui/regions/regions-nested-fns.base.stderr rename src/test/ui/regions/{regions-nested-fns.nll.stderr => regions-nested-fns.stderr} (91%) delete mode 100644 src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr rename src/test/ui/regions/{regions-outlives-projection-container-hrtb.nll.stderr => regions-outlives-projection-container-hrtb.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr rename src/test/ui/regions/{regions-outlives-projection-container-wc.nll.stderr => regions-outlives-projection-container-wc.stderr} (88%) delete mode 100644 src/test/ui/regions/regions-outlives-projection-container.base.stderr rename src/test/ui/regions/{regions-outlives-projection-container.nll.stderr => regions-outlives-projection-container.stderr} (88%) delete mode 100644 src/test/ui/regions/regions-proc-bound-capture.base.stderr rename src/test/ui/regions/{regions-proc-bound-capture.nll.stderr => regions-proc-bound-capture.stderr} (95%) delete mode 100644 src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr rename src/test/ui/regions/{regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr => regions-reborrow-from-shorter-mut-ref-mut-ref.stderr} (89%) delete mode 100644 src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr rename src/test/ui/regions/{regions-reborrow-from-shorter-mut-ref.nll.stderr => regions-reborrow-from-shorter-mut-ref.stderr} (89%) delete mode 100644 src/test/ui/regions/regions-ret-borrowed-1.base.stderr rename src/test/ui/regions/{regions-ret-borrowed-1.nll.stderr => regions-ret-borrowed-1.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-ret-borrowed.base.stderr rename src/test/ui/regions/{regions-ret-borrowed.nll.stderr => regions-ret-borrowed.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-static-bound.base.stderr rename src/test/ui/regions/{regions-static-bound.nll.stderr => regions-static-bound.stderr} (89%) delete mode 100644 src/test/ui/regions/regions-trait-object-subtyping.base.stderr rename src/test/ui/regions/{regions-trait-object-subtyping.nll.stderr => regions-trait-object-subtyping.stderr} (93%) delete mode 100644 src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr rename src/test/ui/regions/{regions-variance-contravariant-use-covariant-in-second-position.nll.stderr => regions-variance-contravariant-use-covariant-in-second-position.stderr} (96%) delete mode 100644 src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr rename src/test/ui/regions/{regions-variance-contravariant-use-covariant.nll.stderr => regions-variance-contravariant-use-covariant.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr rename src/test/ui/regions/{regions-variance-covariant-use-contravariant.nll.stderr => regions-variance-covariant-use-contravariant.stderr} (87%) delete mode 100644 src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr rename src/test/ui/regions/{regions-variance-invariant-use-contravariant.nll.stderr => regions-variance-invariant-use-contravariant.stderr} (92%) delete mode 100644 src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr rename src/test/ui/regions/{regions-variance-invariant-use-covariant.nll.stderr => regions-variance-invariant-use-covariant.stderr} (90%) delete mode 100644 src/test/ui/rfc1623.base.stderr rename src/test/ui/{rfc1623.nll.stderr => rfc1623.stderr} (92%) delete mode 100644 src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr rename src/test/ui/self/{arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr => arbitrary_self_types_pin_lifetime_mismatch-async.stderr} (96%) delete mode 100644 src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr rename src/test/ui/self/{arbitrary_self_types_pin_lifetime_mismatch.nll.stderr => arbitrary_self_types_pin_lifetime_mismatch.stderr} (90%) delete mode 100644 src/test/ui/self/elision/lt-ref-self-async.base.stderr rename src/test/ui/self/elision/{lt-ref-self-async.nll.stderr => lt-ref-self-async.stderr} (95%) delete mode 100644 src/test/ui/self/elision/lt-ref-self.base.stderr rename src/test/ui/self/elision/{lt-ref-self.nll.stderr => lt-ref-self.stderr} (96%) delete mode 100644 src/test/ui/self/elision/ref-mut-self-async.base.stderr rename src/test/ui/self/elision/{ref-mut-self-async.nll.stderr => ref-mut-self-async.stderr} (95%) delete mode 100644 src/test/ui/self/elision/ref-mut-self.base.stderr rename src/test/ui/self/elision/{ref-mut-self.nll.stderr => ref-mut-self.stderr} (96%) delete mode 100644 src/test/ui/self/elision/ref-mut-struct-async.base.stderr rename src/test/ui/self/elision/{ref-mut-struct-async.nll.stderr => ref-mut-struct-async.stderr} (96%) delete mode 100644 src/test/ui/self/elision/ref-mut-struct.base.stderr rename src/test/ui/self/elision/{ref-mut-struct.nll.stderr => ref-mut-struct.stderr} (96%) delete mode 100644 src/test/ui/self/elision/ref-self-async.base.stderr rename src/test/ui/self/elision/{ref-self-async.nll.stderr => ref-self-async.stderr} (96%) delete mode 100644 src/test/ui/self/elision/ref-self.base.stderr rename src/test/ui/self/elision/{ref-self.nll.stderr => ref-self.stderr} (96%) delete mode 100644 src/test/ui/self/elision/ref-struct-async.base.stderr rename src/test/ui/self/elision/{ref-struct-async.nll.stderr => ref-struct-async.stderr} (96%) delete mode 100644 src/test/ui/self/elision/ref-struct.base.stderr rename src/test/ui/self/elision/{ref-struct.nll.stderr => ref-struct.stderr} (96%) delete mode 100644 src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr rename src/test/ui/suggestions/{impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr => impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr} (91%) delete mode 100644 src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs delete mode 100644 src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr delete mode 100644 src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed delete mode 100644 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr rename src/test/ui/suggestions/lifetimes/{missing-lifetimes-in-signature-2.nll.stderr => missing-lifetimes-in-signature-2.stderr} (80%) delete mode 100644 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr rename src/test/ui/suggestions/lifetimes/{missing-lifetimes-in-signature.nll.stderr => missing-lifetimes-in-signature.stderr} (83%) delete mode 100644 src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr rename src/test/ui/suggestions/lifetimes/{trait-object-nested-in-impl-trait.nll.stderr => trait-object-nested-in-impl-trait.stderr} (93%) delete mode 100644 src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed delete mode 100644 src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs delete mode 100644 src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr delete mode 100644 src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr rename src/test/ui/traits/object/{supertrait-lifetime-bound.nll.stderr => supertrait-lifetime-bound.stderr} (86%) delete mode 100644 src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr rename src/test/ui/traits/trait-upcasting/{type-checking-test-3.nll.stderr => type-checking-test-3.stderr} (88%) delete mode 100644 src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr rename src/test/ui/traits/trait-upcasting/{type-checking-test-4.nll.stderr => type-checking-test-4.stderr} (88%) delete mode 100644 src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr rename src/test/ui/type-alias-impl-trait/{generic_type_does_not_live_long_enough.base.stderr => generic_type_does_not_live_long_enough.stderr} (77%) delete mode 100644 src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr rename src/test/ui/type-alias-impl-trait/{issue-57611-trait-alias.nll.stderr => issue-57611-trait-alias.stderr} (85%) delete mode 100644 src/test/ui/unboxed-closures/issue-30906.base.stderr rename src/test/ui/unboxed-closures/{issue-30906.nll.stderr => issue-30906.stderr} (92%) delete mode 100644 src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr rename src/test/ui/unboxed-closures/{unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr => unboxed-closures-infer-argument-types-two-region-pointers.stderr} (96%) delete mode 100644 src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr rename src/test/ui/underscore-lifetime/{dyn-trait-underscore.nll.stderr => dyn-trait-underscore.stderr} (94%) delete mode 100644 src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr rename src/test/ui/underscore-lifetime/{underscore-lifetime-elison-mismatch.nll.stderr => underscore-lifetime-elison-mismatch.stderr} (91%) delete mode 100644 src/test/ui/variance/variance-associated-types2.base.stderr rename src/test/ui/variance/{variance-associated-types2.nll.stderr => variance-associated-types2.stderr} (87%) delete mode 100644 src/test/ui/variance/variance-btree-invariant-types.base.stderr rename src/test/ui/variance/{variance-btree-invariant-types.nll.stderr => variance-btree-invariant-types.stderr} (94%) delete mode 100644 src/test/ui/variance/variance-cell-is-invariant.base.stderr rename src/test/ui/variance/{variance-cell-is-invariant.nll.stderr => variance-cell-is-invariant.stderr} (93%) delete mode 100644 src/test/ui/variance/variance-contravariant-arg-object.base.stderr rename src/test/ui/variance/{variance-contravariant-arg-object.nll.stderr => variance-contravariant-arg-object.stderr} (89%) delete mode 100644 src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr rename src/test/ui/variance/{variance-contravariant-arg-trait-match.nll.stderr => variance-contravariant-arg-trait-match.stderr} (88%) delete mode 100644 src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr rename src/test/ui/variance/{variance-contravariant-self-trait-match.nll.stderr => variance-contravariant-self-trait-match.stderr} (87%) delete mode 100644 src/test/ui/variance/variance-covariant-arg-object.base.stderr rename src/test/ui/variance/{variance-covariant-arg-object.nll.stderr => variance-covariant-arg-object.stderr} (90%) delete mode 100644 src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr rename src/test/ui/variance/{variance-invariant-arg-trait-match.nll.stderr => variance-covariant-arg-trait-match.stderr} (89%) delete mode 100644 src/test/ui/variance/variance-covariant-self-trait-match.base.stderr rename src/test/ui/variance/{variance-covariant-self-trait-match.nll.stderr => variance-covariant-self-trait-match.stderr} (88%) delete mode 100644 src/test/ui/variance/variance-invariant-arg-object.base.stderr rename src/test/ui/variance/{variance-invariant-arg-object.nll.stderr => variance-invariant-arg-object.stderr} (90%) delete mode 100644 src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr rename src/test/ui/variance/{variance-covariant-arg-trait-match.nll.stderr => variance-invariant-arg-trait-match.stderr} (89%) delete mode 100644 src/test/ui/variance/variance-invariant-self-trait-match.base.stderr rename src/test/ui/variance/{variance-invariant-self-trait-match.nll.stderr => variance-invariant-self-trait-match.stderr} (88%) delete mode 100644 src/test/ui/variance/variance-trait-matching.base.stderr rename src/test/ui/variance/{variance-trait-matching.nll.stderr => variance-trait-matching.stderr} (89%) delete mode 100644 src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr rename src/test/ui/variance/{variance-use-contravariant-struct-1.nll.stderr => variance-use-contravariant-struct-1.stderr} (88%) delete mode 100644 src/test/ui/variance/variance-use-covariant-struct-1.base.stderr rename src/test/ui/variance/{variance-use-covariant-struct-1.nll.stderr => variance-use-covariant-struct-1.stderr} (89%) delete mode 100644 src/test/ui/variance/variance-use-invariant-struct-1.base.stderr rename src/test/ui/variance/{variance-use-invariant-struct-1.nll.stderr => variance-use-invariant-struct-1.stderr} (93%) delete mode 100644 src/test/ui/wf/wf-static-method.base.stderr rename src/test/ui/wf/{wf-static-method.nll.stderr => wf-static-method.stderr} (92%) delete mode 100644 src/test/ui/where-clauses/where-for-self-2.base.stderr rename src/test/ui/where-clauses/{where-for-self-2.nll.stderr => where-for-self-2.stderr} (90%) diff --git a/compiler/rustc_apfloat/src/lib.rs b/compiler/rustc_apfloat/src/lib.rs index 143c6f7610c..cfc3d5b15a6 100644 --- a/compiler/rustc_apfloat/src/lib.rs +++ b/compiler/rustc_apfloat/src/lib.rs @@ -33,7 +33,6 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![no_std] #![forbid(unsafe_code)] -#![feature(nll)] #[macro_use] extern crate alloc; diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 2015d635e56..4b94ec0d6d8 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -17,7 +17,6 @@ #![feature(let_chains)] #![feature(min_specialization)] #![feature(negative_impls)] -#![feature(nll)] #![feature(slice_internals)] #![feature(stmt_expr_attributes)] #![recursion_limit = "256"] diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index 48b1470ced5..124d0d18cdb 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -9,7 +9,6 @@ #![feature(is_sorted)] #![feature(let_chains)] #![feature(let_else)] -#![feature(nll)] #![feature(proc_macro_internals)] #![feature(proc_macro_quote)] #![recursion_limit = "256"] diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 913cf4eea13..6713a756735 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -9,7 +9,6 @@ #![feature(let_else)] #![feature(extern_types)] #![feature(once_cell)] -#![feature(nll)] #![feature(iter_intersperse)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs index 7fde700be39..453c57b46d7 100644 --- a/compiler/rustc_codegen_ssa/src/lib.rs +++ b/compiler/rustc_codegen_ssa/src/lib.rs @@ -3,7 +3,6 @@ #![feature(try_blocks)] #![feature(let_else)] #![feature(once_cell)] -#![feature(nll)] #![feature(associated_type_bounds)] #![feature(strict_provenance)] #![feature(int_roundings)] diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index 179a184536e..c37a8d47b93 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -5,7 +5,6 @@ //! This API is completely unstable and subject to change. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![feature(nll)] #![feature(let_else)] #![feature(once_cell)] #![recursion_limit = "256"] diff --git a/compiler/rustc_error_codes/src/error_codes/E0312.md b/compiler/rustc_error_codes/src/error_codes/E0312.md index cb090d01382..c5f7cf2e337 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0312.md +++ b/compiler/rustc_error_codes/src/error_codes/E0312.md @@ -1,8 +1,10 @@ +#### Note: this error code is no longer emitted by the compiler. + Reference's lifetime of borrowed content doesn't match the expected lifetime. Erroneous code example: -```compile_fail,E0312 +```compile_fail pub fn opt_str<'a>(maybestr: &'a Option) -> &'static str { if maybestr.is_none() { "(none)" diff --git a/compiler/rustc_error_codes/src/error_codes/E0477.md b/compiler/rustc_error_codes/src/error_codes/E0477.md index 9cfefb1de63..c6be8dc705e 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0477.md +++ b/compiler/rustc_error_codes/src/error_codes/E0477.md @@ -1,8 +1,10 @@ +#### Note: this error code is no longer emitted by the compiler. + The type does not fulfill the required lifetime. Erroneous code example: -```compile_fail,E0477 +```compile_fail use std::sync::Mutex; struct MyString<'a> { diff --git a/compiler/rustc_error_codes/src/error_codes/E0495.md b/compiler/rustc_error_codes/src/error_codes/E0495.md index f956237b80b..cd10e719312 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0495.md +++ b/compiler/rustc_error_codes/src/error_codes/E0495.md @@ -1,8 +1,10 @@ +#### Note: this error code is no longer emitted by the compiler. + A lifetime cannot be determined in the given situation. Erroneous code example: -```compile_fail,E0495 +```compile_fail fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { match (&t,) { // error! ((u,),) => u, diff --git a/compiler/rustc_error_codes/src/error_codes/E0623.md b/compiler/rustc_error_codes/src/error_codes/E0623.md index 1290edd0a0e..34db641bb90 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0623.md +++ b/compiler/rustc_error_codes/src/error_codes/E0623.md @@ -3,39 +3,70 @@ A lifetime didn't match what was expected. Erroneous code example: ```compile_fail,E0623 -struct Foo<'a> { - x: &'a isize, -} +struct Foo<'a, 'b, T>(std::marker::PhantomData<(&'a (), &'b (), T)>) +where + T: Convert<'a, 'b>; -fn bar<'short, 'long>(c: Foo<'short>, l: &'long isize) { - let _: Foo<'long> = c; // error! +trait Convert<'a, 'b>: Sized { + fn cast(&'a self) -> &'b Self; +} +impl<'long: 'short, 'short, T> Convert<'long, 'short> for T { + fn cast(&'long self) -> &'short T { + self + } +} +// error +fn badboi<'in_, 'out, T>( + x: Foo<'in_, 'out, T>, + sadness: &'in_ T +) -> &'out T { + sadness.cast() } ``` In this example, we tried to set a value with an incompatible lifetime to -another one (`'long` is unrelated to `'short`). We can solve this issue in +another one (`'in_` is unrelated to `'out`). We can solve this issue in two different ways: -Either we make `'short` live at least as long as `'long`: +Either we make `'in_` live at least as long as `'out`: ``` -struct Foo<'a> { - x: &'a isize, -} +struct Foo<'a, 'b, T>(std::marker::PhantomData<(&'a (), &'b (), T)>) +where + T: Convert<'a, 'b>; -// we set 'short to live at least as long as 'long -fn bar<'short: 'long, 'long>(c: Foo<'short>, l: &'long isize) { - let _: Foo<'long> = c; // ok! +trait Convert<'a, 'b>: Sized { + fn cast(&'a self) -> &'b Self; +} +impl<'long: 'short, 'short, T> Convert<'long, 'short> for T { + fn cast(&'long self) -> &'short T { + self + } +} +fn badboi<'in_: 'out, 'out, T>( + x: Foo<'in_, 'out, T>, + sadness: &'in_ T +) -> &'out T { + sadness.cast() } ``` Or we use only one lifetime: ``` -struct Foo<'a> { - x: &'a isize, +struct Foo<'a, 'b, T>(std::marker::PhantomData<(&'a (), &'b (), T)>) +where + T: Convert<'a, 'b>; + +trait Convert<'a, 'b>: Sized { + fn cast(&'a self) -> &'b Self; } -fn bar<'short>(c: Foo<'short>, l: &'short isize) { - let _: Foo<'short> = c; // ok! +impl<'long: 'short, 'short, T> Convert<'long, 'short> for T { + fn cast(&'long self) -> &'short T { + self + } +} +fn badboi<'out, T>(x: Foo<'out, 'out, T>, sadness: &'out T) -> &'out T { + sadness.cast() } ``` diff --git a/compiler/rustc_error_codes/src/error_codes/E0713.md b/compiler/rustc_error_codes/src/error_codes/E0713.md index 9361046943f..9b1b77f3bc7 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0713.md +++ b/compiler/rustc_error_codes/src/error_codes/E0713.md @@ -4,8 +4,6 @@ lifetime of a type that implements the `Drop` trait. Erroneous code example: ```compile_fail,E0713 -#![feature(nll)] - pub struct S<'a> { data: &'a mut String } impl<'a> Drop for S<'a> { diff --git a/compiler/rustc_error_codes/src/error_codes/E0759.md b/compiler/rustc_error_codes/src/error_codes/E0759.md index 6b16a7d415a..ce5d42b3c7f 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0759.md +++ b/compiler/rustc_error_codes/src/error_codes/E0759.md @@ -1,8 +1,10 @@ +#### Note: this error code is no longer emitted by the compiler. + Return type involving a trait did not require `'static` lifetime. Erroneous code examples: -```compile_fail,E0759 +```compile_fail use std::fmt::Debug; fn foo(x: &i32) -> impl Debug { // error! diff --git a/compiler/rustc_error_codes/src/error_codes/E0772.md b/compiler/rustc_error_codes/src/error_codes/E0772.md index 3b73abaf776..5ffffd5112d 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0772.md +++ b/compiler/rustc_error_codes/src/error_codes/E0772.md @@ -1,9 +1,11 @@ +#### Note: this error code is no longer emitted by the compiler. + A trait object has some specific lifetime `'1`, but it was used in a way that requires it to have a `'static` lifetime. Example of erroneous code: -```compile_fail,E0772 +```compile_fail trait BooleanLike {} trait Person {} diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index fb02f1d68eb..3be6dd5af75 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -8,7 +8,6 @@ #![feature(if_let_guard)] #![feature(let_else)] #![feature(never_type)] -#![feature(nll)] #![feature(adt_const_params)] #![allow(incomplete_features)] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 048039343a7..071e88e07fd 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -221,6 +221,8 @@ declare_features! ( (accepted, native_link_modifiers, "1.61.0", Some(81490), None), /// Allows specifying the whole-archive link modifier (accepted, native_link_modifiers_whole_archive, "1.61.0", Some(81490), None), + /// Allows using non lexical lifetimes (RFC 2094). + (accepted, nll, "1.63.0", Some(43234), None), /// Allows using `#![no_std]`. (accepted, no_std, "1.6.0", None, None), /// Allows defining identifiers beyond ASCII. diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 1466e8dfc92..b6ab60f9f03 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -461,8 +461,6 @@ declare_features! ( (active, never_type, "1.13.0", Some(35121), None), /// Allows diverging expressions to fall back to `!` rather than `()`. (active, never_type_fallback, "1.41.0", Some(65992), None), - /// Allows using non lexical lifetimes (RFC 2094). - (active, nll, "1.0.0", Some(43234), None), /// Allows `#![no_core]`. (active, no_core, "1.3.0", Some(29639), None), /// Allows function attribute `#[no_coverage]`, to bypass coverage diff --git a/compiler/rustc_graphviz/src/lib.rs b/compiler/rustc_graphviz/src/lib.rs index 676c66f41a9..6eaff5c2f74 100644 --- a/compiler/rustc_graphviz/src/lib.rs +++ b/compiler/rustc_graphviz/src/lib.rs @@ -273,7 +273,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", test(attr(allow(unused_variables), deny(warnings))) )] -#![feature(nll)] use LabelText::*; diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index 01711345966..1e88e8091c3 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -3,7 +3,6 @@ #![deny(missing_docs)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(let_else)] -#![feature(nll)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs index 0f341a947ad..44cf9b6611e 100644 --- a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs +++ b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs @@ -42,18 +42,7 @@ pub(crate) fn resolve<'tcx>( let values = resolver.infer_variable_values(&mut errors); (values, errors) } - RegionckMode::Erase { suppress_errors: false } => { - // Do real inference to get errors, then erase the results. - let mut values = resolver.infer_variable_values(&mut errors); - let re_erased = region_rels.tcx.lifetimes.re_erased; - - values.values.iter_mut().for_each(|v| match *v { - VarValue::Value(ref mut r) => *r = re_erased, - VarValue::ErrorValue => {} - }); - (values, errors) - } - RegionckMode::Erase { suppress_errors: true } => { + RegionckMode::Erase => { // Skip region inference entirely. (resolver.erased_data(region_rels.tcx), Vec::new()) } diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 4ef6f240c48..24a9b399eac 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -29,7 +29,6 @@ use rustc_middle::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, Substs pub use rustc_middle::ty::IntVarValue; use rustc_middle::ty::{self, GenericParamDefKind, InferConst, Ty, TyCtxt}; use rustc_middle::ty::{ConstVid, FloatVid, IntVid, TyVid}; -use rustc_session::config::BorrowckMode; use rustc_span::symbol::Symbol; use rustc_span::Span; @@ -97,29 +96,7 @@ pub enum RegionckMode { #[default] Solve, /// Erase the results of region after solving. - Erase { - /// A flag that is used to suppress region errors, when we are doing - /// region checks that the NLL borrow checker will also do -- it might - /// be set to true. - suppress_errors: bool, - }, -} - -impl RegionckMode { - /// Indicates that the MIR borrowck will repeat these region - /// checks, so we should ignore errors if NLL is (unconditionally) - /// enabled. - pub fn for_item_body(tcx: TyCtxt<'_>) -> Self { - // FIXME(Centril): Once we actually remove `::Migrate` also make - // this always `true` and then proceed to eliminate the dead code. - match tcx.borrowck_mode() { - // If we're on Migrate mode, report AST region errors - BorrowckMode::Migrate => RegionckMode::Erase { suppress_errors: false }, - - // If we're on MIR, don't report AST region errors as they should be reported by NLL - BorrowckMode::Mir => RegionckMode::Erase { suppress_errors: true }, - } - } + Erase, } /// This type contains all the things within `InferCtxt` that sit within a diff --git a/compiler/rustc_interface/src/lib.rs b/compiler/rustc_interface/src/lib.rs index 40e02f47bd1..d443057eb79 100644 --- a/compiler/rustc_interface/src/lib.rs +++ b/compiler/rustc_interface/src/lib.rs @@ -2,7 +2,6 @@ #![feature(let_else)] #![feature(internal_output_capture)] #![feature(thread_spawn_unchecked)] -#![feature(nll)] #![feature(once_cell)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index a178cca6d10..f2cfbea207e 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -644,7 +644,6 @@ fn test_debugging_options_tracking_hash() { // Make sure that changing an [UNTRACKED] option leaves the hash unchanged. // This list is in alphabetical order. untracked!(assert_incr_state, Some(String::from("loaded"))); - untracked!(borrowck, String::from("other")); untracked!(deduplicate_diagnostics, false); untracked!(dep_tasks, true); untracked!(dlltool, Some(PathBuf::from("custom_dlltool.exe"))); diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 7c68429e1e9..ff4ed94fab3 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -36,7 +36,6 @@ #![feature(let_chains)] #![feature(let_else)] #![feature(never_type)] -#![feature(nll)] #![recursion_limit = "256"] #[macro_use] diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index b63f81bffaa..8eade02a408 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -1,4 +1,3 @@ -#![feature(nll)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] // NOTE: This crate only exists to allow linking on mingw targets. diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index eb008fd2693..5ad16398695 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -6,7 +6,6 @@ #![feature(iter_from_generator)] #![feature(let_chains)] #![feature(let_else)] -#![feature(nll)] #![feature(once_cell)] #![feature(proc_macro_internals)] #![feature(macro_metavar_expr)] diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index 17ca534d91b..8004319bf9b 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -39,7 +39,6 @@ #![feature(never_type)] #![feature(extern_types)] #![feature(new_uninit)] -#![feature(nll)] #![feature(once_cell)] #![feature(let_chains)] #![feature(let_else)] diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 72e2beb372d..54331e21100 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -49,7 +49,7 @@ use rustc_macros::HashStable; use rustc_middle::mir::FakeReadCause; use rustc_query_system::ich::StableHashingContext; use rustc_serialize::opaque::{FileEncodeResult, FileEncoder}; -use rustc_session::config::{BorrowckMode, CrateType, OutputFilenames}; +use rustc_session::config::{CrateType, OutputFilenames}; use rustc_session::lint::{Level, Lint}; use rustc_session::Limit; use rustc_session::Session; @@ -1470,44 +1470,6 @@ impl<'tcx> TyCtxt<'tcx> { self.on_disk_cache.as_ref().map_or(Ok(()), |c| c.serialize(self, encoder)) } - /// If `true`, we should use the MIR-based borrowck, but also - /// fall back on the AST borrowck if the MIR-based one errors. - pub fn migrate_borrowck(self) -> bool { - self.borrowck_mode().migrate() - } - - /// What mode(s) of borrowck should we run? AST? MIR? both? - /// (Also considers the `#![feature(nll)]` setting.) - pub fn borrowck_mode(self) -> BorrowckMode { - // Here are the main constraints we need to deal with: - // - // 1. An opts.borrowck_mode of `BorrowckMode::Migrate` is - // synonymous with no `-Z borrowck=...` flag at all. - // - // 2. We want to allow developers on the Nightly channel - // to opt back into the "hard error" mode for NLL, - // (which they can do via specifying `#![feature(nll)]` - // explicitly in their crate). - // - // So, this precedence list is how pnkfelix chose to work with - // the above constraints: - // - // * `#![feature(nll)]` *always* means use NLL with hard - // errors. (To simplify the code here, it now even overrides - // a user's attempt to specify `-Z borrowck=compare`, which - // we arguably do not need anymore and should remove.) - // - // * Otherwise, if no `-Z borrowck=...` then use migrate mode - // - // * Otherwise, use the behavior requested via `-Z borrowck=...` - - if self.features().nll { - return BorrowckMode::Mir; - } - - self.sess.opts.borrowck_mode - } - /// If `true`, we should use lazy normalization for constants, otherwise /// we still evaluate them eagerly. #[inline] diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs index a2d8e5168c4..497c0931c21 100644 --- a/compiler/rustc_passes/src/lib.rs +++ b/compiler/rustc_passes/src/lib.rs @@ -11,7 +11,6 @@ #![feature(let_chains)] #![feature(map_try_insert)] #![feature(min_specialization)] -#![feature(nll)] #![feature(try_blocks)] #![recursion_limit = "256"] diff --git a/compiler/rustc_plugin_impl/src/lib.rs b/compiler/rustc_plugin_impl/src/lib.rs index a1e13a1abb6..1195045bdea 100644 --- a/compiler/rustc_plugin_impl/src/lib.rs +++ b/compiler/rustc_plugin_impl/src/lib.rs @@ -7,7 +7,6 @@ //! of the Unstable Book for some examples. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![feature(nll)] #![recursion_limit = "256"] use rustc_lint::LintStore; diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index e6c7b4064fb..82ea78648c7 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -1,5 +1,4 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![feature(nll)] #![feature(control_flow_enum)] #![feature(try_blocks)] #![feature(associated_type_defaults)] diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index bfc51dedbc7..5e28c229aa5 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -1,7 +1,6 @@ //! Support for serializing the dep-graph and reloading it. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![feature(nll)] #![feature(min_specialization)] #![feature(once_cell)] #![feature(rustc_attrs)] diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 73c8a9d28bd..14b8c7df7a6 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -13,7 +13,7 @@ #![feature(let_chains)] #![feature(let_else)] #![feature(never_type)] -#![feature(nll)] +#![cfg_attr(bootstrap, feature(nll))] #![recursion_limit = "256"] #![allow(rustdoc::private_intra_doc_links)] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs index 5d94884e0f6..99f38b3222d 100644 --- a/compiler/rustc_save_analysis/src/lib.rs +++ b/compiler/rustc_save_analysis/src/lib.rs @@ -1,6 +1,5 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(if_let_guard)] -#![feature(nll)] #![feature(let_else)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_serialize/src/lib.rs b/compiler/rustc_serialize/src/lib.rs index b3a0bcf0e11..e606f427335 100644 --- a/compiler/rustc_serialize/src/lib.rs +++ b/compiler/rustc_serialize/src/lib.rs @@ -10,7 +10,6 @@ Core encoding and decoding interfaces. test(attr(allow(unused_variables), deny(warnings))) )] #![feature(never_type)] -#![feature(nll)] #![feature(associated_type_bounds)] #![feature(min_specialization)] #![feature(core_intrinsics)] diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 997f361737b..5190cd44936 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -741,7 +741,6 @@ impl Default for Options { incremental: None, debugging_opts: Default::default(), prints: Vec::new(), - borrowck_mode: BorrowckMode::Migrate, cg: Default::default(), error_format: ErrorOutputType::default(), externs: Externs(BTreeMap::new()), @@ -2084,14 +2083,6 @@ fn parse_libs(matches: &getopts::Matches, error_format: ErrorOutputType) -> Vec< .collect() } -fn parse_borrowck_mode(dopts: &DebuggingOptions, error_format: ErrorOutputType) -> BorrowckMode { - match dopts.borrowck.as_ref() { - "migrate" => BorrowckMode::Migrate, - "mir" => BorrowckMode::Mir, - m => early_error(error_format, &format!("unknown borrowck mode `{m}`")), - } -} - pub fn parse_externs( matches: &getopts::Matches, debugging_opts: &DebuggingOptions, @@ -2429,8 +2420,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { let test = matches.opt_present("test"); - let borrowck_mode = parse_borrowck_mode(&debugging_opts, error_format); - if !cg.remark.is_empty() && debuginfo == DebugInfo::None { early_warn(error_format, "-C remark requires \"-C debuginfo=n\" to show source locations"); } @@ -2506,7 +2495,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { incremental, debugging_opts, prints, - borrowck_mode, cg, error_format, externs, diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index ae32fd2dee9..181acc224fa 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -178,9 +178,6 @@ top_level_options!( debugging_opts: DebuggingOptions [SUBSTRUCT], prints: Vec [UNTRACKED], - /// Determines which borrow checker(s) to run. This is the parsed, sanitized - /// version of `debugging_opts.borrowck`, which is just a plain string. - borrowck_mode: BorrowckMode [UNTRACKED], cg: CodegenOptions [SUBSTRUCT], externs: Externs [UNTRACKED], crate_name: Option [TRACKED], @@ -1210,8 +1207,6 @@ options! { binary_dep_depinfo: bool = (false, parse_bool, [TRACKED], "include artifacts (sysroot, crate dependencies) used during compilation in dep-info \ (default: no)"), - borrowck: String = ("migrate".to_string(), parse_string, [UNTRACKED], - "select which borrowck is used (`mir` or `migrate`) (default: `migrate`)"), branch_protection: Option = (None, parse_branch_protection, [TRACKED], "set options for branch target identification and pointer authentication on AArch64"), cf_protection: CFProtection = (CFProtection::None, parse_cfprotection, [TRACKED], diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 01fe9aea89b..ae0228d6ea0 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -18,7 +18,6 @@ #![feature(let_else)] #![feature(if_let_guard)] #![feature(negative_impls)] -#![feature(nll)] #![feature(min_specialization)] #![feature(rustc_attrs)] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index ee0994c9ad6..46f70bb1674 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -89,7 +89,6 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(never_type)] -#![feature(nll)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index e9627e33ff1..a8ddcc9bfac 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -13,7 +13,6 @@ #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] -#![feature(nll)] #![feature(rustc_attrs)] #![feature(step_trait)] diff --git a/compiler/rustc_traits/src/lib.rs b/compiler/rustc_traits/src/lib.rs index 6489bd2202d..2bea164c051 100644 --- a/compiler/rustc_traits/src/lib.rs +++ b/compiler/rustc_traits/src/lib.rs @@ -2,7 +2,6 @@ //! the guts are broken up into modules; see the comments in those modules. #![feature(let_else)] -#![feature(nll)] #![recursion_limit = "256"] #[macro_use] diff --git a/compiler/rustc_ty_utils/src/lib.rs b/compiler/rustc_ty_utils/src/lib.rs index 702a9513b44..484967bbef8 100644 --- a/compiler/rustc_ty_utils/src/lib.rs +++ b/compiler/rustc_ty_utils/src/lib.rs @@ -7,7 +7,6 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(control_flow_enum)] #![feature(let_else)] -#![feature(nll)] #![recursion_limit = "256"] #[macro_use] diff --git a/compiler/rustc_typeck/src/check/regionck.rs b/compiler/rustc_typeck/src/check/regionck.rs index 01a76ce5586..e4be4603558 100644 --- a/compiler/rustc_typeck/src/check/regionck.rs +++ b/compiler/rustc_typeck/src/check/regionck.rs @@ -165,7 +165,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { rcx.visit_body(body); rcx.visit_region_obligations(id); } - rcx.resolve_regions_and_report_errors(RegionckMode::for_item_body(self.tcx)); + rcx.resolve_regions_and_report_errors(RegionckMode::Erase); } /// Region checking during the WF phase for items. `wf_tys` are the @@ -208,7 +208,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { rcx.visit_fn_body(fn_id, body, self.tcx.hir().span(fn_id)); } - rcx.resolve_regions_and_report_errors(RegionckMode::for_item_body(self.tcx)); + rcx.resolve_regions_and_report_errors(RegionckMode::Erase); } } diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs index 454c71d4971..2fc9705527b 100644 --- a/compiler/rustc_typeck/src/lib.rs +++ b/compiler/rustc_typeck/src/lib.rs @@ -69,7 +69,6 @@ This API is completely unstable and subject to change. #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] -#![feature(nll)] #![feature(once_cell)] #![feature(slice_partition_dedup)] #![feature(try_blocks)] diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 710a3985266..40b7a493557 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -166,7 +166,6 @@ #![feature(min_specialization)] #![feature(negative_impls)] #![feature(never_type)] -#![feature(nll)] // Not necessary, but here to test the `nll` feature. #![feature(rustc_allow_const_fn_unstable)] #![feature(rustc_attrs)] #![feature(slice_internals)] diff --git a/library/panic_abort/src/lib.rs b/library/panic_abort/src/lib.rs index 0a1aa7bb3c8..6a01b4a2e28 100644 --- a/library/panic_abort/src/lib.rs +++ b/library/panic_abort/src/lib.rs @@ -9,7 +9,6 @@ #![panic_runtime] #![allow(unused_features)] #![feature(core_intrinsics)] -#![feature(nll)] #![feature(panic_runtime)] #![feature(std_internals)] #![feature(staged_api)] diff --git a/library/panic_unwind/src/lib.rs b/library/panic_unwind/src/lib.rs index 4ae5f8ae446..f9acb42c46b 100644 --- a/library/panic_unwind/src/lib.rs +++ b/library/panic_unwind/src/lib.rs @@ -16,7 +16,6 @@ #![doc(issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")] #![feature(core_intrinsics)] #![feature(lang_items)] -#![feature(nll)] #![feature(panic_unwind)] #![feature(staged_api)] #![feature(std_internals)] diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index f1c5eaad868..30ad3d23880 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -21,7 +21,6 @@ // Please avoid unstable features where possible to minimize the amount of changes necessary // to make it compile with rust-analyzer on stable. #![feature(rustc_allow_const_fn_unstable)] -#![feature(nll)] #![feature(staged_api)] #![feature(allow_internal_unstable)] #![feature(decl_macro)] diff --git a/library/profiler_builtins/src/lib.rs b/library/profiler_builtins/src/lib.rs index bb1f2785deb..0c83bcee06f 100644 --- a/library/profiler_builtins/src/lib.rs +++ b/library/profiler_builtins/src/lib.rs @@ -7,5 +7,4 @@ issue = "none" )] #![allow(unused_features)] -#![feature(nll)] #![feature(staged_api)] diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs index 6dcd55cc937..52a02e998b4 100644 --- a/library/std/src/keyword_docs.rs +++ b/library/std/src/keyword_docs.rs @@ -2167,7 +2167,7 @@ mod use_keyword {} /// is missing: the `'b` lifetime is not known to live at least as long as `'a` /// which means this function cannot ensure it always returns a valid reference: /// -/// ```rust,compile_fail,E0623 +/// ```rust,compile_fail /// fn select<'a, 'b>(s1: &'a str, s2: &'b str, second: bool) -> &'a str /// { /// if second { s2 } else { s1 } diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 71ea5f1a1f0..b1c68ec43bc 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -248,7 +248,7 @@ #![feature(needs_panic_runtime)] #![feature(negative_impls)] #![feature(never_type)] -#![feature(nll)] +#![cfg_attr(bootstrap, feature(nll))] #![feature(platform_intrinsics)] #![feature(prelude_import)] #![feature(rustc_attrs)] diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs index 0c748da1a59..3b7193adcc7 100644 --- a/library/test/src/lib.rs +++ b/library/test/src/lib.rs @@ -15,7 +15,6 @@ #![unstable(feature = "test", issue = "50297")] #![doc(test(attr(deny(warnings))))] -#![feature(nll)] #![feature(bench_black_box)] #![feature(internal_output_capture)] #![feature(staged_api)] diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs index c92a7d310f3..15254bc755b 100644 --- a/library/unwind/src/lib.rs +++ b/library/unwind/src/lib.rs @@ -2,7 +2,6 @@ #![unstable(feature = "panic_unwind", issue = "32837")] #![feature(link_cfg)] #![feature(native_link_modifiers_bundle)] -#![feature(nll)] #![feature(staged_api)] #![feature(c_unwind)] #![feature(cfg_target_abi)] diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index 9827a6c590b..f692ff72d4e 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -452,7 +452,7 @@ Arguments: ./x.py test library/std --test-args hash_map ./x.py test library/std --stage 0 --no-doc ./x.py test src/test/ui --bless - ./x.py test src/test/ui --compare-mode nll + ./x.py test src/test/ui --compare-mode chalk Note that `test src/test/* --stage N` does NOT depend on `build compiler/rustc --stage N`; just like `build library/std --stage N` it tests the compiler produced by the previous diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index b71bf62fe45..8a236ec5130 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1167,12 +1167,7 @@ macro_rules! test_definitions { }; } -default_test_with_compare_mode!(Ui { - path: "src/test/ui", - mode: "ui", - suite: "ui", - compare_mode: "nll" -}); +default_test!(Ui { path: "src/test/ui", mode: "ui", suite: "ui" }); default_test!(RunPassValgrind { path: "src/test/run-pass-valgrind", diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 8b3edfd2135..ea842a85070 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -11,7 +11,7 @@ #![feature(drain_filter)] #![feature(let_chains)] #![feature(let_else)] -#![feature(nll)] +#![cfg_attr(bootstrap, feature(nll))] #![feature(test)] #![feature(never_type)] #![feature(once_cell)] diff --git a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir index e49b9898dfa..0d0204e126a 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir +++ b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir @@ -1,113 +1,113 @@ // MIR for `full_tested_match` after PromoteTemps fn full_tested_match() -> () { - let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:14:28: 14:28 - let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 - let mut _2: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 - let mut _4: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 - let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 - let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 - let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:16:35: 16:36 - let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:17:14: 17:15 - let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:17:24: 17:25 - let mut _11: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 + let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:12:28: 12:28 + let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:13:13: 17:6 + let mut _2: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 + let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:14:9: 14:16 + let mut _4: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 + let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 + let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 + let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:14:20: 14:27 + let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:14:35: 14:36 + let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:15:14: 15:15 + let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:15:24: 15:25 + let mut _11: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 scope 1 { } scope 2 { - debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:16:14: 16:15 - debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:16:14: 16:15 + debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:14:14: 14:15 + debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:14:14: 14:15 } scope 3 { - debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:17:14: 17:15 + debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:15:14: 15:15 } bb0: { - StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 - StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - _2 = Option::::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:15:13: 15:27 + StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:13:13: 17:6 + StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 + _2 = Option::::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 + FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 + _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 + switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:13:13: 13:27 } bb1: { - _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23 + _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:16:17: 16:23 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:16:17: 16:23 } bb2: { - falseEdge -> [real: bb5, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 + falseEdge -> [real: bb5, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:14:9: 14:16 } bb3: { - falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:17:9: 17:16 + falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:15:9: 15:16 } bb4: { - unreachable; // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 + unreachable; // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 } bb5: { - StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 - _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 + StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 + _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 // mir::Constant - // + span: $DIR/match_false_edges.rs:16:14: 16:15 + // + span: $DIR/match_false_edges.rs:14:14: 14:15 // + literal: Const { ty: &Option, val: Unevaluated(full_tested_match, [], Some(promoted[0])) } - _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 - _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 - _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 + _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 + _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:13:19: 13:27 + StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27 + _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27 // mir::Constant - // + span: $DIR/match_false_edges.rs:16:20: 16:25 + // + span: $DIR/match_false_edges.rs:14:20: 14:25 // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar()) } } bb6: { - switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 + switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27 } bb7: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 - FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 - FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 - StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 - _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 - StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36 - _8 = _5; // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36 - _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:16:31: 16:37 - StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37 - StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27 + FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27 + FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27 + StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 + _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:14:14: 14:15 + StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:14:35: 14:36 + _8 = _5; // scope 2 at $DIR/match_false_edges.rs:14:35: 14:36 + _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:14:31: 14:37 + StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:14:36: 14:37 + StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37 } bb8: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 - goto -> bb3; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:14:26: 14:27 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:14:36: 14:37 + goto -> bb3; // scope 0 at $DIR/match_false_edges.rs:14:20: 14:27 } bb9: { - StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15 - _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15 - StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25 - _10 = _9; // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25 - _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:17:20: 17:26 - StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26 - StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26 + StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:15:14: 15:15 + _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:15:14: 15:15 + StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:15:24: 15:25 + _10 = _9; // scope 3 at $DIR/match_false_edges.rs:15:24: 15:25 + _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:15:20: 15:26 + StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:15:25: 15:26 + StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:15:25: 15:26 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:15:25: 15:26 } bb10: { - StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7 - StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7 - _0 = const (); // scope 0 at $DIR/match_false_edges.rs:14:28: 20:2 - return; // scope 0 at $DIR/match_false_edges.rs:20:2: 20:2 + StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:17:6: 17:7 + StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:17:6: 17:7 + _0 = const (); // scope 0 at $DIR/match_false_edges.rs:12:28: 18:2 + return; // scope 0 at $DIR/match_false_edges.rs:18:2: 18:2 } bb11 (cleanup): { - resume; // scope 0 at $DIR/match_false_edges.rs:14:1: 20:2 + resume; // scope 0 at $DIR/match_false_edges.rs:12:1: 18:2 } } diff --git a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir index 0953eba1658..270cc85ce03 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir @@ -1,108 +1,108 @@ // MIR for `full_tested_match2` before PromoteTemps fn full_tested_match2() -> () { - let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:25:29: 25:29 - let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 - let mut _2: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 - let mut _4: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 - let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 - let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 - let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:27:35: 27:36 - let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:29:14: 29:15 - let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:29:24: 29:25 + let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:23:29: 23:29 + let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:24:13: 28:6 + let mut _2: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 + let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:25:9: 25:16 + let mut _4: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 + let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:25:14: 25:15 + let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:25:14: 25:15 + let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:25:20: 25:27 + let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:25:35: 25:36 + let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 + let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:27:24: 27:25 scope 1 { } scope 2 { - debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:27:14: 27:15 - debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:27:14: 27:15 + debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:25:14: 25:15 + debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:25:14: 25:15 } scope 3 { - debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:29:14: 29:15 + debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:27:14: 27:15 } bb0: { - StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 - StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - _2 = Option::::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:26:13: 26:27 + StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:24:13: 28:6 + StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 + _2 = Option::::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 + FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 + _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 + switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:24:13: 24:27 } bb1: { - falseEdge -> [real: bb9, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:28:9: 28:13 + falseEdge -> [real: bb9, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:26:9: 26:13 } bb2: { - falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 + falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:25:9: 25:16 } bb3: { - StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15 - _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15 - StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25 - _10 = _9; // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25 - _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:29:20: 29:26 - StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26 - StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26 + StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 + _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 + StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:27:24: 27:25 + _10 = _9; // scope 3 at $DIR/match_false_edges.rs:27:24: 27:25 + _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:27:20: 27:26 + StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:27:25: 27:26 + StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:27:25: 27:26 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:27:25: 27:26 } bb4: { - unreachable; // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 + unreachable; // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 } bb5: { - StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 - _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 - _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 - _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 + StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15 + _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15 + _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:24:19: 24:27 + StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27 + _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27 // mir::Constant - // + span: $DIR/match_false_edges.rs:27:20: 27:25 + // + span: $DIR/match_false_edges.rs:25:20: 25:25 // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar()) } } bb6: { - switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 + switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27 } bb7: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 - FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 - FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 - StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 - _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 - StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36 - _8 = _5; // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36 - _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:27:31: 27:37 - StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37 - StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27 + FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27 + FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27 + StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15 + _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:25:14: 25:15 + StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:25:35: 25:36 + _8 = _5; // scope 2 at $DIR/match_false_edges.rs:25:35: 25:36 + _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:25:31: 25:37 + StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:25:36: 25:37 + StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37 } bb8: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 - falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:25:26: 25:27 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:25:36: 25:37 + falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:25:20: 25:27 } bb9: { - _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23 + _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:26:17: 26:23 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:26:17: 26:23 } bb10: { - StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7 - StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7 - _0 = const (); // scope 0 at $DIR/match_false_edges.rs:25:29: 31:2 - return; // scope 0 at $DIR/match_false_edges.rs:31:2: 31:2 + StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:28:6: 28:7 + StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:28:6: 28:7 + _0 = const (); // scope 0 at $DIR/match_false_edges.rs:23:29: 29:2 + return; // scope 0 at $DIR/match_false_edges.rs:29:2: 29:2 } bb11 (cleanup): { - resume; // scope 0 at $DIR/match_false_edges.rs:25:1: 31:2 + resume; // scope 0 at $DIR/match_false_edges.rs:23:1: 29:2 } } diff --git a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir index a07e257f549..2f76e0137bd 100644 --- a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir @@ -1,153 +1,153 @@ // MIR for `main` before PromoteTemps fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:34:11: 34:11 - let mut _1: i32; // in scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 - let mut _2: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:38:9: 38:16 - let mut _4: isize; // in scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 - let mut _5: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - let _6: i32; // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 - let _7: &i32; // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 - let mut _8: bool; // in scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 - let _9: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 - let _10: i32; // in scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 - let _11: &i32; // in scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 - let mut _12: bool; // in scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 - let mut _13: i32; // in scope 0 at $DIR/match_false_edges.rs:38:27: 38:28 - let _14: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:39:9: 39:11 + let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:32:11: 32:11 + let mut _1: i32; // in scope 0 at $DIR/match_false_edges.rs:33:13: 38:6 + let mut _2: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:36:9: 36:16 + let mut _4: isize; // in scope 0 at $DIR/match_false_edges.rs:34:9: 34:17 + let mut _5: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + let _6: i32; // in scope 0 at $DIR/match_false_edges.rs:34:14: 34:16 + let _7: &i32; // in scope 0 at $DIR/match_false_edges.rs:34:14: 34:16 + let mut _8: bool; // in scope 0 at $DIR/match_false_edges.rs:34:21: 34:28 + let _9: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:35:9: 35:11 + let _10: i32; // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:15 + let _11: &i32; // in scope 0 at $DIR/match_false_edges.rs:36:14: 36:15 + let mut _12: bool; // in scope 0 at $DIR/match_false_edges.rs:36:20: 36:29 + let mut _13: i32; // in scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 + let _14: std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 scope 1 { } scope 2 { - debug _w => _6; // in scope 2 at $DIR/match_false_edges.rs:36:14: 36:16 - debug _w => _7; // in scope 2 at $DIR/match_false_edges.rs:36:14: 36:16 + debug _w => _6; // in scope 2 at $DIR/match_false_edges.rs:34:14: 34:16 + debug _w => _7; // in scope 2 at $DIR/match_false_edges.rs:34:14: 34:16 } scope 3 { - debug _x => _9; // in scope 3 at $DIR/match_false_edges.rs:37:9: 37:11 + debug _x => _9; // in scope 3 at $DIR/match_false_edges.rs:35:9: 35:11 } scope 4 { - debug y => _10; // in scope 4 at $DIR/match_false_edges.rs:38:14: 38:15 - debug y => _11; // in scope 4 at $DIR/match_false_edges.rs:38:14: 38:15 + debug y => _10; // in scope 4 at $DIR/match_false_edges.rs:36:14: 36:15 + debug y => _11; // in scope 4 at $DIR/match_false_edges.rs:36:14: 36:15 } scope 5 { - debug _z => _14; // in scope 5 at $DIR/match_false_edges.rs:39:9: 39:11 + debug _z => _14; // in scope 5 at $DIR/match_false_edges.rs:37:9: 37:11 } bb0: { - StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 - StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - _2 = Option::::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:35:13: 35:26 + StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:33:13: 38:6 + StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + _2 = Option::::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:33:13: 33:26 } bb1: { - falseEdge -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 + falseEdge -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:35:9: 35:11 } bb2: { - falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 + falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:34:9: 34:17 } bb3: { - StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11 - _14 = _2; // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11 - _1 = const 4_i32; // scope 5 at $DIR/match_false_edges.rs:39:15: 39:16 - StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16 + StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 + _14 = _2; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 + _1 = const 4_i32; // scope 5 at $DIR/match_false_edges.rs:37:15: 37:16 + StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16 } bb4: { - falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:38:9: 38:16 + falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:16 } bb5: { - StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 - _7 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 - _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - StorageLive(_8); // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 - _8 = guard() -> [return: bb6, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 + StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16 + _7 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16 + _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + StorageLive(_8); // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28 + _8 = guard() -> [return: bb6, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28 // mir::Constant - // + span: $DIR/match_false_edges.rs:36:21: 36:26 + // + span: $DIR/match_false_edges.rs:34:21: 34:26 // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar()) } } bb6: { - switchInt(move _8) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 + switchInt(move _8) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28 } bb7: { - StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 - FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 - FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 - StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 - _6 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 - _1 = const 1_i32; // scope 2 at $DIR/match_false_edges.rs:36:32: 36:33 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 + StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28 + FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28 + FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28 + StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16 + _6 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:34:14: 34:16 + _1 = const 1_i32; // scope 2 at $DIR/match_false_edges.rs:34:32: 34:33 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33 } bb8: { - StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 - falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 + StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:34:27: 34:28 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:34:32: 34:33 + falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:34:21: 34:28 } bb9: { - StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 - _9 = _2; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 - _1 = const 2_i32; // scope 3 at $DIR/match_false_edges.rs:37:15: 37:16 - StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16 + StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:35:9: 35:11 + _9 = _2; // scope 0 at $DIR/match_false_edges.rs:35:9: 35:11 + _1 = const 2_i32; // scope 3 at $DIR/match_false_edges.rs:35:15: 35:16 + StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:35:15: 35:16 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:35:15: 35:16 } bb10: { - StorageLive(_11); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 - _11 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 - _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - StorageLive(_12); // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 - StorageLive(_13); // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28 - _13 = (*_11); // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28 - _12 = guard2(move _13) -> [return: bb11, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 + StorageLive(_11); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15 + _11 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15 + _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:33:19: 33:26 + StorageLive(_12); // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29 + StorageLive(_13); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 + _13 = (*_11); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 + _12 = guard2(move _13) -> [return: bb11, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29 // mir::Constant - // + span: $DIR/match_false_edges.rs:38:20: 38:26 + // + span: $DIR/match_false_edges.rs:36:20: 36:26 // + literal: Const { ty: fn(i32) -> bool {guard2}, val: Value(Scalar()) } } bb11: { - switchInt(move _12) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 + switchInt(move _12) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29 } bb12: { - StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 - StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 - FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 - FakeRead(ForGuardBinding, _11); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 - StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 - _10 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 - _1 = const 3_i32; // scope 4 at $DIR/match_false_edges.rs:38:33: 38:34 - StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 - StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 + StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29 + StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29 + FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29 + FakeRead(ForGuardBinding, _11); // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29 + StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15 + _10 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:15 + _1 = const 3_i32; // scope 4 at $DIR/match_false_edges.rs:36:33: 36:34 + StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 + StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 } bb13: { - StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 - StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 - StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 - falseEdge -> [real: bb3, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 + StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29 + StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:36:28: 36:29 + StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 + falseEdge -> [real: bb3, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:36:20: 36:29 } bb14: { - StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7 - StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7 - _0 = const (); // scope 0 at $DIR/match_false_edges.rs:34:11: 41:2 - return; // scope 0 at $DIR/match_false_edges.rs:41:2: 41:2 + StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:38:6: 38:7 + StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:38:6: 38:7 + _0 = const (); // scope 0 at $DIR/match_false_edges.rs:32:11: 39:2 + return; // scope 0 at $DIR/match_false_edges.rs:39:2: 39:2 } bb15 (cleanup): { - resume; // scope 0 at $DIR/match_false_edges.rs:34:1: 41:2 + resume; // scope 0 at $DIR/match_false_edges.rs:32:1: 39:2 } } diff --git a/src/test/mir-opt/match_false_edges.rs b/src/test/mir-opt/match_false_edges.rs index 42dea9c7082..3603253dafc 100644 --- a/src/test/mir-opt/match_false_edges.rs +++ b/src/test/mir-opt/match_false_edges.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z borrowck=mir - fn guard() -> bool { false } diff --git a/src/test/mir-opt/nll/named-lifetimes-basic.rs b/src/test/mir-opt/nll/named-lifetimes-basic.rs index 73bd6d64e86..843716033ca 100644 --- a/src/test/mir-opt/nll/named-lifetimes-basic.rs +++ b/src/test/mir-opt/nll/named-lifetimes-basic.rs @@ -3,8 +3,8 @@ // suitable variables and that we setup the outlives relationship // between R0 and R1 properly. -// compile-flags:-Zborrowck=mir -Zverbose -// ^^^^^^^^^ force compiler to dump more region information +// compile-flags: -Zverbose +// ^^^^^^^^^ force compiler to dump more region information #![allow(warnings)] diff --git a/src/test/mir-opt/nll/region-subtyping-basic.rs b/src/test/mir-opt/nll/region-subtyping-basic.rs index 224a495c788..64332f302e8 100644 --- a/src/test/mir-opt/nll/region-subtyping-basic.rs +++ b/src/test/mir-opt/nll/region-subtyping-basic.rs @@ -2,8 +2,8 @@ // in the type of `p` includes the points after `&v[0]` up to (but not // including) the call to `use_x`. The `else` branch is not included. -// compile-flags:-Zborrowck=mir -Zverbose -// ^^^^^^^^^ force compiler to dump more region information +// compile-flags:-Zverbose +// ^^^^^^^^^ force compiler to dump more region information #![allow(warnings)] diff --git a/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs b/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs index 2d29fa89110..b4db182e85f 100644 --- a/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs +++ b/src/test/run-make-fulldeps/rustdoc-error-lines/input.rs @@ -3,7 +3,7 @@ // random #![feature] to ensure that crate attrs // do not offset things /// ```rust -/// #![feature(nll)] +/// #![feature(bool_to_option)] /// let x: char = 1; /// ``` pub fn foo() { @@ -13,7 +13,7 @@ pub fn foo() { /// Add some text around the test... /// /// ```rust -/// #![feature(nll)] +/// #![feature(bool_to_option)] /// let x: char = 1; /// ``` /// @@ -22,7 +22,7 @@ pub fn foo() { /// Let's also add a second test in the same doc comment. /// /// ```rust -/// #![feature(nll)] +/// #![feature(bool_to_option)] /// let x: char = 1; /// ``` pub fn bar() {} diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr deleted file mode 100644 index b4437069cd7..00000000000 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/implied-region-constraints.rs:21:64 - | -LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>) - | ------------- this type is declared with multiple lifetimes... -... -LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; - | ^^^^^ ...but data with one lifetime flows into the other here - -error[E0623]: lifetime mismatch - --> $DIR/implied-region-constraints.rs:43:72 - | -LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>) - | -------------- this type is declared with multiple lifetimes... -... -LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x; - | ^^ ...but data with one lifetime flows into the other here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.rs b/src/test/ui/associated-type-bounds/implied-region-constraints.rs index a41c7643430..38219da61b4 100644 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.rs +++ b/src/test/ui/associated-type-bounds/implied-region-constraints.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![feature(associated_type_bounds)] trait Tr1 { type As1; } @@ -19,8 +15,7 @@ where { // This should fail because `T: 'b` is not implied from `WF(St<'a, 'b, T>)`. let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } enum En7<'a, 'b, T> // `::As2: 'a` is implied. @@ -41,8 +36,7 @@ where En7::V0(x) => { // Also fails for the same reason as above: let _failure_proves_not_implied_outlives_region_b: &'b T = &x; - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough }, En7::V1(_) => {}, } diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.stderr similarity index 91% rename from src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr rename to src/test/ui/associated-type-bounds/implied-region-constraints.stderr index bf9fecf06a4..cddce8777ea 100644 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr +++ b/src/test/ui/associated-type-bounds/implied-region-constraints.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/implied-region-constraints.rs:21:56 + --> $DIR/implied-region-constraints.rs:17:56 | LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>) | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/implied-region-constraints.rs:43:64 + --> $DIR/implied-region-constraints.rs:38:64 | LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>) | -- -- lifetime `'b` defined here diff --git a/src/test/ui/associated-types/associated-types-eq-hr.base.stderr b/src/test/ui/associated-types/associated-types-eq-hr.base.stderr deleted file mode 100644 index 4313078064c..00000000000 --- a/src/test/ui/associated-types/associated-types-eq-hr.base.stderr +++ /dev/null @@ -1,92 +0,0 @@ -error[E0271]: type mismatch resolving `for<'x> >::A == &'x isize` - --> $DIR/associated-types-eq-hr.rs:91:5 - | -LL | foo::(); - | ^^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> >::A == &'x isize` - | -note: expected this to be `&isize` - --> $DIR/associated-types-eq-hr.rs:30:14 - | -LL | type A = &'a usize; - | ^^^^^^^^^ - = note: expected reference `&isize` - found reference `&usize` -note: required by a bound in `foo` - --> $DIR/associated-types-eq-hr.rs:49:36 - | -LL | fn foo() - | --- required by a bound in this -LL | where -LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>, - | ^^^^^^^^^^^^^ required by this bound in `foo` - -error[E0271]: type mismatch resolving `for<'x> >::A == &'x usize` - --> $DIR/associated-types-eq-hr.rs:95:5 - | -LL | bar::(); - | ^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> >::A == &'x usize` - | -note: expected this to be `&usize` - --> $DIR/associated-types-eq-hr.rs:18:14 - | -LL | type A = &'a isize; - | ^^^^^^^^^ - = note: expected reference `&usize` - found reference `&isize` -note: required by a bound in `bar` - --> $DIR/associated-types-eq-hr.rs:56:36 - | -LL | fn bar() - | --- required by a bound in this -LL | where -LL | T: for<'x> TheTrait<&'x isize, A = &'x usize>, - | ^^^^^^^^^^^^^ required by this bound in `bar` - -error: implementation of `TheTrait` is not general enough - --> $DIR/associated-types-eq-hr.rs:100:5 - | -LL | tuple_one::(); - | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough - | - = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`... - = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2` - -error: implementation of `TheTrait` is not general enough - --> $DIR/associated-types-eq-hr.rs:100:5 - | -LL | tuple_one::(); - | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough - | - = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`... - = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2` - -error: implementation of `TheTrait` is not general enough - --> $DIR/associated-types-eq-hr.rs:106:5 - | -LL | tuple_two::(); - | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough - | - = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`... - = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2` - -error: implementation of `TheTrait` is not general enough - --> $DIR/associated-types-eq-hr.rs:106:5 - | -LL | tuple_two::(); - | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough - | - = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`... - = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2` - -error: implementation of `TheTrait` is not general enough - --> $DIR/associated-types-eq-hr.rs:116:5 - | -LL | tuple_four::(); - | ^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough - | - = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`... - = note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2` - -error: aborting due to 7 previous errors - -For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/associated-types/associated-types-eq-hr.rs b/src/test/ui/associated-types/associated-types-eq-hr.rs index deb3fd059f8..dc653f7f2e9 100644 --- a/src/test/ui/associated-types/associated-types-eq-hr.rs +++ b/src/test/ui/associated-types/associated-types-eq-hr.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Check testing of equality constraints in a higher-ranked context. pub trait TheTrait { @@ -98,14 +94,10 @@ pub fn call_bar() { pub fn call_tuple_one() { tuple_one::(); - //[base]~^ ERROR implementation of `TheTrait` is not general enough - //[base]~| ERROR implementation of `TheTrait` is not general enough } pub fn call_tuple_two() { tuple_two::(); - //[base]~^ ERROR implementation of `TheTrait` is not general enough - //[base]~| ERROR implementation of `TheTrait` is not general enough } pub fn call_tuple_three() { @@ -114,7 +106,6 @@ pub fn call_tuple_three() { pub fn call_tuple_four() { tuple_four::(); - //[base]~^ ERROR implementation of `TheTrait` is not general enough } fn main() {} diff --git a/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr similarity index 87% rename from src/test/ui/associated-types/associated-types-eq-hr.nll.stderr rename to src/test/ui/associated-types/associated-types-eq-hr.stderr index 8d128821656..b306ae273e8 100644 --- a/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr +++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr @@ -1,18 +1,18 @@ error[E0271]: type mismatch resolving `for<'x> >::A == &'x isize` - --> $DIR/associated-types-eq-hr.rs:91:5 + --> $DIR/associated-types-eq-hr.rs:87:5 | LL | foo::(); | ^^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> >::A == &'x isize` | note: expected this to be `&isize` - --> $DIR/associated-types-eq-hr.rs:30:14 + --> $DIR/associated-types-eq-hr.rs:26:14 | LL | type A = &'a usize; | ^^^^^^^^^ = note: expected reference `&isize` found reference `&usize` note: required by a bound in `foo` - --> $DIR/associated-types-eq-hr.rs:49:36 + --> $DIR/associated-types-eq-hr.rs:45:36 | LL | fn foo() | --- required by a bound in this @@ -21,20 +21,20 @@ LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>, | ^^^^^^^^^^^^^ required by this bound in `foo` error[E0271]: type mismatch resolving `for<'x> >::A == &'x usize` - --> $DIR/associated-types-eq-hr.rs:95:5 + --> $DIR/associated-types-eq-hr.rs:91:5 | LL | bar::(); | ^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> >::A == &'x usize` | note: expected this to be `&usize` - --> $DIR/associated-types-eq-hr.rs:18:14 + --> $DIR/associated-types-eq-hr.rs:14:14 | LL | type A = &'a isize; | ^^^^^^^^^ = note: expected reference `&usize` found reference `&isize` note: required by a bound in `bar` - --> $DIR/associated-types-eq-hr.rs:56:36 + --> $DIR/associated-types-eq-hr.rs:52:36 | LL | fn bar() | --- required by a bound in this diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr deleted file mode 100644 index fe238344263..00000000000 --- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:26:40 - | -LL | x: >::A, - | --------- these two types are declared with different lifetimes... -LL | y: >::A, - | --------- -... -LL | let z: I::A = if cond { x } else { y }; - | ^ ...but data from `x` flows into `y` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs index 7ad12f2a1f3..069bf560044 100644 --- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs +++ b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Check projection of an associated type out of a higher-ranked // trait-bound in the context of a function body. @@ -24,9 +20,8 @@ fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>( { // x and y here have two distinct lifetimes: let z: I::A = if cond { x } else { y }; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough } pub fn main() {} diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr similarity index 87% rename from src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr rename to src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr index ae6ccb8af55..e12d42e5ed0 100644 --- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr +++ b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:26:29 + --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:29 | LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>( | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | let z: I::A = if cond { x } else { y }; = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:26:40 + --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:40 | LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>( | -- -- lifetime `'b` defined here diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.base.stderr b/src/test/ui/associated-types/associated-types-subtyping-1.base.stderr deleted file mode 100644 index 35b3a83ee43..00000000000 --- a/src/test/ui/associated-types/associated-types-subtyping-1.base.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/associated-types-subtyping-1.rs:31:38 - | -LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T) - | ----- ----- these two types are declared with different lifetimes... -... -LL | let _c: >::Type = a; - | ^ ...but data from `y` flows into `x` here - -error[E0623]: lifetime mismatch - --> $DIR/associated-types-subtyping-1.rs:41:38 - | -LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T) - | ----- ----- these two types are declared with different lifetimes... -... -LL | let _c: >::Type = b; - | ^ ...but data from `y` flows into `x` here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.rs b/src/test/ui/associated-types/associated-types-subtyping-1.rs index 5b75e023b85..c4758f255b3 100644 --- a/src/test/ui/associated-types/associated-types-subtyping-1.rs +++ b/src/test/ui/associated-types/associated-types-subtyping-1.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![allow(unused_variables)] fn make_any() -> T { loop {} } @@ -26,10 +22,9 @@ fn method2<'a,'b,T>(x: &'a T, y: &'b T) { // Note that &'static T <: &'a T. let a: >::Type = make_any(); - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough let b: >::Type = make_any(); let _c: >::Type = a; - //[base]~^ ERROR E0623 } fn method3<'a,'b,T>(x: &'a T, y: &'b T) @@ -39,8 +34,7 @@ fn method3<'a,'b,T>(x: &'a T, y: &'b T) let a: >::Type = make_any(); let b: >::Type = make_any(); let _c: >::Type = b; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn method4<'a,'b,T>(x: &'a T, y: &'b T) diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr b/src/test/ui/associated-types/associated-types-subtyping-1.stderr similarity index 89% rename from src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr rename to src/test/ui/associated-types/associated-types-subtyping-1.stderr index 44f918e12ba..414bc048ab5 100644 --- a/src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr +++ b/src/test/ui/associated-types/associated-types-subtyping-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/associated-types-subtyping-1.rs:28:12 + --> $DIR/associated-types-subtyping-1.rs:24:12 | LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T) | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | let a: >::Type = make_any(); = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/associated-types-subtyping-1.rs:41:13 + --> $DIR/associated-types-subtyping-1.rs:36:13 | LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T) | -- -- lifetime `'b` defined here diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr deleted file mode 100644 index ed5518b628f..00000000000 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.krisskross.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/project-fn-ret-contravariant-nll.rs:51:5 - | -LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { - | ------- ------------------ - | | - | this parameter and the return type are declared with different lifetimes... -... -LL | (a, b) - | ^ ...but data from `y` is returned here - -error[E0623]: lifetime mismatch - --> $DIR/project-fn-ret-contravariant-nll.rs:51:8 - | -LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { - | ------- ------------------ - | | - | this parameter and the return type are declared with different lifetimes... -... -LL | (a, b) - | ^ ...but data from `x` is returned here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs b/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs deleted file mode 100644 index c3ac9949c21..00000000000 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.rs +++ /dev/null @@ -1,55 +0,0 @@ -#![feature(unboxed_closures)] - -// Test for projection cache. We should be able to project distinct -// lifetimes from `foo` as we reinstantiate it multiple times, but not -// if we do it just once. In this variant, the region `'a` is used in -// an contravariant position, which affects the results. - -// revisions: ok oneuse transmute krisskross -//[ok] check-pass -//[oneuse] check-pass - -// ignore-compare-mode-nll -// FIXME(nll): When stabilizing, this test should replace `project-fn-ret-contravariant.rs` -// The two would normally be just revisions, but this test uses revisions heavily, so splitting into -// a separate test is just easier. - -#![allow(dead_code, unused_variables)] - -fn foo<'a>() -> &'a u32 { loop { } } - -fn bar(t: T, x: T::Output) -> T::Output - where T: FnOnce<()> -{ - t() -} - -#[cfg(ok)] // two instantiations: OK -fn baz<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { - let a = bar(foo, x); - let b = bar(foo, y); - (a, b) -} - -#[cfg(oneuse)] // one instantiation: OK (surprisingly) -fn baz<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { - let f /* : fn() -> &'static u32 */ = foo; // <-- inferred type annotated - let a = bar(f, x); // this is considered ok because fn args are contravariant... - let b = bar(f, y); // ...and hence we infer T to distinct values in each call. - (a, b) -} - -#[cfg(transmute)] // one instantiations: BAD -fn baz<'a,'b>(x: &'a u32) -> &'static u32 { - bar(foo, x) //[transmute]~ ERROR E0759 -} - -#[cfg(krisskross)] // two instantiations, mixing and matching: BAD -fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { - let a = bar(foo, y); - let b = bar(foo, x); - (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623] - //[krisskross]~^ ERROR lifetime mismatch [E0623] -} - -fn main() { } diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr deleted file mode 100644 index ca57142ecee..00000000000 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant-nll.transmute.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/project-fn-ret-contravariant-nll.rs:44:8 - | -LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { - | ------- this data with lifetime `'a`... -LL | bar(foo, x) - | ^^^ - ...is used and required to live as long as `'static` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr index 52824b3922e..2ecee1341ab 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr @@ -1,25 +1,30 @@ -error[E0623]: lifetime mismatch - --> $DIR/project-fn-ret-contravariant.rs:52:5 +error: lifetime may not live long enough + --> $DIR/project-fn-ret-contravariant.rs:46:4 | LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { - | ------- ------------------ - | | - | this parameter and the return type are declared with different lifetimes... + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here ... LL | (a, b) - | ^ ...but data from `y` is returned here + | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` -error[E0623]: lifetime mismatch - --> $DIR/project-fn-ret-contravariant.rs:52:8 +error: lifetime may not live long enough + --> $DIR/project-fn-ret-contravariant.rs:46:4 | LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { - | ------- ------------------ - | | - | this parameter and the return type are declared with different lifetimes... + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here ... LL | (a, b) - | ^ ...but data from `x` is returned here + | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | + = help: consider adding the following bound: `'b: 'a` + +help: `'a` and `'b` must be the same: replace one with the other error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs index 7bd245d1c34..f1ea6627aab 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs @@ -9,12 +9,6 @@ //[ok] check-pass //[oneuse] check-pass -// ignore-compare-mode-nll -// FIXME(nll): When stabilizing, this test should be replaced with -// `project-fn-ret-contravariant-nll.rs` The two would normally be just -// revisions, but this test uses revisions heavily, so splitting into -// a separate test is just easier. - #![allow(dead_code, unused_variables)] fn foo<'a>() -> &'a u32 { loop { } } @@ -42,15 +36,15 @@ fn baz<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { #[cfg(transmute)] // one instantiations: BAD fn baz<'a,'b>(x: &'a u32) -> &'static u32 { - bar(foo, x) //[transmute]~ ERROR E0759 + bar(foo, x) //[transmute]~ ERROR lifetime may not live long enough } #[cfg(krisskross)] // two instantiations, mixing and matching: BAD fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { let a = bar(foo, y); let b = bar(foo, x); - (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623] - //[krisskross]~^ ERROR lifetime mismatch [E0623] + (a, b) //[krisskross]~ ERROR lifetime may not live long enough + //[krisskross]~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr index 3d7f36ca32b..6d8ab2c3fdc 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr @@ -1,11 +1,10 @@ -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/project-fn-ret-contravariant.rs:45:8 +error: lifetime may not live long enough + --> $DIR/project-fn-ret-contravariant.rs:39:4 | LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { - | ------- this data with lifetime `'a`... + | -- lifetime `'a` defined here LL | bar(foo, x) - | ^^^ - ...is used and required to live as long as `'static` here + | ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` error: aborting due to previous error -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr deleted file mode 100644 index 09119ea2bb5..00000000000 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/project-fn-ret-invariant-nll.rs:64:5 - | -LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -... -LL | (a, b) - | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` - | - = help: consider adding the following bound: `'a: 'b` - = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant - = note: the struct `Type<'a>` is invariant over the parameter `'a` - = help: see for more information about variance - -error: lifetime may not live long enough - --> $DIR/project-fn-ret-invariant-nll.rs:64:5 - | -LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -... -LL | (a, b) - | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` - | - = help: consider adding the following bound: `'b: 'a` - = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant - = note: the struct `Type<'a>` is invariant over the parameter `'a` - = help: see for more information about variance - -help: `'a` and `'b` must be the same: replace one with the other - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr deleted file mode 100644 index 266f3b99f9f..00000000000 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/project-fn-ret-invariant-nll.rs:46:13 - | -LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -LL | let f = foo; // <-- No consistent type can be inferred for `f` here. -LL | let a = bar(f, x); - | ^^^^^^^^^ argument requires that `'a` must outlive `'b` - | - = help: consider adding the following bound: `'a: 'b` - = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant - = note: the struct `Type<'a>` is invariant over the parameter `'a` - = help: see for more information about variance - -error: lifetime may not live long enough - --> $DIR/project-fn-ret-invariant-nll.rs:46:13 - | -LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -LL | let f = foo; // <-- No consistent type can be inferred for `f` here. -LL | let a = bar(f, x); - | ^^^^^^^^^ argument requires that `'b` must outlive `'a` - | - = help: consider adding the following bound: `'b: 'a` - = note: requirement occurs because of a function pointer to `foo` - = note: the function `foo` is invariant over the parameter `'a` - = help: see for more information about variance - -help: `'a` and `'b` must be the same: replace one with the other - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs deleted file mode 100644 index 15bf38dabc0..00000000000 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs +++ /dev/null @@ -1,69 +0,0 @@ -#![feature(unboxed_closures)] -// Test for projection cache. We should be able to project distinct -// lifetimes from `foo` as we reinstantiate it multiple times, but not -// if we do it just once. In this variant, the region `'a` is used in -// an invariant position, which affects the results. - -// revisions: ok oneuse transmute krisskross -//[ok] check-pass - -// compile-flags: -Z borrowck=mir -// ignore-compare-mode-nll -// FIXME(nll): When stabilizing, this test should replace with `project-fn-ret-invariant.rs` -// The two would normally be just revisions, but this test uses revisions heavily, so splitting into -// a separate test is just easier. - -#![allow(dead_code, unused_variables)] - -use std::marker::PhantomData; - -struct Type<'a> { - // Invariant - data: PhantomData &'a u32>, -} - -fn foo<'a>() -> Type<'a> { - loop {} -} - -fn bar(t: T, x: T::Output) -> T::Output -where - T: FnOnce<()>, -{ - t() -} - -#[cfg(ok)] // two instantiations: OK -fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - let a = bar(foo, x); - let b = bar(foo, y); - (a, b) -} - -#[cfg(oneuse)] // one instantiation: BAD -fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - let f = foo; // <-- No consistent type can be inferred for `f` here. - let a = bar(f, x); //[oneuse]~ ERROR lifetime may not live long enough - //[oneuse]~^ ERROR lifetime may not live long enough - let b = bar(f, y); - (a, b) -} - -#[cfg(transmute)] // one instantiations: BAD -fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> { - // Cannot instantiate `foo` with any lifetime other than `'a`, - // since it is provided as input. - - bar(foo, x) //[transmute]~ ERROR lifetime may not live long enough -} - -#[cfg(krisskross)] // two instantiations, mixing and matching: BAD -fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - let a = bar(foo, y); - let b = bar(foo, x); - (a, b) - //[krisskross]~^ ERROR lifetime may not live long enough - //[krisskross]~| ERROR lifetime may not live long enough -} - -fn main() {} diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr deleted file mode 100644 index 56f08152999..00000000000 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/project-fn-ret-invariant-nll.rs:57:5 - | -LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> { - | -- lifetime `'a` defined here -... -LL | bar(foo, x) - | ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - | - = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant - = note: the struct `Type<'a>` is invariant over the parameter `'a` - = help: see for more information about variance - -error: aborting due to previous error - diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr index fd1152dd80c..ada12c7ee91 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr @@ -1,24 +1,36 @@ -error[E0623]: lifetime mismatch - --> $DIR/project-fn-ret-invariant.rs:60:22 +error: lifetime may not live long enough + --> $DIR/project-fn-ret-invariant.rs:59:5 | LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - | -------- -------------------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | let a = bar(foo, y); - | ^ ...but data from `x` is returned here - -error[E0623]: lifetime mismatch - --> $DIR/project-fn-ret-invariant.rs:62:9 - | -LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - | -------- -------------------- - | | - | this parameter and the return type are declared with different lifetimes... + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here ... LL | (a, b) - | ^ ...but data from `x` is returned here + | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | + = help: consider adding the following bound: `'a: 'b` + = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant + = note: the struct `Type<'a>` is invariant over the parameter `'a` + = help: see for more information about variance + +error: lifetime may not live long enough + --> $DIR/project-fn-ret-invariant.rs:59:5 + | +LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +... +LL | (a, b) + | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + | + = help: consider adding the following bound: `'b: 'a` + = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant + = note: the struct `Type<'a>` is invariant over the parameter `'a` + = help: see for more information about variance + +help: `'a` and `'b` must be the same: replace one with the other error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr index 1b10c6b990a..cc156016212 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr @@ -1,14 +1,36 @@ -error[E0623]: lifetime mismatch - --> $DIR/project-fn-ret-invariant.rs:46:20 +error: lifetime may not live long enough + --> $DIR/project-fn-ret-invariant.rs:40:13 | LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - | -------- -------------------- - | | - | this parameter and the return type are declared with different lifetimes... -... -LL | let b = bar(f, y); - | ^ ...but data from `x` is returned here + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let f = foo; // <-- No consistent type can be inferred for `f` here. +LL | let a = bar(f, x); + | ^^^^^^^^^ argument requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` + = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant + = note: the struct `Type<'a>` is invariant over the parameter `'a` + = help: see for more information about variance -error: aborting due to previous error +error: lifetime may not live long enough + --> $DIR/project-fn-ret-invariant.rs:40:13 + | +LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let f = foo; // <-- No consistent type can be inferred for `f` here. +LL | let a = bar(f, x); + | ^^^^^^^^^ argument requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` + = note: requirement occurs because of a function pointer to `foo` + = note: the function `foo` is invariant over the parameter `'a` + = help: see for more information about variance + +help: `'a` and `'b` must be the same: replace one with the other + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs b/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs index d42d99d7783..1075fd6e092 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs @@ -7,11 +7,6 @@ // revisions: ok oneuse transmute krisskross //[ok] check-pass -// ignore-compare-mode-nll -// FIXME(nll): When stabilizing, this test should be replaced with `project-fn-ret-invariant-nll.rs` -// The two would normally be just revisions, but this test uses revisions heavily, so splitting into -// a separate test is just easier. - #![allow(dead_code, unused_variables)] use std::marker::PhantomData; @@ -43,7 +38,9 @@ fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { let f = foo; // <-- No consistent type can be inferred for `f` here. let a = bar(f, x); - let b = bar(f, y); //[oneuse]~ ERROR lifetime mismatch [E0623] + //[oneuse]~^ ERROR lifetime may not live long enough + //[oneuse]~| ERROR lifetime may not live long enough + let b = bar(f, y); (a, b) } @@ -52,14 +49,16 @@ fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> { // Cannot instantiate `foo` with any lifetime other than `'a`, // since it is provided as input. - bar(foo, x) //[transmute]~ ERROR E0759 + bar(foo, x) //[transmute]~ ERROR lifetime may not live long enough } #[cfg(krisskross)] // two instantiations, mixing and matching: BAD fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { - let a = bar(foo, y); //[krisskross]~ ERROR E0623 + let a = bar(foo, y); let b = bar(foo, x); - (a, b) //[krisskross]~ ERROR E0623 + (a, b) + //[krisskross]~^ ERROR lifetime may not live long enough + //[krisskross]~| ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr index 8c1d9d1e284..b64cb2c3d0b 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr @@ -1,21 +1,15 @@ -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/project-fn-ret-invariant.rs:55:9 +error: lifetime may not live long enough + --> $DIR/project-fn-ret-invariant.rs:52:5 | LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> { - | -------- this data with lifetime `'a`... + | -- lifetime `'a` defined here ... LL | bar(foo, x) - | ^^^ - ...is used and required to live as long as `'static` here + | ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/project-fn-ret-invariant.rs:51:37 - | -LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> { - | ^^^^^^^ `'static` requirement introduced here -... -LL | bar(foo, x) - | ----------- because of this returned expression + = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant + = note: the struct `Type<'a>` is invariant over the parameter `'a` + = help: see for more information about variance error: aborting due to previous error -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr deleted file mode 100644 index de254b7a163..00000000000 --- a/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/higher-ranked-projection.rs:25:5 - | -LL | foo(()); - | ^^^^^^^ one type is more general than the other - | - = note: expected reference `&'a ()` - found reference `&()` -note: the lifetime requirement is introduced here - --> $DIR/higher-ranked-projection.rs:15:33 - | -LL | where for<'a> &'a T: Mirror - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr index 65533f93c94..239f4553938 100644 --- a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr +++ b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr @@ -1,13 +1,13 @@ error[E0308]: mismatched types - --> $DIR/higher-ranked-projection.rs:25:5 + --> $DIR/higher-ranked-projection.rs:23:5 | LL | foo(()); - | ^^^ lifetime mismatch + | ^^^^^^^ one type is more general than the other | = note: expected reference `&'a ()` found reference `&()` note: the lifetime requirement is introduced here - --> $DIR/higher-ranked-projection.rs:15:33 + --> $DIR/higher-ranked-projection.rs:14:33 | LL | where for<'a> &'a T: Mirror | ^^^^^^^ diff --git a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr b/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr index 732f5d9584b..8b2b87223a5 100644 --- a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr +++ b/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/higher-ranked-projection.rs:25:5 | LL | foo(()); - | ^^^ lifetime mismatch + | ^^^^^^^ one type is more general than the other | = note: expected reference `&'a ()` found reference `&()` diff --git a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr b/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr index 8b2b87223a5..217392aa35b 100644 --- a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr +++ b/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr @@ -1,17 +1,2 @@ -error[E0308]: mismatched types - --> $DIR/higher-ranked-projection.rs:25:5 - | -LL | foo(()); - | ^^^^^^^ one type is more general than the other - | - = note: expected reference `&'a ()` - found reference `&()` -note: the lifetime requirement is introduced here - --> $DIR/higher-ranked-projection.rs:16:33 - | -LL | where for<'a> &'a T: Mirror - | ^^^^^^^ +error: unknown debugging option: `borrowck` -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/associated-types/higher-ranked-projection.rs b/src/test/ui/associated-types/higher-ranked-projection.rs index 8b1046b6bbc..7e6c509a272 100644 --- a/src/test/ui/associated-types/higher-ranked-projection.rs +++ b/src/test/ui/associated-types/higher-ranked-projection.rs @@ -1,7 +1,5 @@ -// ignore-compare-mode-nll -// revisions: good badbase badnll +// revisions: good bad //[good] check-pass -// [badnll]compile-flags: -Zborrowck=mir trait Mirror { type Image; @@ -11,7 +9,7 @@ impl Mirror for T { type Image = T; } -#[cfg(any(badbase, badnll))] +#[cfg(bad)] fn foo(_t: T) where for<'a> &'a T: Mirror {} @@ -23,6 +21,5 @@ fn foo(_t: T) fn main() { foo(()); - //[badbase]~^ ERROR mismatched types - //[badnll]~^^ ERROR mismatched types + //[bad]~^ ERROR mismatched types } diff --git a/src/test/ui/async-await/issue-76547.base.stderr b/src/test/ui/async-await/issue-76547.base.stderr deleted file mode 100644 index 109883fbeb7..00000000000 --- a/src/test/ui/async-await/issue-76547.base.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/issue-76547.rs:24:13 - | -LL | async fn fut(bufs: &mut [&mut [u8]]) { - | ---------------- these two types are declared with different lifetimes... -LL | ListFut(bufs).await - | ^^^^ ...but data from `bufs` flows into `bufs` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | async fn fut<'a>(bufs: &'a mut [&'a mut [u8]]) { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/issue-76547.rs:39:14 - | -LL | async fn fut2(bufs: &mut [&mut [u8]]) -> i32 { - | ---------------- these two types are declared with different lifetimes... -LL | ListFut2(bufs).await - | ^^^^ ...but data from `bufs` flows into `bufs` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | async fn fut2<'a>(bufs: &'a mut [&'a mut [u8]]) -> i32 { - | ++++ ++ ++ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/async-await/issue-76547.rs b/src/test/ui/async-await/issue-76547.rs index 45c7ab63135..587feb6247c 100644 --- a/src/test/ui/async-await/issue-76547.rs +++ b/src/test/ui/async-await/issue-76547.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test for diagnostic improvement issue #76547 // edition:2018 @@ -22,8 +18,7 @@ impl<'a> Future for ListFut<'a> { async fn fut(bufs: &mut [&mut [u8]]) { ListFut(bufs).await - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } pub struct ListFut2<'a>(&'a mut [&'a mut [u8]]); @@ -37,8 +32,7 @@ impl<'a> Future for ListFut2<'a> { async fn fut2(bufs: &mut [&mut [u8]]) -> i32 { ListFut2(bufs).await - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/async-await/issue-76547.nll.stderr b/src/test/ui/async-await/issue-76547.stderr similarity index 94% rename from src/test/ui/async-await/issue-76547.nll.stderr rename to src/test/ui/async-await/issue-76547.stderr index 0a5a52cb79e..4d96cce824b 100644 --- a/src/test/ui/async-await/issue-76547.nll.stderr +++ b/src/test/ui/async-await/issue-76547.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-76547.rs:24:13 + --> $DIR/issue-76547.rs:20:13 | LL | async fn fut(bufs: &mut [&mut [u8]]) { | - - let's call the lifetime of this reference `'2` @@ -14,7 +14,7 @@ LL | async fn fut<'a>(bufs: &'a mut [&'a mut [u8]]) { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/issue-76547.rs:39:14 + --> $DIR/issue-76547.rs:34:14 | LL | async fn fut2(bufs: &mut [&mut [u8]]) -> i32 { | - - let's call the lifetime of this reference `'2` diff --git a/src/test/ui/async-await/issues/issue-62097.base.stderr b/src/test/ui/async-await/issues/issue-62097.base.stderr deleted file mode 100644 index 7577b95fa2e..00000000000 --- a/src/test/ui/async-await/issues/issue-62097.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/issue-62097.rs:16:31 - | -LL | pub async fn run_dummy_fn(&self) { - | ^^^^^ this data with an anonymous lifetime `'_`... -LL | -LL | foo(|| self.bar()).await; - | --- ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by this bound - --> $DIR/issue-62097.rs:8:19 - | -LL | F: FnOnce() + 'static - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/async-await/issues/issue-62097.rs b/src/test/ui/async-await/issues/issue-62097.rs index d2260cd68c1..a24c84cffc7 100644 --- a/src/test/ui/async-await/issues/issue-62097.rs +++ b/src/test/ui/async-await/issues/issue-62097.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // edition:2018 async fn foo(fun: F) where @@ -14,10 +10,9 @@ struct Struct; impl Struct { pub async fn run_dummy_fn(&self) { - //[base]~^ ERROR E0759 foo(|| self.bar()).await; - //[nll]~^ ERROR closure may outlive the current function - //[nll]~| ERROR borrowed data escapes outside of associated function + //~^ ERROR closure may outlive the current function + //~| ERROR borrowed data escapes outside of associated function } pub fn bar(&self) {} diff --git a/src/test/ui/async-await/issues/issue-62097.nll.stderr b/src/test/ui/async-await/issues/issue-62097.stderr similarity index 93% rename from src/test/ui/async-await/issues/issue-62097.nll.stderr rename to src/test/ui/async-await/issues/issue-62097.stderr index b2b7c46d348..786f6213260 100644 --- a/src/test/ui/async-await/issues/issue-62097.nll.stderr +++ b/src/test/ui/async-await/issues/issue-62097.stderr @@ -1,5 +1,5 @@ error[E0373]: closure may outlive the current function, but it borrows `self`, which is owned by the current function - --> $DIR/issue-62097.rs:18:13 + --> $DIR/issue-62097.rs:13:13 | LL | foo(|| self.bar()).await; | ^^ ---- `self` is borrowed here @@ -7,7 +7,7 @@ LL | foo(|| self.bar()).await; | may outlive borrowed value `self` | note: function requires argument type to outlive `'static` - --> $DIR/issue-62097.rs:18:9 + --> $DIR/issue-62097.rs:13:9 | LL | foo(|| self.bar()).await; | ^^^^^^^^^^^^^^^^^^ @@ -17,14 +17,13 @@ LL | foo(move || self.bar()).await; | ++++ error[E0521]: borrowed data escapes outside of associated function - --> $DIR/issue-62097.rs:18:9 + --> $DIR/issue-62097.rs:13:9 | LL | pub async fn run_dummy_fn(&self) { | ----- | | | `self` is a reference that is only valid in the associated function body | let's call the lifetime of this reference `'1` -LL | LL | foo(|| self.bar()).await; | ^^^^^^^^^^^^^^^^^^ | | diff --git a/src/test/ui/async-await/issues/issue-63388-1.base.stderr b/src/test/ui/async-await/issues/issue-63388-1.base.stderr deleted file mode 100644 index f5409a7ca5d..00000000000 --- a/src/test/ui/async-await/issues/issue-63388-1.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `foo` - --> $DIR/issue-63388-1.rs:19:9 - | -LL | &'a self, foo: &dyn Foo - | -------- help: add explicit lifetime `'a` to the type of `foo`: `&'a (dyn Foo + 'a)` -... -LL | foo - | ^^^ lifetime `'a` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/async-await/issues/issue-63388-1.rs b/src/test/ui/async-await/issues/issue-63388-1.rs index f00f9295406..32bcbb11116 100644 --- a/src/test/ui/async-await/issues/issue-63388-1.rs +++ b/src/test/ui/async-await/issues/issue-63388-1.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // edition:2018 struct Xyz { @@ -15,9 +11,8 @@ impl Xyz { &'a self, foo: &dyn Foo ) -> &dyn Foo { - //[nll]~^ ERROR explicit lifetime required in the type of `foo` [E0621] + //~^ ERROR explicit lifetime required in the type of `foo` [E0621] foo - //[base]~^ ERROR explicit lifetime required in the type of `foo` [E0621] } } diff --git a/src/test/ui/async-await/issues/issue-63388-1.nll.stderr b/src/test/ui/async-await/issues/issue-63388-1.stderr similarity index 91% rename from src/test/ui/async-await/issues/issue-63388-1.nll.stderr rename to src/test/ui/async-await/issues/issue-63388-1.stderr index 9263a81bb6a..88542315ec0 100644 --- a/src/test/ui/async-await/issues/issue-63388-1.nll.stderr +++ b/src/test/ui/async-await/issues/issue-63388-1.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `foo` - --> $DIR/issue-63388-1.rs:17:5 + --> $DIR/issue-63388-1.rs:13:5 | LL | &'a self, foo: &dyn Foo | -------- help: add explicit lifetime `'a` to the type of `foo`: `&'a (dyn Foo + 'a)` @@ -7,7 +7,6 @@ LL | ) -> &dyn Foo LL | / { LL | | LL | | foo -LL | | LL | | } | |_____^ lifetime `'a` required diff --git a/src/test/ui/async-await/issues/issue-72312.base.stderr b/src/test/ui/async-await/issues/issue-72312.base.stderr deleted file mode 100644 index a4bdc447f65..00000000000 --- a/src/test/ui/async-await/issues/issue-72312.base.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/issue-72312.rs:14:24 - | -LL | pub async fn start(&self) { - | ^^^^^ this data with an anonymous lifetime `'_`... -... -LL | &self; - | ----- ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/issue-72312.rs:20:9 - | -LL | require_static(async move { - | ^^^^^^^^^^^^^^ -note: `'static` lifetime requirement introduced by this bound - --> $DIR/issue-72312.rs:6:22 - | -LL | fn require_static(val: T) -> T { - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/async-await/issues/issue-72312.rs b/src/test/ui/async-await/issues/issue-72312.rs index c1eceefd643..74122cf00a9 100644 --- a/src/test/ui/async-await/issues/issue-72312.rs +++ b/src/test/ui/async-await/issues/issue-72312.rs @@ -1,10 +1,5 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // edition:2018 fn require_static(val: T) -> T { - //[base]~^ NOTE 'static` lifetime requirement introduced by this bound val } @@ -12,17 +7,13 @@ struct Problem; impl Problem { pub async fn start(&self) { - //[base]~^ ERROR E0759 - //[base]~| NOTE this data with an anonymous lifetime `'_` - //[base]~| NOTE in this expansion of desugaring of `async` block or function - //[nll]~^^^^ NOTE let's call - //[nll]~| NOTE `self` is a reference + //~^ NOTE let's call + //~| NOTE `self` is a reference require_static(async move { - //[base]~^ NOTE ...and is required to live as long as `'static` here - //[nll]~^^ ERROR borrowed data escapes - //[nll]~| NOTE `self` escapes - //[nll]~| NOTE argument requires - &self; //[base]~ NOTE ...is used here... + //~^ ERROR borrowed data escapes + //~| NOTE `self` escapes + //~| NOTE argument requires + &self; }); } } diff --git a/src/test/ui/async-await/issues/issue-72312.nll.stderr b/src/test/ui/async-await/issues/issue-72312.stderr similarity index 95% rename from src/test/ui/async-await/issues/issue-72312.nll.stderr rename to src/test/ui/async-await/issues/issue-72312.stderr index 02e47721e0c..aa947b69003 100644 --- a/src/test/ui/async-await/issues/issue-72312.nll.stderr +++ b/src/test/ui/async-await/issues/issue-72312.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of associated function - --> $DIR/issue-72312.rs:20:9 + --> $DIR/issue-72312.rs:12:9 | LL | pub async fn start(&self) { | ----- @@ -11,7 +11,6 @@ LL | / require_static(async move { LL | | LL | | LL | | -LL | | LL | | &self; LL | | }); | | ^ diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr deleted file mode 100644 index 907c1f6c407..00000000000 --- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.base.stderr +++ /dev/null @@ -1,34 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ret-impl-trait-one.rs:14:85 - | -LL | async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b { - | ______________________________________________________------_____-------------------_^ - | | | - | | this parameter and the return type are declared with different lifetimes... -LL | | -LL | | -LL | | (a, b) -LL | | } - | |_^ ...but data from `a` is returned here - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ret-impl-trait-one.rs:21:80 - | -LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> { - | ____________________________________--__________________________________________^ - | | | - | | hidden type `(&'a u8, &'b u8)` captures the lifetime `'b` as defined here -LL | | -LL | | (a, b) -LL | | } - | |_^ - | -help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound - | -LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b { - | ++++ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0623, E0700. -For more information about an error, try `rustc --explain E0623`. diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs index f4c309b4c10..aebc77d265e 100644 --- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs +++ b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // edition:2018 // Test that a feature gate is needed to use `impl Trait` as the @@ -12,8 +8,7 @@ impl Trait<'_> for T { } // Fails to recognize that both 'a and 'b are mentioned and should thus be accepted async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b { - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough (a, b) } diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr similarity index 94% rename from src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr rename to src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr index dbf7293a389..cdb141c0e3e 100644 --- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr +++ b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ret-impl-trait-one.rs:14:85 + --> $DIR/ret-impl-trait-one.rs:10:85 | LL | async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b { | ________________________________--__--_______________________________________________^ @@ -7,7 +7,6 @@ LL | async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trai | | | lifetime `'b` defined here | | lifetime `'a` defined here LL | | -LL | | LL | | (a, b) LL | | } | |_^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` @@ -15,7 +14,7 @@ LL | | } = help: consider adding the following bound: `'a: 'b` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/ret-impl-trait-one.rs:21:80 + --> $DIR/ret-impl-trait-one.rs:16:80 | LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> { | ____________________________________--__________________________________________^ diff --git a/src/test/ui/borrowck/borrowck-drop-from-guard.rs b/src/test/ui/borrowck/borrowck-drop-from-guard.rs index 67a2275dcf7..4995029a70f 100644 --- a/src/test/ui/borrowck/borrowck-drop-from-guard.rs +++ b/src/test/ui/borrowck/borrowck-drop-from-guard.rs @@ -1,5 +1,3 @@ -//compile-flags: -Z borrowck=mir - fn foo(_:String) {} fn main() diff --git a/src/test/ui/borrowck/borrowck-drop-from-guard.stderr b/src/test/ui/borrowck/borrowck-drop-from-guard.stderr index 77dda0a32b3..cd0d2fee942 100644 --- a/src/test/ui/borrowck/borrowck-drop-from-guard.stderr +++ b/src/test/ui/borrowck/borrowck-drop-from-guard.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `my_str` - --> $DIR/borrowck-drop-from-guard.rs:11:23 + --> $DIR/borrowck-drop-from-guard.rs:9:23 | LL | let my_str = "hello".to_owned(); | ------ move occurs because `my_str` has type `String`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr b/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr deleted file mode 100644 index d88185af778..00000000000 --- a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0507]: cannot move out of `foo` in pattern guard - --> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:18 - | -LL | (|| { let bar = foo; bar.take() })(); - | ^^ --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait - | | - | move out of `foo` occurs here - | - = note: variables bound in patterns cannot be moved from until after the end of the pattern guard - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs b/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs deleted file mode 100644 index 51f2ff75da8..00000000000 --- a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs +++ /dev/null @@ -1,30 +0,0 @@ -// This is a test that the `#![feature(nll)]` opt-in overrides the -// migration mode. The intention here is to emulate the goal behavior -// that `--edition 2018` effects on borrowck (modeled here by `-Z -// borrowck=migrate`) are themselves overridden by the -// `#![feature(nll)]` opt-in. -// -// Therefore, for developer convenience, under `#[feature(nll)]` the -// NLL checks will be emitted as errors *even* in the presence of `-Z -// borrowck=migrate`. - -// revisions: zflag edition -//[zflag]compile-flags: -Z borrowck=migrate -//[edition]edition:2018 - -#![feature(nll)] - -fn main() { - match Some(&4) { - None => {}, - ref mut foo - if { - (|| { let bar = foo; bar.take() })(); - //[zflag]~^ ERROR cannot move out of `foo` in pattern guard [E0507] - //[edition]~^^ ERROR cannot move out of `foo` in pattern guard [E0507] - false - } => {}, - Some(ref _s) => println!("Note this arm is bogus; the `Some` became `None` in the guard."), - _ => println!("Here is some supposedly unreachable code."), - } -} diff --git a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr b/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr deleted file mode 100644 index d88185af778..00000000000 --- a/src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0507]: cannot move out of `foo` in pattern guard - --> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:18 - | -LL | (|| { let bar = foo; bar.take() })(); - | ^^ --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait - | | - | move out of `foo` occurs here - | - = note: variables bound in patterns cannot be moved from until after the end of the pattern guard - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/borrowck/borrowck-local-borrow.rs b/src/test/ui/borrowck/borrowck-local-borrow.rs index ea4589338c4..0aaa4e4c684 100644 --- a/src/test/ui/borrowck/borrowck-local-borrow.rs +++ b/src/test/ui/borrowck/borrowck-local-borrow.rs @@ -2,9 +2,6 @@ // error-pattern:panic 1 // ignore-emscripten no processes -// revisions: migrate mir -//[mir]compile-flags: -Z borrowck=mir - fn main() { let x = 2; let y = &x; diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr deleted file mode 100644 index 3d6d00a0f95..00000000000 --- a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.base.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:13:5 - | -LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> { - | ------------- ----- - | | - | this parameter and the return type are declared with different lifetimes... -LL | S { pointer: &mut *p.pointer } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `p` is returned here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs index 60101d06820..779cb3bbec1 100644 --- a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs +++ b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test that assignments to an `&mut` pointer which is found in a // borrowed (but otherwise non-aliasable) location is illegal. @@ -11,8 +7,7 @@ struct S<'a> { fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> { S { pointer: &mut *p.pointer } - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr similarity index 89% rename from src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr rename to src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr index 7c4de57320e..f28c42ce2d5 100644 --- a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr +++ b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:13:5 + --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:9:5 | LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr deleted file mode 100644 index 10400cff5e5..00000000000 --- a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.migrate.stderr +++ /dev/null @@ -1,54 +0,0 @@ -error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:17:46 - | -LL | pub fn e(x: &'static mut isize) { - | - help: consider changing this to be mutable: `mut x` -LL | static mut Y: isize = 3; -LL | let mut c1 = |y: &'static mut isize| x = y; - | ^^^^^ cannot assign - -error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:28:50 - | -LL | pub fn ee(x: &'static mut isize) { - | - help: consider changing this to be mutable: `mut x` -... -LL | let mut c2 = |y: &'static mut isize| x = y; - | ^^^^^ cannot assign - -error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:40:14 - | -LL | pub fn capture_assign_whole(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { x = (1,); }; - | ^^^^^^^^ cannot assign - -error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:45:14 - | -LL | pub fn capture_assign_part(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { x.0 = 1; }; - | ^^^^^^^ cannot assign - -error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:50:14 - | -LL | pub fn capture_reborrow_whole(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { &mut x; }; - | ^^^^^^ cannot borrow as mutable - -error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:55:14 - | -LL | pub fn capture_reborrow_part(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { &mut x.0; }; - | ^^^^^^^^ cannot borrow as mutable - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0594, E0596. -For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs index fe7ed8ed3fa..b3cce1b3a06 100644 --- a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs +++ b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs @@ -2,21 +2,12 @@ // analysis of a closure body may only be caught when AST-borrowck // looks at some parent. -// revisions: migrate nll -//[nll]compile-flags: -Z borrowck=mir - -// Since we are testing nll (and migration) explicitly as a separate -// revisions, don't worry about the --compare-mode=nll on this test. - -// ignore-compare-mode-nll - // transcribed from borrowck-closures-unique.rs mod borrowck_closures_unique { pub fn e(x: &'static mut isize) { static mut Y: isize = 3; let mut c1 = |y: &'static mut isize| x = y; - //[migrate]~^ ERROR is not declared as mutable - //[nll]~^^ ERROR is not declared as mutable + //~^ ERROR is not declared as mutable unsafe { c1(&mut Y); } } } @@ -26,8 +17,7 @@ mod borrowck_closures_unique_grandparent { static mut Z: isize = 3; let mut c1 = |z: &'static mut isize| { let mut c2 = |y: &'static mut isize| x = y; - //[migrate]~^ ERROR is not declared as mutable - //[nll]~^^ ERROR is not declared as mutable + //~^ ERROR is not declared as mutable c2(z); }; unsafe { c1(&mut Z); } @@ -38,23 +28,19 @@ mod borrowck_closures_unique_grandparent { mod mutability_errors { pub fn capture_assign_whole(x: (i32,)) { || { x = (1,); }; - //[migrate]~^ ERROR is not declared as mutable - //[nll]~^^ ERROR is not declared as mutable + //~^ ERROR is not declared as mutable } pub fn capture_assign_part(x: (i32,)) { || { x.0 = 1; }; - //[migrate]~^ ERROR is not declared as mutable - //[nll]~^^ ERROR is not declared as mutable + //~^ ERROR is not declared as mutable } pub fn capture_reborrow_whole(x: (i32,)) { || { &mut x; }; - //[migrate]~^ ERROR is not declared as mutable - //[nll]~^^ ERROR is not declared as mutable + //~^ ERROR is not declared as mutable } pub fn capture_reborrow_part(x: (i32,)) { || { &mut x.0; }; - //[migrate]~^ ERROR is not declared as mutable - //[nll]~^^ ERROR is not declared as mutable + //~^ ERROR is not declared as mutable } } diff --git a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.nll.stderr b/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr similarity index 84% rename from src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.nll.stderr rename to src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr index 10400cff5e5..4c299cdc455 100644 --- a/src/test/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.nll.stderr +++ b/src/test/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:17:46 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46 | LL | pub fn e(x: &'static mut isize) { | - help: consider changing this to be mutable: `mut x` @@ -8,7 +8,7 @@ LL | let mut c1 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:28:50 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:19:50 | LL | pub fn ee(x: &'static mut isize) { | - help: consider changing this to be mutable: `mut x` @@ -17,7 +17,7 @@ LL | let mut c2 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:40:14 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:30:14 | LL | pub fn capture_assign_whole(x: (i32,)) { | - help: consider changing this to be mutable: `mut x` @@ -25,7 +25,7 @@ LL | || { x = (1,); }; | ^^^^^^^^ cannot assign error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:45:14 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:34:14 | LL | pub fn capture_assign_part(x: (i32,)) { | - help: consider changing this to be mutable: `mut x` @@ -33,7 +33,7 @@ LL | || { x.0 = 1; }; | ^^^^^^^ cannot assign error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:50:14 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:38:14 | LL | pub fn capture_reborrow_whole(x: (i32,)) { | - help: consider changing this to be mutable: `mut x` @@ -41,7 +41,7 @@ LL | || { &mut x; }; | ^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable - --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:55:14 + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:42:14 | LL | pub fn capture_reborrow_part(x: (i32,)) { | - help: consider changing this to be mutable: `mut x` diff --git a/src/test/ui/borrowck/issue-71546.rs b/src/test/ui/borrowck/issue-71546.rs index 943f7f86e55..b20c39193de 100644 --- a/src/test/ui/borrowck/issue-71546.rs +++ b/src/test/ui/borrowck/issue-71546.rs @@ -1,18 +1,20 @@ // Regression test for #71546. -// ignore-compare-mode-nll -// NLL stderr is different from the original one. - pub fn serialize_as_csv(value: &V) -> Result where V: 'static, for<'a> &'a V: IntoIterator, for<'a> <&'a V as IntoIterator>::Item: ToString + 'static, { - let csv_str: String = value //~ ERROR: the associated type `<&'a V as IntoIterator>::Item` may not live long enough + let csv_str: String = value + //~^ ERROR higher-ranked lifetime error + //~| ERROR higher-ranked lifetime error + //~| ERROR higher-ranked lifetime error .into_iter() .map(|elem| elem.to_string()) + //~^ ERROR higher-ranked lifetime error .collect::(); + //~^ ERROR higher-ranked lifetime error Ok(csv_str) } diff --git a/src/test/ui/borrowck/issue-71546.stderr b/src/test/ui/borrowck/issue-71546.stderr index d479ca8f1d8..b8d79f0939b 100644 --- a/src/test/ui/borrowck/issue-71546.stderr +++ b/src/test/ui/borrowck/issue-71546.stderr @@ -1,20 +1,59 @@ -error[E0310]: the associated type `<&'a V as IntoIterator>::Item` may not live long enough - --> $DIR/issue-71546.rs:12:27 +error: higher-ranked lifetime error + --> $DIR/issue-71546.rs:9:27 | LL | let csv_str: String = value | ___________________________^ +LL | | +LL | | +LL | | LL | | .into_iter() LL | | .map(|elem| elem.to_string()) | |_____________________________________^ | - = help: consider adding an explicit lifetime bound `<&'a V as IntoIterator>::Item: 'static`... - = note: ...so that the type `<&'a V as IntoIterator>::Item` will meet its required lifetime bounds... -note: ...that is required by this bound - --> $DIR/issue-71546.rs:10:55 + = note: could not prove for<'r> [closure@$DIR/issue-71546.rs:14:14: 14:37] well-formed + +error: higher-ranked lifetime error + --> $DIR/issue-71546.rs:9:27 | -LL | for<'a> <&'a V as IntoIterator>::Item: ToString + 'static, - | ^^^^^^^ +LL | let csv_str: String = value + | ___________________________^ +LL | | +LL | | +LL | | +LL | | .into_iter() +LL | | .map(|elem| elem.to_string()) + | |_____________________________________^ + | + = note: could not prove for<'r, 's> Map<<&'r V as IntoIterator>::IntoIter, [closure@$DIR/issue-71546.rs:14:14: 14:37]> well-formed -error: aborting due to previous error +error: higher-ranked lifetime error + --> $DIR/issue-71546.rs:9:27 + | +LL | let csv_str: String = value + | ___________________________^ +LL | | +LL | | +LL | | +... | +LL | | +LL | | .collect::(); + | |____________________________^ + | + = note: could not prove for<'r, 's> Map<<&'r V as IntoIterator>::IntoIter, [closure@$DIR/issue-71546.rs:14:14: 14:37]> well-formed + +error: higher-ranked lifetime error + --> $DIR/issue-71546.rs:14:14 + | +LL | .map(|elem| elem.to_string()) + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: could not prove for<'a> <&'a V as IntoIterator>::Item: 'static + +error: higher-ranked lifetime error + --> $DIR/issue-71546.rs:16:10 + | +LL | .collect::(); + | ^^^^^^^ + +error: aborting due to 5 previous errors -For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr index 40786c032b1..aacf178932e 100644 --- a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr +++ b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:30:15 + --> $DIR/two-phase-activation-sharing-interference.rs:28:15 | LL | let y = &mut x; | ------ mutable borrow occurs here @@ -10,7 +10,7 @@ LL | *y += 1; | ------- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:38:13 + --> $DIR/two-phase-activation-sharing-interference.rs:36:13 | LL | let y = &mut x; | ------ mutable borrow occurs here @@ -21,7 +21,7 @@ LL | *y += 1; | ------- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:49:13 + --> $DIR/two-phase-activation-sharing-interference.rs:47:13 | LL | let y = &mut x; | ------ mutable borrow occurs here @@ -32,7 +32,7 @@ LL | *y += 1; | ------- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:60:14 + --> $DIR/two-phase-activation-sharing-interference.rs:58:14 | LL | let y = &mut x; | ------ mutable borrow occurs here diff --git a/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs b/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs index 4d77ac915b1..8b880ff6416 100644 --- a/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs +++ b/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs @@ -1,9 +1,7 @@ // revisions: nll_target // The following revisions are disabled due to missing support from two-phase beyond autorefs -//[nll_beyond] compile-flags: -Z borrowck=mir -Z two-phase-beyond-autoref - -//[nll_target] compile-flags: -Z borrowck=mir +//[nll_beyond] compile-flags: -Z two-phase-beyond-autoref // This is an important corner case pointed out by Niko: one is // allowed to initiate a shared borrow during a reservation, but it diff --git a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr index bba3393fc14..a6c65421d91 100644 --- a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr +++ b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr @@ -1,5 +1,5 @@ error[E0503]: cannot use `i` because it was mutably borrowed - --> $DIR/two-phase-allow-access-during-reservation.rs:28:19 + --> $DIR/two-phase-allow-access-during-reservation.rs:26:19 | LL | /*1*/ let p = &mut i; // (reservation of `i` starts here) | ------ borrow of `i` occurs here @@ -11,7 +11,7 @@ LL | /*3*/ *p += 1; // (mutable borrow of `i` starts here, since `p` | ------- borrow later used here error[E0503]: cannot use `i` because it was mutably borrowed - --> $DIR/two-phase-allow-access-during-reservation.rs:33:19 + --> $DIR/two-phase-allow-access-during-reservation.rs:31:19 | LL | /*1*/ let p = &mut i; // (reservation of `i` starts here) | ------ borrow of `i` occurs here diff --git a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs index 3afa679ce39..67d0842070f 100644 --- a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs +++ b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.rs @@ -1,9 +1,7 @@ // revisions: nll_target // The following revisions are disabled due to missing support for two_phase_beyond_autoref -//[nll_beyond] compile-flags: -Z borrowck=mir -Z two_phase_beyond_autoref - -//[nll_target] compile-flags: -Z borrowck=mir +//[nll_beyond] compile-flags: -Z two_phase_beyond_autoref // This is the second counter-example from Niko's blog post // smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/ diff --git a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs index f2097fdf823..dd2ef4e27ee 100644 --- a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs +++ b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z borrowck=mir - // This is the third counter-example from Niko's blog post // smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/ // diff --git a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr index a89bb941532..21b0eddb902 100644 --- a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr +++ b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-cannot-nest-mut-self-calls.rs:16:9 + --> $DIR/two-phase-cannot-nest-mut-self-calls.rs:14:9 | LL | vec.get({ | - --- immutable borrow later used by call diff --git a/src/test/ui/borrowck/two-phase-method-receivers.rs b/src/test/ui/borrowck/two-phase-method-receivers.rs index 6838f6c7efd..6b879af5aec 100644 --- a/src/test/ui/borrowck/two-phase-method-receivers.rs +++ b/src/test/ui/borrowck/two-phase-method-receivers.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z borrowck=mir - // run-pass struct Foo<'a> { diff --git a/src/test/ui/borrowck/two-phase-multiple-activations.rs b/src/test/ui/borrowck/two-phase-multiple-activations.rs index 599138a9ce0..53fb71ebed4 100644 --- a/src/test/ui/borrowck/two-phase-multiple-activations.rs +++ b/src/test/ui/borrowck/two-phase-multiple-activations.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z borrowck=mir - // run-pass use std::io::Result; diff --git a/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr b/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr index 3518a663e59..efd63a08aae 100644 --- a/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr +++ b/src/test/ui/borrowck/two-phase-nonrecv-autoref.base.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `*f` as mutable more than once at a time - --> $DIR/two-phase-nonrecv-autoref.rs:51:11 + --> $DIR/two-phase-nonrecv-autoref.rs:50:11 | LL | f(f(10)); | - ^ second mutable borrow occurs here @@ -8,7 +8,7 @@ LL | f(f(10)); | first borrow later used by call error[E0382]: use of moved value: `f` - --> $DIR/two-phase-nonrecv-autoref.rs:58:11 + --> $DIR/two-phase-nonrecv-autoref.rs:57:11 | LL | fn twice_ten_so i32>(f: Box) { | - move occurs because `f` has type `Box`, which does not implement the `Copy` trait @@ -18,7 +18,7 @@ LL | f(f(10)); | value moved here error[E0499]: cannot borrow `*f` as mutable more than once at a time - --> $DIR/two-phase-nonrecv-autoref.rs:63:11 + --> $DIR/two-phase-nonrecv-autoref.rs:62:11 | LL | f(f(10)); | - ^ second mutable borrow occurs here @@ -27,7 +27,7 @@ LL | f(f(10)); | first borrow later used by call error[E0382]: use of moved value: `f` - --> $DIR/two-phase-nonrecv-autoref.rs:70:11 + --> $DIR/two-phase-nonrecv-autoref.rs:69:11 | LL | fn twice_ten_oo(f: Box i32>) { | - move occurs because `f` has type `Box i32>`, which does not implement the `Copy` trait @@ -37,7 +37,7 @@ LL | f(f(10)); | value moved here error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-nonrecv-autoref.rs:108:27 + --> $DIR/two-phase-nonrecv-autoref.rs:107:27 | LL | double_access(&mut a, &a); | ------------- ------ ^^ immutable borrow occurs here @@ -46,7 +46,7 @@ LL | double_access(&mut a, &a); | mutable borrow later used by call error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-nonrecv-autoref.rs:133:7 + --> $DIR/two-phase-nonrecv-autoref.rs:132:7 | LL | i[i[3]] = 4; | --^---- @@ -56,18 +56,18 @@ LL | i[i[3]] = 4; | mutable borrow later used here | help: try adding a local storing this... - --> $DIR/two-phase-nonrecv-autoref.rs:133:7 + --> $DIR/two-phase-nonrecv-autoref.rs:132:7 | LL | i[i[3]] = 4; | ^^^^ help: ...and then using that local here - --> $DIR/two-phase-nonrecv-autoref.rs:133:5 + --> $DIR/two-phase-nonrecv-autoref.rs:132:5 | LL | i[i[3]] = 4; | ^^^^^^^ error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-nonrecv-autoref.rs:139:7 + --> $DIR/two-phase-nonrecv-autoref.rs:138:7 | LL | i[i[3]] = i[4]; | --^---- @@ -77,12 +77,12 @@ LL | i[i[3]] = i[4]; | mutable borrow later used here | help: try adding a local storing this... - --> $DIR/two-phase-nonrecv-autoref.rs:139:7 + --> $DIR/two-phase-nonrecv-autoref.rs:138:7 | LL | i[i[3]] = i[4]; | ^^^^ help: ...and then using that local here - --> $DIR/two-phase-nonrecv-autoref.rs:139:5 + --> $DIR/two-phase-nonrecv-autoref.rs:138:5 | LL | i[i[3]] = i[4]; | ^^^^^^^ diff --git a/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr b/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr deleted file mode 100644 index 3518a663e59..00000000000 --- a/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr +++ /dev/null @@ -1,93 +0,0 @@ -error[E0499]: cannot borrow `*f` as mutable more than once at a time - --> $DIR/two-phase-nonrecv-autoref.rs:51:11 - | -LL | f(f(10)); - | - ^ second mutable borrow occurs here - | | - | first mutable borrow occurs here - | first borrow later used by call - -error[E0382]: use of moved value: `f` - --> $DIR/two-phase-nonrecv-autoref.rs:58:11 - | -LL | fn twice_ten_so i32>(f: Box) { - | - move occurs because `f` has type `Box`, which does not implement the `Copy` trait -LL | f(f(10)); - | - ^ value used here after move - | | - | value moved here - -error[E0499]: cannot borrow `*f` as mutable more than once at a time - --> $DIR/two-phase-nonrecv-autoref.rs:63:11 - | -LL | f(f(10)); - | - ^ second mutable borrow occurs here - | | - | first mutable borrow occurs here - | first borrow later used by call - -error[E0382]: use of moved value: `f` - --> $DIR/two-phase-nonrecv-autoref.rs:70:11 - | -LL | fn twice_ten_oo(f: Box i32>) { - | - move occurs because `f` has type `Box i32>`, which does not implement the `Copy` trait -LL | f(f(10)); - | - ^ value used here after move - | | - | value moved here - -error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-nonrecv-autoref.rs:108:27 - | -LL | double_access(&mut a, &a); - | ------------- ------ ^^ immutable borrow occurs here - | | | - | | mutable borrow occurs here - | mutable borrow later used by call - -error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-nonrecv-autoref.rs:133:7 - | -LL | i[i[3]] = 4; - | --^---- - | | | - | | immutable borrow occurs here - | mutable borrow occurs here - | mutable borrow later used here - | -help: try adding a local storing this... - --> $DIR/two-phase-nonrecv-autoref.rs:133:7 - | -LL | i[i[3]] = 4; - | ^^^^ -help: ...and then using that local here - --> $DIR/two-phase-nonrecv-autoref.rs:133:5 - | -LL | i[i[3]] = 4; - | ^^^^^^^ - -error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-nonrecv-autoref.rs:139:7 - | -LL | i[i[3]] = i[4]; - | --^---- - | | | - | | immutable borrow occurs here - | mutable borrow occurs here - | mutable borrow later used here - | -help: try adding a local storing this... - --> $DIR/two-phase-nonrecv-autoref.rs:139:7 - | -LL | i[i[3]] = i[4]; - | ^^^^ -help: ...and then using that local here - --> $DIR/two-phase-nonrecv-autoref.rs:139:5 - | -LL | i[i[3]] = i[4]; - | ^^^^^^^ - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0382, E0499, E0502. -For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs b/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs index b6cc099a614..3d395d1f264 100644 --- a/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs +++ b/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs @@ -1,7 +1,6 @@ -// revisions: base nll -//[nll]compile-flags: -Z borrowck=mir +// revisions: base -//[g2p]compile-flags: -Z borrowck=mir -Z two-phase-beyond-autoref +//[g2p]compile-flags: -Z two-phase-beyond-autoref // the above revision is disabled until two-phase-beyond-autoref support is better // This is a test checking that when we limit two-phase borrows to diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.base.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.base.stderr deleted file mode 100644 index cbbbde61917..00000000000 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.base.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5 - | -LL | let shared = &v; - | -- immutable borrow occurs here -LL | -LL | v.extend(shared); - | ^^------^^^^^^^^ - | | | - | | immutable borrow later used by call - | mutable borrow occurs here - -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:27:5 - | -LL | v.extend(&v); - | ^^------^--^ - | | | | - | | | immutable borrow occurs here - | | immutable borrow later used by call - | mutable borrow occurs here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr deleted file mode 100644 index 69c3d7915e4..00000000000 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5 - | -LL | let shared = &v; - | -- immutable borrow occurs here -LL | -LL | v.extend(shared); - | ^^------^^^^^^^^ - | | | - | | immutable borrow later used by call - | mutable borrow occurs here - -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5 - | -LL | v.extend(&v); - | ^^------^--^ - | | | | - | | | immutable borrow occurs here - | | immutable borrow later used by call - | mutable borrow occurs here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr deleted file mode 100644 index cbbbde61917..00000000000 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5 - | -LL | let shared = &v; - | -- immutable borrow occurs here -LL | -LL | v.extend(shared); - | ^^------^^^^^^^^ - | | | - | | immutable borrow later used by call - | mutable borrow occurs here - -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:27:5 - | -LL | v.extend(&v); - | ^^------^--^ - | | | | - | | | immutable borrow occurs here - | | immutable borrow later used by call - | mutable borrow occurs here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr deleted file mode 100644 index 69c3d7915e4..00000000000 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5 - | -LL | let shared = &v; - | -- immutable borrow occurs here -LL | -LL | v.extend(shared); - | ^^------^^^^^^^^ - | | | - | | immutable borrow later used by call - | mutable borrow occurs here - -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5 - | -LL | v.extend(&v); - | ^^------^--^ - | | | | - | | | immutable borrow occurs here - | | immutable borrow later used by call - | mutable borrow occurs here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr deleted file mode 100644 index 69c3d7915e4..00000000000 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5 - | -LL | let shared = &v; - | -- immutable borrow occurs here -LL | -LL | v.extend(shared); - | ^^------^^^^^^^^ - | | | - | | immutable borrow later used by call - | mutable borrow occurs here - -error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5 - | -LL | v.extend(&v); - | ^^------^--^ - | | | | - | | | immutable borrow occurs here - | | immutable borrow later used by call - | mutable borrow occurs here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs index 3e125869ef1..27e599c6cd5 100644 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs +++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs @@ -2,31 +2,21 @@ // accidentally allowed under migrate/nll, then linted against in migrate mode // but disallowed under NLL. Now, we accept it everywhere. -//ignore-compare-mode-nll //ignore-compare-mode-polonius -//revisions: base nll - -//[migrate2018] edition:2018 -//[nll2018] edition:2018 - -#![cfg_attr(nll, feature(nll))] - fn double_conflicts() { let mut v = vec![0, 1, 2]; let shared = &v; v.extend(shared); - //[base]~^ ERROR cannot borrow `v` as mutable - //[nll]~^^ ERROR cannot borrow `v` as mutable + //~^ ERROR cannot borrow `v` as mutable } fn activation_conflict() { let mut v = vec![0, 1, 2]; v.extend(&v); - //[base]~^ ERROR cannot borrow `v` as mutable - //[nll]~^^ ERROR cannot borrow `v` as mutable + //~^ ERROR cannot borrow `v` as mutable } fn reservation_allowed() { diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr similarity index 84% rename from src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr rename to src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr index 69c3d7915e4..e4dc4dc5999 100644 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr +++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5 + --> $DIR/two-phase-reservation-sharing-interference-2.rs:11:5 | LL | let shared = &v; | -- immutable borrow occurs here @@ -11,7 +11,7 @@ LL | v.extend(shared); | mutable borrow occurs here error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5 + --> $DIR/two-phase-reservation-sharing-interference-2.rs:18:5 | LL | v.extend(&v); | ^^------^--^ diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr index 2cbdc0901bc..e3e4057d6a7 100644 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr +++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable - --> $DIR/two-phase-reservation-sharing-interference.rs:34:17 + --> $DIR/two-phase-reservation-sharing-interference.rs:32:17 | LL | let shared = &vec; | ---- immutable borrow occurs here diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs index 50248a55838..e0f4afa7527 100644 --- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs +++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs @@ -1,11 +1,9 @@ // revisions: nll_target // The nll_beyond revision is disabled due to missing support from two-phase beyond autorefs -//[nll_beyond]compile-flags: -Z borrowck=mir -Z two-phase-beyond-autoref +//[nll_beyond]compile-flags: -Z two-phase-beyond-autoref //[nll_beyond]should-fail -//[nll_target]compile-flags: -Z borrowck=mir - // This is a corner case that the current implementation is (probably) // treating more conservatively than is necessary. But it also does // not seem like a terribly important use case to cover. diff --git a/src/test/ui/borrowck/two-phase-sneaky.rs b/src/test/ui/borrowck/two-phase-sneaky.rs index b6e33d5d1b8..bf06366debe 100644 --- a/src/test/ui/borrowck/two-phase-sneaky.rs +++ b/src/test/ui/borrowck/two-phase-sneaky.rs @@ -1,5 +1,3 @@ -// cmpile-flags: -Z borrowck=mir - // This is the first counter-example from Niko's blog post // smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/ // of a danger for code to crash if we just turned off the check for whether diff --git a/src/test/ui/borrowck/two-phase-sneaky.stderr b/src/test/ui/borrowck/two-phase-sneaky.stderr index cffbf0706fe..0dbed98b841 100644 --- a/src/test/ui/borrowck/two-phase-sneaky.stderr +++ b/src/test/ui/borrowck/two-phase-sneaky.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `v` as mutable more than once at a time - --> $DIR/two-phase-sneaky.rs:12:9 + --> $DIR/two-phase-sneaky.rs:10:9 | LL | v[0].push_str({ | - -------- first borrow later used by call diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr deleted file mode 100644 index c3efe16e251..00000000000 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr +++ /dev/null @@ -1,68 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:20:52 - | -LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); - | ^^^^^^^^^^^ lifetime mismatch - | - = note: expected fn pointer `fn(&u32)` - found fn pointer `fn(&'x u32)` -note: the anonymous lifetime #1 defined here... - --> $DIR/expect-fn-supply-fn.rs:20:48 - | -LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); - | ^^^^^^^^^^^^^^^^^^^^^^ -note: ...does not necessarily outlive the lifetime `'x` as defined here - --> $DIR/expect-fn-supply-fn.rs:17:36 - | -LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { - | ^^ - -error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:20:52 - | -LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); - | ^^^^^^^^^^^ lifetime mismatch - | - = note: expected fn pointer `fn(&u32)` - found fn pointer `fn(&'x u32)` -note: the lifetime `'x` as defined here... - --> $DIR/expect-fn-supply-fn.rs:17:36 - | -LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { - | ^^ -note: ...does not necessarily outlive the anonymous lifetime #1 defined here - --> $DIR/expect-fn-supply-fn.rs:20:48 - | -LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); - | ^^^^^^^^^^^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:38:52 - | -LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); - | ^^^^^^^^ one type is more general than the other - | - = note: expected fn pointer `fn(&u32)` - found fn pointer `for<'r> fn(&'r u32)` - -error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:45:53 - | -LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); - | ^^^^^^^^^^^ one type is more general than the other - | - = note: expected fn pointer `for<'r> fn(&'r u32)` - found fn pointer `fn(&'x u32)` - -error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:54:53 - | -LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { - | ^^^^^^^ one type is more general than the other - | - = note: expected fn pointer `for<'r> fn(&'r u32)` - found fn pointer `fn(&u32)` - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs index 1715f56ff63..7f1c140279c 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn with_closure_expecting_fn_with_free_region(_: F) where F: for<'a> FnOnce(fn(&'a u32), &i32), @@ -18,10 +14,8 @@ fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { // Here, the type given for `'x` "obscures" a region from the // expected signature that is bound at closure level. with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); - //[base]~^ ERROR mismatched types - //[base]~| ERROR mismatched types - //[nll]~^^^ ERROR lifetime may not live long enough - //[nll]~| ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough } fn expect_free_supply_free_from_closure() { diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr similarity index 90% rename from src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr rename to src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr index 52e2898d2bb..26f47eb684d 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/expect-fn-supply-fn.rs:20:49 + --> $DIR/expect-fn-supply-fn.rs:16:49 | LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | -- lifetime `'x` defined here @@ -11,7 +11,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | requires that `'1` must outlive `'x` error: lifetime may not live long enough - --> $DIR/expect-fn-supply-fn.rs:20:49 + --> $DIR/expect-fn-supply-fn.rs:16:49 | LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | -- lifetime `'x` defined here @@ -20,7 +20,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^ requires that `'x` must outlive `'static` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:38:49 + --> $DIR/expect-fn-supply-fn.rs:32:49 | LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); | ^ one type is more general than the other @@ -29,7 +29,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); found fn pointer `fn(&u32)` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:45:50 + --> $DIR/expect-fn-supply-fn.rs:39:50 | LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); | ^ one type is more general than the other @@ -38,7 +38,7 @@ LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); found fn pointer `for<'r> fn(&'r u32)` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:54:50 + --> $DIR/expect-fn-supply-fn.rs:48:50 | LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { | ^ one type is more general than the other diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr deleted file mode 100644 index 93ed51fa7e1..00000000000 --- a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.base.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:9 - | -LL | fn foo(x: &()) { - | --- this data with an anonymous lifetime `'_`... -LL | bar(|| { - | _________^ -LL | | -LL | | -LL | | -LL | | let _ = x; -LL | | }) - | |_____^ ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:5 - | -LL | bar(|| { - | ^^^ -note: `'static` lifetime requirement introduced by this bound - --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:39 - | -LL | fn bar(blk: F) where F: FnOnce() + 'static { - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs index 6c49cd76b13..7327d825668 100644 --- a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs +++ b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs @@ -1,15 +1,10 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - fn bar(blk: F) where F: FnOnce() + 'static { } fn foo(x: &()) { bar(|| { - //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR borrowed data escapes - //[nll]~| ERROR closure may outlive + //~^ ERROR borrowed data escapes + //~| ERROR closure may outlive let _ = x; }) } diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr similarity index 85% rename from src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr rename to src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr index dc5188a8651..85df5c1e5b3 100644 --- a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr +++ b/src/test/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:9:5 + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5 | LL | fn foo(x: &()) { | - - let's call the lifetime of this reference `'1` @@ -8,7 +8,6 @@ LL | fn foo(x: &()) { LL | / bar(|| { LL | | LL | | -LL | | LL | | let _ = x; LL | | }) | | ^ @@ -17,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:9:9 + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:9 | LL | bar(|| { | ^^ may outlive borrowed value `x` @@ -26,12 +25,11 @@ LL | let _ = x; | - `x` is borrowed here | note: function requires argument type to outlive `'static` - --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:9:5 + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5 | LL | / bar(|| { LL | | LL | | -LL | | LL | | let _ = x; LL | | }) | |______^ diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr deleted file mode 100644 index be81efd27c4..00000000000 --- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.base.stderr +++ /dev/null @@ -1,55 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/expect-region-supply-region-2.rs:18:33 - | -LL | closure_expecting_bound(|x: &'x u32| { - | ^^^^^^^ lifetime mismatch - | - = note: expected reference `&u32` - found reference `&'x u32` -note: the anonymous lifetime #1 defined here... - --> $DIR/expect-region-supply-region-2.rs:18:29 - | -LL | closure_expecting_bound(|x: &'x u32| { - | _____________________________^ -LL | | -LL | | -LL | | -... | -LL | | f = Some(x); -LL | | }); - | |_____^ -note: ...does not necessarily outlive the lifetime `'x` as defined here - --> $DIR/expect-region-supply-region-2.rs:13:30 - | -LL | fn expect_bound_supply_named<'x>() { - | ^^ - -error[E0308]: mismatched types - --> $DIR/expect-region-supply-region-2.rs:18:33 - | -LL | closure_expecting_bound(|x: &'x u32| { - | ^^^^^^^ lifetime mismatch - | - = note: expected reference `&u32` - found reference `&'x u32` -note: the lifetime `'x` as defined here... - --> $DIR/expect-region-supply-region-2.rs:13:30 - | -LL | fn expect_bound_supply_named<'x>() { - | ^^ -note: ...does not necessarily outlive the anonymous lifetime #1 defined here - --> $DIR/expect-region-supply-region-2.rs:18:29 - | -LL | closure_expecting_bound(|x: &'x u32| { - | _____________________________^ -LL | | -LL | | -LL | | -... | -LL | | f = Some(x); -LL | | }); - | |_____^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs index 072ba57c10b..9b51bbd58a3 100644 --- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs +++ b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![allow(warnings)] fn closure_expecting_bound(_: F) @@ -16,10 +12,8 @@ fn expect_bound_supply_named<'x>() { // Here we give a type annotation that `x` should be free. We get // an error because of that. closure_expecting_bound(|x: &'x u32| { - //[base]~^ ERROR mismatched types - //[base]~| ERROR mismatched types - //[nll]~^^^ ERROR lifetime may not live long enough - //[nll]~| ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough // Borrowck doesn't get a chance to run, but if it did it should error // here. diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.nll.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.stderr similarity index 87% rename from src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.nll.stderr rename to src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.stderr index 4a9a19422d7..9aab51c986c 100644 --- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.nll.stderr +++ b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/expect-region-supply-region-2.rs:18:30 + --> $DIR/expect-region-supply-region-2.rs:14:30 | LL | fn expect_bound_supply_named<'x>() { | -- lifetime `'x` defined here @@ -10,7 +10,7 @@ LL | closure_expecting_bound(|x: &'x u32| { | requires that `'1` must outlive `'x` error: lifetime may not live long enough - --> $DIR/expect-region-supply-region-2.rs:18:30 + --> $DIR/expect-region-supply-region-2.rs:14:30 | LL | fn expect_bound_supply_named<'x>() { | -- lifetime `'x` defined here diff --git a/src/test/ui/const-generics/invariant.base.stderr b/src/test/ui/const-generics/invariant.base.stderr deleted file mode 100644 index 255900e19bb..00000000000 --- a/src/test/ui/const-generics/invariant.base.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())` - --> $DIR/invariant.rs:18:1 - | -LL | impl SadBee for for<'a> fn(&'a ()) { - | ---------------------------------- first implementation here -... -LL | impl SadBee for fn(&'static ()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())` - | - = note: `#[warn(coherence_leak_check)]` on by default - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #56105 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - -error[E0308]: mismatched types - --> $DIR/invariant.rs:31:5 - | -LL | v - | ^ one type is more general than the other - | - = note: expected reference `&'static Foo` - found reference `&'static Foo fn(&'a ())>` - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/invariant.rs b/src/test/ui/const-generics/invariant.rs index 65d1ee9420c..ee191b65c2c 100644 --- a/src/test/ui/const-generics/invariant.rs +++ b/src/test/ui/const-generics/invariant.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::marker::PhantomData; diff --git a/src/test/ui/const-generics/invariant.nll.stderr b/src/test/ui/const-generics/invariant.stderr similarity index 94% rename from src/test/ui/const-generics/invariant.nll.stderr rename to src/test/ui/const-generics/invariant.stderr index f684f7fddc8..ce0fad10471 100644 --- a/src/test/ui/const-generics/invariant.nll.stderr +++ b/src/test/ui/const-generics/invariant.stderr @@ -1,5 +1,5 @@ warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())` - --> $DIR/invariant.rs:18:1 + --> $DIR/invariant.rs:14:1 | LL | impl SadBee for for<'a> fn(&'a ()) { | ---------------------------------- first implementation here @@ -13,7 +13,7 @@ LL | impl SadBee for fn(&'static ()) { = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details error[E0308]: mismatched types - --> $DIR/invariant.rs:31:5 + --> $DIR/invariant.rs:27:5 | LL | v | ^ one type is more general than the other diff --git a/src/test/ui/consts/const-blocks/migrate-fail.rs b/src/test/ui/consts/const-blocks/migrate-fail.rs index d5a17249cc9..fddbfbb9d32 100644 --- a/src/test/ui/consts/const-blocks/migrate-fail.rs +++ b/src/test/ui/consts/const-blocks/migrate-fail.rs @@ -1,5 +1,3 @@ -// ignore-compare-mode-nll -// compile-flags: -Z borrowck=migrate #![allow(warnings)] // Some type that is not copyable. diff --git a/src/test/ui/consts/const-blocks/migrate-fail.stderr b/src/test/ui/consts/const-blocks/migrate-fail.stderr index 2e7ff5cb8b3..803281c0794 100644 --- a/src/test/ui/consts/const-blocks/migrate-fail.stderr +++ b/src/test/ui/consts/const-blocks/migrate-fail.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied - --> $DIR/migrate-fail.rs:13:38 + --> $DIR/migrate-fail.rs:11:38 | LL | let arr: [Option; 2] = [x; 2]; | ^ the trait `Copy` is not implemented for `Bar` @@ -12,7 +12,7 @@ LL | #[derive(Copy)] | error[E0277]: the trait bound `Bar: Copy` is not satisfied - --> $DIR/migrate-fail.rs:19:38 + --> $DIR/migrate-fail.rs:17:38 | LL | let arr: [Option; 2] = [x; 2]; | ^ the trait `Copy` is not implemented for `Bar` diff --git a/src/test/ui/consts/const-blocks/migrate-pass.rs b/src/test/ui/consts/const-blocks/migrate-pass.rs index 3195717fa38..fd66f5aa64f 100644 --- a/src/test/ui/consts/const-blocks/migrate-pass.rs +++ b/src/test/ui/consts/const-blocks/migrate-pass.rs @@ -1,6 +1,4 @@ // check-pass -// compile-flags: -Z borrowck=migrate -// ignore-compare-mode-nll #![allow(warnings)] // Some type that is not copyable. diff --git a/src/test/ui/consts/const-blocks/nll-fail.rs b/src/test/ui/consts/const-blocks/nll-fail.rs index 9d4aef39e54..fddbfbb9d32 100644 --- a/src/test/ui/consts/const-blocks/nll-fail.rs +++ b/src/test/ui/consts/const-blocks/nll-fail.rs @@ -1,4 +1,3 @@ -// ignore-compare-mode-nll #![allow(warnings)] // Some type that is not copyable. diff --git a/src/test/ui/consts/const-blocks/nll-fail.stderr b/src/test/ui/consts/const-blocks/nll-fail.stderr index c0d273b5a9a..8841af15dc0 100644 --- a/src/test/ui/consts/const-blocks/nll-fail.stderr +++ b/src/test/ui/consts/const-blocks/nll-fail.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied - --> $DIR/nll-fail.rs:12:38 + --> $DIR/nll-fail.rs:11:38 | LL | let arr: [Option; 2] = [x; 2]; | ^ the trait `Copy` is not implemented for `Bar` @@ -12,7 +12,7 @@ LL | #[derive(Copy)] | error[E0277]: the trait bound `Bar: Copy` is not satisfied - --> $DIR/nll-fail.rs:18:38 + --> $DIR/nll-fail.rs:17:38 | LL | let arr: [Option; 2] = [x; 2]; | ^ the trait `Copy` is not implemented for `Bar` diff --git a/src/test/ui/consts/const-blocks/nll-pass.rs b/src/test/ui/consts/const-blocks/nll-pass.rs index d8defa19483..fd66f5aa64f 100644 --- a/src/test/ui/consts/const-blocks/nll-pass.rs +++ b/src/test/ui/consts/const-blocks/nll-pass.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-compare-mode-nll #![allow(warnings)] // Some type that is not copyable. diff --git a/src/test/ui/error-codes/E0161.migrate.stderr b/src/test/ui/error-codes/E0161.base.stderr similarity index 90% rename from src/test/ui/error-codes/E0161.migrate.stderr rename to src/test/ui/error-codes/E0161.base.stderr index fb082bc1eab..fb578cda17e 100644 --- a/src/test/ui/error-codes/E0161.migrate.stderr +++ b/src/test/ui/error-codes/E0161.base.stderr @@ -1,5 +1,5 @@ error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined - --> $DIR/E0161.rs:32:5 + --> $DIR/E0161.rs:16:5 | LL | x.f(); | ^^^^^ diff --git a/src/test/ui/error-codes/E0161.edition.stderr b/src/test/ui/error-codes/E0161.edition.stderr deleted file mode 100644 index fb082bc1eab..00000000000 --- a/src/test/ui/error-codes/E0161.edition.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined - --> $DIR/E0161.rs:32:5 - | -LL | x.f(); - | ^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.nll.stderr b/src/test/ui/error-codes/E0161.nll.stderr deleted file mode 100644 index fb082bc1eab..00000000000 --- a/src/test/ui/error-codes/E0161.nll.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined - --> $DIR/E0161.rs:32:5 - | -LL | x.f(); - | ^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.rs b/src/test/ui/error-codes/E0161.rs index f3a7b68c7cf..c906e3c352d 100644 --- a/src/test/ui/error-codes/E0161.rs +++ b/src/test/ui/error-codes/E0161.rs @@ -1,28 +1,12 @@ // Check that E0161 is a hard error in all possible configurations that might // affect it. -// revisions: migrate nll zflags edition migrateul nllul zflagsul editionul -//[zflags]compile-flags: -Z borrowck=migrate -//[edition]edition:2018 -//[zflagsul]compile-flags: -Z borrowck=migrate -//[editionul]edition:2018 -//[migrateul] check-pass -//[nllul] check-pass -//[zflagsul] check-pass -//[editionul] check-pass - -// Since we are testing nll (and migration) explicitly as a separate -// revisions, don't worry about the --compare-mode=nll on this test. - -// ignore-compare-mode-nll +// revisions: base ul +//[base] check-fail +//[ul] check-pass #![allow(incomplete_features)] -#![cfg_attr(nll, feature(nll))] -#![cfg_attr(nllul, feature(nll))] -#![cfg_attr(migrateul, feature(unsized_locals))] -#![cfg_attr(zflagsul, feature(unsized_locals))] -#![cfg_attr(nllul, feature(unsized_locals))] -#![cfg_attr(editionul, feature(unsized_locals))] +#![cfg_attr(ul, feature(unsized_locals))] trait Bar { fn f(self); @@ -30,7 +14,7 @@ trait Bar { fn foo(x: Box) { x.f(); - //[migrate,nll,zflags,edition]~^ ERROR E0161 + //[base]~^ ERROR E0161 } fn main() {} diff --git a/src/test/ui/error-codes/E0161.zflags.stderr b/src/test/ui/error-codes/E0161.zflags.stderr deleted file mode 100644 index fb082bc1eab..00000000000 --- a/src/test/ui/error-codes/E0161.zflags.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined - --> $DIR/E0161.rs:32:5 - | -LL | x.f(); - | ^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0490.base.stderr b/src/test/ui/error-codes/E0490.base.stderr deleted file mode 100644 index 5cb62e19ccf..00000000000 --- a/src/test/ui/error-codes/E0490.base.stderr +++ /dev/null @@ -1,76 +0,0 @@ -error[E0490]: a value of type `&'b ()` is borrowed for too long - --> $DIR/E0490.rs:6:20 - | -LL | let x: &'a _ = &y; - | ^^ - | -note: the type is valid for the lifetime `'a` as defined here - --> $DIR/E0490.rs:5:6 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | ^^ -note: but the borrow lasts for the lifetime `'b` as defined here - --> $DIR/E0490.rs:5:10 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | ^^ - -error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements - --> $DIR/E0490.rs:6:20 - | -LL | let x: &'a _ = &y; - | ^^ - | -note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/E0490.rs:5:10 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | ^^ -note: ...so that the type `&'b ()` is not borrowed for too long - --> $DIR/E0490.rs:6:20 - | -LL | let x: &'a _ = &y; - | ^^ -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/E0490.rs:5:6 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/E0490.rs:6:20 - | -LL | let x: &'a _ = &y; - | ^^ - -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/E0490.rs:6:20 - | -LL | let x: &'a _ = &y; - | ^^ - | -note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/E0490.rs:5:10 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | ^^ -note: ...so that the expression is assignable - --> $DIR/E0490.rs:6:20 - | -LL | let x: &'a _ = &y; - | ^^ - = note: expected `&'a &()` - found `&'a &'b ()` -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/E0490.rs:5:6 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | ^^ -note: ...so that the reference type `&'a &()` does not outlive the data it points at - --> $DIR/E0490.rs:6:12 - | -LL | let x: &'a _ = &y; - | ^^^^^ - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/error-codes/E0490.nll.stderr b/src/test/ui/error-codes/E0490.nll.stderr deleted file mode 100644 index 80bf076e2bd..00000000000 --- a/src/test/ui/error-codes/E0490.nll.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/E0490.rs:6:12 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -LL | let x: &'a _ = &y; - | ^^^^^ type annotation requires that `'b` must outlive `'a` - | - = help: consider adding the following bound: `'b: 'a` - -error[E0597]: `y` does not live long enough - --> $DIR/E0490.rs:6:20 - | -LL | fn f<'a, 'b>(y: &'b ()) { - | -- lifetime `'a` defined here -LL | let x: &'a _ = &y; - | ----- ^^ borrowed value does not live long enough - | | - | type annotation requires that `y` is borrowed for `'a` -... -LL | } - | - `y` dropped here while still borrowed - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/error-codes/E0490.rs b/src/test/ui/error-codes/E0490.rs deleted file mode 100644 index 304548215dc..00000000000 --- a/src/test/ui/error-codes/E0490.rs +++ /dev/null @@ -1,14 +0,0 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - -fn f<'a, 'b>(y: &'b ()) { - let x: &'a _ = &y; - //[base]~^ E0490 - //[base]~| E0495 - //[base]~| E0495 - //[nll]~^^^^ lifetime may not live long enough - //[nll]~| E0597 -} - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-nll.rs b/src/test/ui/feature-gates/feature-gate-nll.rs deleted file mode 100644 index fd6c5b67ef6..00000000000 --- a/src/test/ui/feature-gates/feature-gate-nll.rs +++ /dev/null @@ -1,18 +0,0 @@ -// There isn't a great way to test feature(nll), since it just disables migrate -// mode and changes some error messages. - -// FIXME(Centril): This test is probably obsolete now and `nll` should become -// `accepted`. - -// Don't use compare-mode=nll, since that turns on NLL. -// ignore-compare-mode-nll -// ignore-compare-mode-polonius - -fn main() { - let mut x = (33, &0); - - let m = &mut x; - let p = &*x.1; - //~^ ERROR cannot borrow - m; -} diff --git a/src/test/ui/feature-gates/feature-gate-nll.stderr b/src/test/ui/feature-gates/feature-gate-nll.stderr deleted file mode 100644 index edfc22c32c9..00000000000 --- a/src/test/ui/feature-gates/feature-gate-nll.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0502]: cannot borrow `*x.1` as immutable because it is also borrowed as mutable - --> $DIR/feature-gate-nll.rs:15:13 - | -LL | let m = &mut x; - | ------ mutable borrow occurs here -LL | let p = &*x.1; - | ^^^^^ immutable borrow occurs here -LL | -LL | m; - | - mutable borrow later used here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr deleted file mode 100644 index 6f0ea1af057..00000000000 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/implied-bounds-unnorm-associated-type.rs:18:5 - | -LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { - | ------- ---------- - | | - | these two types are declared with different lifetimes... -LL | s - | ^ ...but data from `s` flows here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs index 30bd042009b..04b6f4dd84e 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // check-fail // See issue #91068. Types in the substs of an associated type can't be implied // to be WF, since they don't actually have to be constructed. @@ -16,8 +12,7 @@ impl Trait for T { fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { s - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr similarity index 88% rename from src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr rename to src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr index a7a91f3e685..8096f08385c 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/implied-bounds-unnorm-associated-type.rs:18:5 + --> $DIR/implied-bounds-unnorm-associated-type.rs:14:5 | LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/generator/auto-trait-regions.base.stderr b/src/test/ui/generator/auto-trait-regions.base.stderr deleted file mode 100644 index d44c8eb1b82..00000000000 --- a/src/test/ui/generator/auto-trait-regions.base.stderr +++ /dev/null @@ -1,38 +0,0 @@ -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:35:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`... - = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef` - -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:35:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`... - = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef` - -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:56:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`... - = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2` - -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:56:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`... - = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2` - -error: aborting due to 4 previous errors - diff --git a/src/test/ui/generator/auto-trait-regions.rs b/src/test/ui/generator/auto-trait-regions.rs index 98af4a39391..ea4b0d554cd 100644 --- a/src/test/ui/generator/auto-trait-regions.rs +++ b/src/test/ui/generator/auto-trait-regions.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![feature(generators)] #![feature(auto_traits)] #![feature(negative_impls)] @@ -34,7 +30,6 @@ fn main() { }; assert_foo(gen); //~^ ERROR implementation of `Foo` is not general enough - //[base]~^^ ERROR implementation of `Foo` is not general enough // Allow impls which matches any lifetime let x = &OnlyFooIfRef(No); @@ -48,12 +43,11 @@ fn main() { // Disallow impls which relates lifetimes in the generator interior let gen = || { let a = A(&mut true, &mut true, No); - //[nll]~^ temporary value dropped while borrowed - //[nll]~| temporary value dropped while borrowed + //~^ temporary value dropped while borrowed + //~| temporary value dropped while borrowed yield; assert_foo(a); }; assert_foo(gen); //~^ ERROR not general enough - //[base]~^^ ERROR not general enough } diff --git a/src/test/ui/generator/auto-trait-regions.nll.stderr b/src/test/ui/generator/auto-trait-regions.stderr similarity index 92% rename from src/test/ui/generator/auto-trait-regions.nll.stderr rename to src/test/ui/generator/auto-trait-regions.stderr index 25456881fa0..23324af6171 100644 --- a/src/test/ui/generator/auto-trait-regions.nll.stderr +++ b/src/test/ui/generator/auto-trait-regions.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:50:24 + --> $DIR/auto-trait-regions.rs:45:24 | LL | let a = A(&mut true, &mut true, No); | ^^^^ - temporary value is freed at the end of this statement @@ -12,7 +12,7 @@ LL | assert_foo(a); = note: consider using a `let` binding to create a longer lived value error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:50:35 + --> $DIR/auto-trait-regions.rs:45:35 | LL | let a = A(&mut true, &mut true, No); | ^^^^ - temporary value is freed at the end of this statement @@ -25,7 +25,7 @@ LL | assert_foo(a); = note: consider using a `let` binding to create a longer lived value error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:35:5 + --> $DIR/auto-trait-regions.rs:31:5 | LL | assert_foo(gen); | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -34,7 +34,7 @@ LL | assert_foo(gen); = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef` error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:56:5 + --> $DIR/auto-trait-regions.rs:51:5 | LL | assert_foo(gen); | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/src/test/ui/generator/generator-region-requirements.base.stderr b/src/test/ui/generator/generator-region-requirements.base.stderr deleted file mode 100644 index 89f6a81ad3b..00000000000 --- a/src/test/ui/generator/generator-region-requirements.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/generator-region-requirements.rs:12:9 - | -LL | fn dangle(x: &mut i32) -> &'static mut i32 { - | -------- this data with an anonymous lifetime `'_`... -... -LL | x - | ^ ...is used here... -... -LL | GeneratorState::Complete(c) => return c, - | - ...and is required to live as long as `'static` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/generator/generator-region-requirements.rs b/src/test/ui/generator/generator-region-requirements.rs index ec718b17460..7269a79ca3f 100644 --- a/src/test/ui/generator/generator-region-requirements.rs +++ b/src/test/ui/generator/generator-region-requirements.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![feature(generators, generator_trait)] use std::ops::{Generator, GeneratorState}; use std::pin::Pin; @@ -10,12 +6,11 @@ fn dangle(x: &mut i32) -> &'static mut i32 { let mut g = || { yield; x - //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] }; loop { match Pin::new(&mut g).resume(()) { GeneratorState::Complete(c) => return c, - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough GeneratorState::Yielded(_) => (), } } diff --git a/src/test/ui/generator/generator-region-requirements.nll.stderr b/src/test/ui/generator/generator-region-requirements.stderr similarity index 88% rename from src/test/ui/generator/generator-region-requirements.nll.stderr rename to src/test/ui/generator/generator-region-requirements.stderr index 9f54c6c9dc1..87f60467287 100644 --- a/src/test/ui/generator/generator-region-requirements.nll.stderr +++ b/src/test/ui/generator/generator-region-requirements.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/generator-region-requirements.rs:17:51 + --> $DIR/generator-region-requirements.rs:12:51 | LL | fn dangle(x: &mut i32) -> &'static mut i32 { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/generator/resume-arg-late-bound.base.stderr b/src/test/ui/generator/resume-arg-late-bound.base.stderr deleted file mode 100644 index 8521951d0c9..00000000000 --- a/src/test/ui/generator/resume-arg-late-bound.base.stderr +++ /dev/null @@ -1,49 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/resume-arg-late-bound.rs:19:5 - | -LL | test(gen); - | ^^^^ lifetime mismatch - | - = note: expected type `for<'a> Generator<&'a mut bool>` - found type `Generator<&mut bool>` -note: the required lifetime does not necessarily outlive the anonymous lifetime #1 defined here - --> $DIR/resume-arg-late-bound.rs:15:15 - | -LL | let gen = |arg: &mut bool| { - | _______________^ -LL | | yield (); -LL | | *arg = true; -LL | | }; - | |_____^ -note: the lifetime requirement is introduced here - --> $DIR/resume-arg-late-bound.rs:12:17 - | -LL | fn test(a: impl for<'a> Generator<&'a mut bool>) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/resume-arg-late-bound.rs:19:5 - | -LL | test(gen); - | ^^^^ lifetime mismatch - | - = note: expected type `for<'a> Generator<&'a mut bool>` - found type `Generator<&mut bool>` -note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements - --> $DIR/resume-arg-late-bound.rs:15:15 - | -LL | let gen = |arg: &mut bool| { - | _______________^ -LL | | yield (); -LL | | *arg = true; -LL | | }; - | |_____^ -note: the lifetime requirement is introduced here - --> $DIR/resume-arg-late-bound.rs:12:17 - | -LL | fn test(a: impl for<'a> Generator<&'a mut bool>) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/generator/resume-arg-late-bound.rs b/src/test/ui/generator/resume-arg-late-bound.rs index b973d8a300a..1c35ba80d2b 100644 --- a/src/test/ui/generator/resume-arg-late-bound.rs +++ b/src/test/ui/generator/resume-arg-late-bound.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - //! Tests that we cannot produce a generator that accepts a resume argument //! with any lifetime and then stores it across a `yield`. @@ -18,5 +14,4 @@ fn main() { }; test(gen); //~^ ERROR mismatched types - //[base]~^^ ERROR mismatched types } diff --git a/src/test/ui/generator/resume-arg-late-bound.nll.stderr b/src/test/ui/generator/resume-arg-late-bound.stderr similarity index 85% rename from src/test/ui/generator/resume-arg-late-bound.nll.stderr rename to src/test/ui/generator/resume-arg-late-bound.stderr index 868d1352f25..b5144c607a8 100644 --- a/src/test/ui/generator/resume-arg-late-bound.nll.stderr +++ b/src/test/ui/generator/resume-arg-late-bound.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/resume-arg-late-bound.rs:19:5 + --> $DIR/resume-arg-late-bound.rs:15:5 | LL | test(gen); | ^^^^^^^^^ one type is more general than the other @@ -7,7 +7,7 @@ LL | test(gen); = note: expected type `for<'a> Generator<&'a mut bool>` found type `Generator<&mut bool>` note: the lifetime requirement is introduced here - --> $DIR/resume-arg-late-bound.rs:12:17 + --> $DIR/resume-arg-late-bound.rs:8:17 | LL | fn test(a: impl for<'a> Generator<&'a mut bool>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr b/src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr deleted file mode 100644 index 81125a7d6f3..00000000000 --- a/src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-89352.rs:36:13 - | -LL | let a = A::reborrow::<'ai, 's>(self.a.clone()); - | ^ lifetime mismatch - | - = note: expected type `<>::Iter<'s> as Sized>` - found type `<>::Iter<'ai> as Sized>` -note: the lifetime `'s` as defined here... - --> $DIR/issue-89352.rs:35:13 - | -LL | fn iter<'s>(&'s self) -> Self::Iter<'s> { - | ^^ -note: ...does not necessarily outlive the lifetime `'ai` as defined here - --> $DIR/issue-89352.rs:30:6 - | -LL | impl<'ai, T: 'ai, A: GenAssoc> GenAssoc for Wrapper<'ai, T, A> - | ^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr index aa1e50014fe..3da7794b3d2 100644 --- a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr +++ b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/lending_iterator.rs:16:45 + --> $DIR/lending_iterator.rs:14:45 | LL | fn from_iter LendingIterator = A>>(iter: T) -> Self; | ------------------------------------------------------------------------ definition of `from_iter` from trait @@ -7,20 +7,6 @@ LL | fn from_iter LendingIterator = A>>(iter: T) -> Self LL | fn from_iter LendingIterator = A>>(mut iter: I) -> Self { | ^^^^^^^^^^^^ impl has extra requirement `I: 'x` -error[E0311]: the parameter type `Self` may not live long enough - --> $DIR/lending_iterator.rs:37:9 - | -LL | >::from_iter(self) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `Self: 'a`... - = note: ...so that the type `Self` will meet its required lifetime bounds... -note: ...that is required by this bound - --> $DIR/lending_iterator.rs:12:45 - | -LL | fn from_iter LendingIterator = A>>(iter: T) -> Self; - | ^^^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0276`. diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.rs b/src/test/ui/generic-associated-types/extended/lending_iterator.rs index 6048e6e87c0..ede16476636 100644 --- a/src/test/ui/generic-associated-types/extended/lending_iterator.rs +++ b/src/test/ui/generic-associated-types/extended/lending_iterator.rs @@ -1,5 +1,3 @@ -// FIXME(nll): this is experimental anyways, don't really care about the output -// ignore-compare-mode-nll // revisions: base extended //[base] check-fail //[extended] check-pass @@ -35,7 +33,6 @@ pub trait LendingIterator { Self: for<'q> LendingIterator = A>, { >::from_iter(self) - //[base]~^ the parameter type } } diff --git a/src/test/ui/generic-associated-types/bugs/issue-89352.rs b/src/test/ui/generic-associated-types/issue-89352.rs similarity index 58% rename from src/test/ui/generic-associated-types/bugs/issue-89352.rs rename to src/test/ui/generic-associated-types/issue-89352.rs index a9f0dd0a0b4..d9c656d5f58 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-89352.rs +++ b/src/test/ui/generic-associated-types/issue-89352.rs @@ -1,16 +1,4 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - -//[base] check-fail -//[nll] check-pass -// known-bug - -// This should pass, but we end up with `A::Iter<'ai>: Sized` for some specific -// `'ai`. We also know that `for<'at> A::Iter<'at>: Sized` from the definition, -// but we prefer param env candidates. We changed this to preference in #92191, -// but this led to unintended consequences (#93262). Suprisingly, this passes -// under NLL. So only a bug in migrate mode. +// check-pass #![feature(generic_associated_types)] diff --git a/src/test/ui/generic-associated-types/issue-91139.rs b/src/test/ui/generic-associated-types/issue-91139.rs index 78b2b63dadc..03dc8ef93fe 100644 --- a/src/test/ui/generic-associated-types/issue-91139.rs +++ b/src/test/ui/generic-associated-types/issue-91139.rs @@ -1,13 +1,4 @@ -// revisions: migrate nll -//[nll]compile-flags: -Z borrowck=mir - -// Since we are testing nll (and migration) explicitly as a separate -// revisions, don't worry about the --compare-mode=nll on this test. - -// ignore-compare-mode-nll - -//[nll] check-pass -//[migrate] check-fail +//check-pass #![feature(generic_associated_types)] @@ -25,7 +16,6 @@ impl Foo for () { fn foo() { let _: for<'a> fn(<() as Foo>::Type<'a>, &'a T) = |_, _| (); - //[migrate]~^ the parameter type `T` may not live long enough } pub fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-92096.rs b/src/test/ui/generic-associated-types/issue-92096.rs index 066132a5d98..bfe0fc15fd3 100644 --- a/src/test/ui/generic-associated-types/issue-92096.rs +++ b/src/test/ui/generic-associated-types/issue-92096.rs @@ -1,10 +1,6 @@ // edition:2018 -// [nll] check-pass -// revisions: migrate nll -// Explicitly testing nll with revision, so ignore compare-mode=nll -// ignore-compare-mode-nll +// check-pass -#![cfg_attr(nll, feature(nll))] #![feature(generic_associated_types)] use std::future::Future; @@ -18,8 +14,6 @@ trait Client { } fn call_connect(c: &'_ C) -> impl '_ + Future + Send -//[migrate]~^ ERROR the parameter -//[migrate]~| ERROR the parameter where C: Client + Send + Sync, { diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr deleted file mode 100644 index 341e2e05d1c..00000000000 --- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/projection-type-lifetime-mismatch.rs:21:7 - | -LL | fn f(x: &impl for<'a> X = &'a ()>) -> &'static () { - | ------------------------------- this data with an anonymous lifetime `'_`... -LL | x.m() - | - ^ - | | - | ...is used and required to live as long as `'static` here - -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/projection-type-lifetime-mismatch.rs:27:7 - | -LL | fn g X = &'a ()>>(x: &T) -> &'static () { - | -- this data with an anonymous lifetime `'_`... -LL | x.m() - | - ^ - | | - | ...is used and required to live as long as `'static` here - -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/projection-type-lifetime-mismatch.rs:33:7 - | -LL | fn h(x: &()) -> &'static () { - | --- this data with an anonymous lifetime `'_`... -LL | x.m() - | - ^ - | | - | ...is used and required to live as long as `'static` here - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs index 9f14c6f3dc0..a40c0c2c4c7 100644 --- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs +++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![feature(generic_associated_types)] pub trait X { @@ -19,20 +15,17 @@ impl X for () { fn f(x: &impl for<'a> X = &'a ()>) -> &'static () { x.m() - //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn g X = &'a ()>>(x: &T) -> &'static () { x.m() - //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn h(x: &()) -> &'static () { x.m() - //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr similarity index 89% rename from src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr rename to src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr index 00395af4889..4620aa34e84 100644 --- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr +++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/projection-type-lifetime-mismatch.rs:21:5 + --> $DIR/projection-type-lifetime-mismatch.rs:17:5 | LL | fn f(x: &impl for<'a> X = &'a ()>) -> &'static () { | - let's call the lifetime of this reference `'1` @@ -7,7 +7,7 @@ LL | x.m() | ^^^^^ returning this value requires that `'1` must outlive `'static` error: lifetime may not live long enough - --> $DIR/projection-type-lifetime-mismatch.rs:27:5 + --> $DIR/projection-type-lifetime-mismatch.rs:22:5 | LL | fn g X = &'a ()>>(x: &T) -> &'static () { | - let's call the lifetime of this reference `'1` @@ -15,7 +15,7 @@ LL | x.m() | ^^^^^ returning this value requires that `'1` must outlive `'static` error: lifetime may not live long enough - --> $DIR/projection-type-lifetime-mismatch.rs:33:5 + --> $DIR/projection-type-lifetime-mismatch.rs:27:5 | LL | fn h(x: &()) -> &'static () { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/generic-associated-types/trait-objects.base.stderr b/src/test/ui/generic-associated-types/trait-objects.base.stderr index eed12f56be2..1df76a21bf9 100644 --- a/src/test/ui/generic-associated-types/trait-objects.base.stderr +++ b/src/test/ui/generic-associated-types/trait-objects.base.stderr @@ -1,11 +1,11 @@ error[E0038]: the trait `StreamingIterator` cannot be made into an object - --> $DIR/trait-objects.rs:16:21 + --> $DIR/trait-objects.rs:14:21 | LL | fn min_size(x: &mut dyn for<'a> StreamingIterator = &'a i32>) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/trait-objects.rs:10:10 + --> $DIR/trait-objects.rs:8:10 | LL | trait StreamingIterator { | ----------------- this trait cannot be made into an object... diff --git a/src/test/ui/generic-associated-types/trait-objects.extended.stderr b/src/test/ui/generic-associated-types/trait-objects.extended.stderr index c7b072256ad..52d48d57859 100644 --- a/src/test/ui/generic-associated-types/trait-objects.extended.stderr +++ b/src/test/ui/generic-associated-types/trait-objects.extended.stderr @@ -1,12 +1,17 @@ -error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/trait-objects.rs:18:7 +error[E0521]: borrowed data escapes outside of function + --> $DIR/trait-objects.rs:16:5 | LL | fn min_size(x: &mut dyn for<'a> StreamingIterator = &'a i32>) -> usize { - | ------------------------------------------------------ help: add explicit lifetime `'a` to the type of `x`: `&'a mut (dyn StreamingIterator Item = &'a i32> + 'a)` + | - - let's call the lifetime of this reference `'1` + | | + | `x` is a reference that is only valid in the function body LL | LL | x.size_hint().0 - | ^^^^^^^^^ lifetime `'a` required + | ^^^^^^^^^^^^^ + | | + | `x` escapes the function body here + | argument requires that `'1` must outlive `'static` error: aborting due to previous error -For more information about this error, try `rustc --explain E0621`. +For more information about this error, try `rustc --explain E0521`. diff --git a/src/test/ui/generic-associated-types/trait-objects.rs b/src/test/ui/generic-associated-types/trait-objects.rs index d742d2051be..c1da1e0a326 100644 --- a/src/test/ui/generic-associated-types/trait-objects.rs +++ b/src/test/ui/generic-associated-types/trait-objects.rs @@ -1,5 +1,3 @@ -// FIXME(nll): this is experimental anyways, don't really care about the output -// ignore-compare-mode-nll // revisions: base extended #![feature(generic_associated_types)] @@ -16,7 +14,7 @@ trait StreamingIterator { fn min_size(x: &mut dyn for<'a> StreamingIterator = &'a i32>) -> usize { //[base]~^ the trait `StreamingIterator` cannot be made into an object x.size_hint().0 - //[extended]~^ explicit lifetime required + //[extended]~^ borrowed data escapes } fn main() {} diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr b/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr deleted file mode 100644 index ec576ee529a..00000000000 --- a/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0477]: the type `&'a V` does not fulfill the required lifetime - --> $DIR/issue-59311.rs:21:5 - | -LL | v.t(|| {}); - | ^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/issue-59311.rs:19:24 - | -LL | for<'a> &'a V: T + 'static, - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs index a63c5754f8f..3ad548450e5 100644 --- a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs +++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs @@ -6,10 +6,6 @@ // an error, but the regression test is here to ensure // that it does not ICE. See discussion on #74889 for details. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - pub trait T { fn t(&self, _: F) {} } @@ -19,9 +15,8 @@ where for<'a> &'a V: T + 'static, { v.t(|| {}); - //[base]~^ ERROR: `&'a V` does not fulfill the required lifetime - //[nll]~^^ ERROR: higher-ranked lifetime error - //[nll]~| ERROR: higher-ranked lifetime error + //~^ ERROR: higher-ranked lifetime error + //~| ERROR: higher-ranked lifetime error } fn main() {} diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr b/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr similarity index 69% rename from src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr rename to src/test/ui/higher-rank-trait-bounds/issue-59311.stderr index 7f98cefdf01..15e83ab5a34 100644 --- a/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr +++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr @@ -1,13 +1,13 @@ error: higher-ranked lifetime error - --> $DIR/issue-59311.rs:21:5 + --> $DIR/issue-59311.rs:17:5 | LL | v.t(|| {}); | ^^^^^^^^^^ | - = note: could not prove [closure@$DIR/issue-59311.rs:21:9: 21:14] well-formed + = note: could not prove [closure@$DIR/issue-59311.rs:17:9: 17:14] well-formed error: higher-ranked lifetime error - --> $DIR/issue-59311.rs:21:9 + --> $DIR/issue-59311.rs:17:9 | LL | v.t(|| {}); | ^^^^^ diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr deleted file mode 100644 index c24afdd418b..00000000000 --- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: implementation of `Parser` is not general enough - --> $DIR/issue-71955.rs:49:5 - | -LL | foo(bar, "string", |s| s.len() == 5); - | ^^^ implementation of `Parser` is not general enough - | - = note: `for<'a> fn(&'a str) -> (&'a str, &'a str) {bar}` must implement `Parser<'0>`, for any lifetime `'0`... - = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1` - -error: implementation of `Parser` is not general enough - --> $DIR/issue-71955.rs:53:5 - | -LL | foo(baz, "string", |s| s.0.len() == 5); - | ^^^ implementation of `Parser` is not general enough - | - = note: `for<'a> fn(&'a str) -> (&'a str, Wrapper<'a>) {baz}` must implement `Parser<'0>`, for any lifetime `'0`... - = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1` - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr index e6ffe38ee92..0f38f8e3283 100644 --- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr +++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr @@ -1,20 +1,79 @@ -error: implementation of `Parser` is not general enough +error[E0308]: mismatched types --> $DIR/issue-71955.rs:54:5 | LL | foo(bar, "string", |s| s.len() == 5); - | ^^^ implementation of `Parser` is not general enough + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other | - = note: `for<'a> fn(&'a str) -> (&'a str, &'a str) {bar}` must implement `Parser<'0>`, for any lifetime `'0`... - = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1` + = note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>` + found type `for<'r> FnOnce<(&'r &str,)>` +note: this closure does not fulfill the lifetime requirements + --> $DIR/issue-71955.rs:54:24 + | +LL | foo(bar, "string", |s| s.len() == 5); + | ^^^^^^^^^^^^^^^^ +note: the lifetime requirement is introduced here + --> $DIR/issue-71955.rs:34:9 + | +LL | F2: FnOnce(&::Output) -> bool + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: implementation of `Parser` is not general enough +error[E0308]: mismatched types + --> $DIR/issue-71955.rs:54:5 + | +LL | foo(bar, "string", |s| s.len() == 5); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other + | + = note: expected type `FnOnce<(&&str,)>` + found type `for<'r> FnOnce<(&'r &str,)>` +note: this closure does not fulfill the lifetime requirements + --> $DIR/issue-71955.rs:54:24 + | +LL | foo(bar, "string", |s| s.len() == 5); + | ^^^^^^^^^^^^^^^^ +note: the lifetime requirement is introduced here + --> $DIR/issue-71955.rs:34:44 + | +LL | F2: FnOnce(&::Output) -> bool + | ^^^^ + +error[E0308]: mismatched types --> $DIR/issue-71955.rs:58:5 | LL | foo(baz, "string", |s| s.0.len() == 5); - | ^^^ implementation of `Parser` is not general enough + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other | - = note: `for<'a> fn(&'a str) -> (&'a str, Wrapper<'a>) {baz}` must implement `Parser<'0>`, for any lifetime `'0`... - = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1` + = note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>` + found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>` +note: this closure does not fulfill the lifetime requirements + --> $DIR/issue-71955.rs:58:24 + | +LL | foo(baz, "string", |s| s.0.len() == 5); + | ^^^^^^^^^^^^^^^^^^ +note: the lifetime requirement is introduced here + --> $DIR/issue-71955.rs:34:9 + | +LL | F2: FnOnce(&::Output) -> bool + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors +error[E0308]: mismatched types + --> $DIR/issue-71955.rs:58:5 + | +LL | foo(baz, "string", |s| s.0.len() == 5); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other + | + = note: expected type `FnOnce<(&Wrapper<'_>,)>` + found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>` +note: this closure does not fulfill the lifetime requirements + --> $DIR/issue-71955.rs:58:24 + | +LL | foo(baz, "string", |s| s.0.len() == 5); + | ^^^^^^^^^^^^^^^^^^ +note: the lifetime requirement is introduced here + --> $DIR/issue-71955.rs:34:44 + | +LL | F2: FnOnce(&::Output) -> bool + | ^^^^ +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs index 8d283afd09d..1d90226a3f4 100644 --- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs +++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // check-fail #![feature(rustc_attrs)] @@ -47,11 +43,9 @@ fn main() { } foo(bar, "string", |s| s.len() == 5); - //[base]~^ ERROR implementation of `Parser` is not general enough - //[nll]~^^ ERROR mismatched types - //[nll]~| ERROR mismatched types + //~^ ERROR mismatched types + //~| ERROR mismatched types foo(baz, "string", |s| s.0.len() == 5); - //[base]~^ ERROR implementation of `Parser` is not general enough - //[nll]~^^ ERROR mismatched types - //[nll]~| ERROR mismatched types + //~^ ERROR mismatched types + //~| ERROR mismatched types } diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr similarity index 87% rename from src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr rename to src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr index 9d3cd4dee53..340371031e8 100644 --- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr +++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-71955.rs:49:5 + --> $DIR/issue-71955.rs:45:5 | LL | foo(bar, "string", |s| s.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other @@ -7,18 +7,18 @@ LL | foo(bar, "string", |s| s.len() == 5); = note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>` found type `for<'r> FnOnce<(&'r &str,)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-71955.rs:49:24 + --> $DIR/issue-71955.rs:45:24 | LL | foo(bar, "string", |s| s.len() == 5); | ^^^^^^^^^^^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/issue-71955.rs:29:9 + --> $DIR/issue-71955.rs:25:9 | LL | F2: FnOnce(&::Output) -> bool | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/issue-71955.rs:49:5 + --> $DIR/issue-71955.rs:45:5 | LL | foo(bar, "string", |s| s.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other @@ -26,18 +26,18 @@ LL | foo(bar, "string", |s| s.len() == 5); = note: expected type `FnOnce<(&&str,)>` found type `for<'r> FnOnce<(&'r &str,)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-71955.rs:49:24 + --> $DIR/issue-71955.rs:45:24 | LL | foo(bar, "string", |s| s.len() == 5); | ^^^^^^^^^^^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/issue-71955.rs:29:44 + --> $DIR/issue-71955.rs:25:44 | LL | F2: FnOnce(&::Output) -> bool | ^^^^ error[E0308]: mismatched types - --> $DIR/issue-71955.rs:53:5 + --> $DIR/issue-71955.rs:48:5 | LL | foo(baz, "string", |s| s.0.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other @@ -45,18 +45,18 @@ LL | foo(baz, "string", |s| s.0.len() == 5); = note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>` found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-71955.rs:53:24 + --> $DIR/issue-71955.rs:48:24 | LL | foo(baz, "string", |s| s.0.len() == 5); | ^^^^^^^^^^^^^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/issue-71955.rs:29:9 + --> $DIR/issue-71955.rs:25:9 | LL | F2: FnOnce(&::Output) -> bool | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/issue-71955.rs:53:5 + --> $DIR/issue-71955.rs:48:5 | LL | foo(baz, "string", |s| s.0.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other @@ -64,12 +64,12 @@ LL | foo(baz, "string", |s| s.0.len() == 5); = note: expected type `FnOnce<(&Wrapper<'_>,)>` found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-71955.rs:53:24 + --> $DIR/issue-71955.rs:48:24 | LL | foo(baz, "string", |s| s.0.len() == 5); | ^^^^^^^^^^^^^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/issue-71955.rs:29:44 + --> $DIR/issue-71955.rs:25:44 | LL | F2: FnOnce(&::Output) -> bool | ^^^^ diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr deleted file mode 100644 index 3edb1064e3e..00000000000 --- a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_b_ret_a_vs_bound_a_ret_a.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/hr-subtype-nll.rs:60:13 - | -LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other -... -LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32, -LL | | for<'a> fn(&'a u32, &'a u32) -> &'a u32) } - | |_____________________________________________- in this macro invocation - | - = note: expected enum `Option fn(&'a u32, &'b u32) -> &'a u32>` - found enum `Option fn(&'a u32, &'a u32) -> &'a u32>` - = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr deleted file mode 100644 index f02eeea90bf..00000000000 --- a/src/test/ui/hr-subtype/hr-subtype-nll.bound_a_vs_free_x.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/hr-subtype-nll.rs:60:13 - | -LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other -... -LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32), -LL | | fn(&'x u32)) } - | |______________- in this macro invocation - | - = note: expected enum `Option fn(&'a u32)>` - found enum `Option` - = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr deleted file mode 100644 index bfc9793fe5d..00000000000 --- a/src/test/ui/hr-subtype/hr-subtype-nll.bound_inv_a_b_vs_bound_inv_a.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/hr-subtype-nll.rs:60:13 - | -LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other -... -LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), -LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } - | |__________________________________- in this macro invocation - | - = note: expected enum `Option fn(Inv<'a>, Inv<'b>)>` - found enum `Option fn(Inv<'a>, Inv<'a>)>` - = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0308]: mismatched types - --> $DIR/hr-subtype-nll.rs:60:13 - | -LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other -... -LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), -LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } - | |__________________________________- in this macro invocation - | - = note: expected enum `Option fn(Inv<'a>, Inv<'b>)>` - found enum `Option fn(Inv<'a>, Inv<'a>)>` - = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr deleted file mode 100644 index ee0dc877fd1..00000000000 --- a/src/test/ui/hr-subtype/hr-subtype-nll.free_inv_x_vs_free_inv_y.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/hr-subtype-nll.rs:54:13 - | -LL | fn subtype<'x, 'y: 'x, 'z: 'y>() { - | -- -- lifetime `'y` defined here - | | - | lifetime `'x` defined here -LL | gimme::<$t2>(None::<$t1>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y` -... -LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), -LL | | fn(Inv<'y>)) } - | |______________- in this macro invocation - | - = help: consider adding the following bound: `'x: 'y` - = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant - = note: the struct `Inv<'a>` is invariant over the parameter `'a` - = help: see for more information about variance - = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: lifetime may not live long enough - --> $DIR/hr-subtype-nll.rs:60:13 - | -LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { - | -- -- lifetime `'y` defined here - | | - | lifetime `'x` defined here -LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y` -... -LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), -LL | | fn(Inv<'y>)) } - | |______________- in this macro invocation - | - = help: consider adding the following bound: `'x: 'y` - = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant - = note: the struct `Inv<'a>` is invariant over the parameter `'a` - = help: see for more information about variance - = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr b/src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr deleted file mode 100644 index 75904d6df99..00000000000 --- a/src/test/ui/hr-subtype/hr-subtype-nll.free_x_vs_free_y.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/hr-subtype-nll.rs:60:13 - | -LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { - | -- -- lifetime `'y` defined here - | | - | lifetime `'x` defined here -LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y` -... -LL | / check! { free_x_vs_free_y: (fn(&'x u32), -LL | | fn(&'y u32)) } - | |______________- in this macro invocation - | - = help: consider adding the following bound: `'x: 'y` - = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - diff --git a/src/test/ui/hr-subtype/hr-subtype-nll.rs b/src/test/ui/hr-subtype/hr-subtype-nll.rs deleted file mode 100644 index 7fc1692b350..00000000000 --- a/src/test/ui/hr-subtype/hr-subtype-nll.rs +++ /dev/null @@ -1,117 +0,0 @@ -// Targeted tests for the higher-ranked subtyping code. - -#![allow(dead_code)] - -// revisions: bound_a_vs_bound_a -// revisions: bound_a_vs_bound_b -// revisions: bound_inv_a_vs_bound_inv_b -// revisions: bound_co_a_vs_bound_co_b -// revisions: bound_a_vs_free_x -// revisions: free_x_vs_free_x -// revisions: free_x_vs_free_y -// revisions: free_inv_x_vs_free_inv_y -// revisions: bound_a_b_vs_bound_a -// revisions: bound_co_a_b_vs_bound_co_a -// revisions: bound_contra_a_contra_b_ret_co_a -// revisions: bound_co_a_co_b_ret_contra_a -// revisions: bound_inv_a_b_vs_bound_inv_a -// revisions: bound_a_b_ret_a_vs_bound_a_ret_a - -//[bound_a_vs_bound_a] check-pass -//[bound_a_vs_bound_b] check-pass -//[bound_inv_a_vs_bound_inv_b] check-pass -//[bound_co_a_vs_bound_co_b] check-pass -//[free_x_vs_free_x] check-pass -//[bound_co_a_b_vs_bound_co_a] check-pass -//[bound_co_a_co_b_ret_contra_a] check-pass -//[bound_a_b_vs_bound_a] check-pass -//[bound_contra_a_contra_b_ret_co_a] check-pass - -// compile-flags: -Z borrowck=mir -// ignore-compare-mode-nll -// FIXME(nll): When stabilizing, this test should be replace with `hr-subtype.rs` -// The two would normally be just revisions, but this test uses revisions heavily, so splitting into -// a separate test is just easier. - -fn gimme(_: Option) {} - -struct Inv<'a> { - x: *mut &'a u32, -} - -struct Co<'a> { - x: fn(&'a u32), -} - -struct Contra<'a> { - x: &'a u32, -} - -macro_rules! check { - ($rev:ident: ($t1:ty, $t2:ty)) => { - #[cfg($rev)] - fn subtype<'x, 'y: 'x, 'z: 'y>() { - gimme::<$t2>(None::<$t1>); - //[free_inv_x_vs_free_inv_y]~^ ERROR - } - - #[cfg($rev)] - fn supertype<'x, 'y: 'x, 'z: 'y>() { - gimme::<$t1>(None::<$t2>); - //[bound_a_vs_free_x]~^ ERROR - //[free_x_vs_free_y]~^^ ERROR - //[bound_inv_a_b_vs_bound_inv_a]~^^^ ERROR - //[bound_inv_a_b_vs_bound_inv_a]~| ERROR - //[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^^ ERROR - //[free_inv_x_vs_free_inv_y]~^^^^^^ ERROR - } - }; -} - -// If both have bound regions, they are equivalent, regardless of -// variant. -check! { bound_a_vs_bound_a: (for<'a> fn(&'a u32), -for<'a> fn(&'a u32)) } -check! { bound_a_vs_bound_b: (for<'a> fn(&'a u32), -for<'b> fn(&'b u32)) } -check! { bound_inv_a_vs_bound_inv_b: (for<'a> fn(Inv<'a>), -for<'b> fn(Inv<'b>)) } -check! { bound_co_a_vs_bound_co_b: (for<'a> fn(Co<'a>), -for<'b> fn(Co<'b>)) } - -// Bound is a subtype of free. -check! { bound_a_vs_free_x: (for<'a> fn(&'a u32), -fn(&'x u32)) } - -// Two free regions are relatable if subtyping holds. -check! { free_x_vs_free_x: (fn(&'x u32), -fn(&'x u32)) } -check! { free_x_vs_free_y: (fn(&'x u32), -fn(&'y u32)) } -check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), -fn(Inv<'y>)) } - -// Somewhat surprisingly, a fn taking two distinct bound lifetimes and -// a fn taking one bound lifetime can be interchangeable, but only if -// we are co- or contra-variant with respect to both lifetimes. -// -// The reason is: -// - if we are covariant, then 'a and 'b can be set to the call-site -// intersection; -// - if we are contravariant, then 'a can be inferred to 'static. -check! { bound_a_b_vs_bound_a: (for<'a,'b> fn(&'a u32, &'b u32), -for<'a> fn(&'a u32, &'a u32)) } -check! { bound_co_a_b_vs_bound_co_a: (for<'a,'b> fn(Co<'a>, Co<'b>), -for<'a> fn(Co<'a>, Co<'a>)) } -check! { bound_contra_a_contra_b_ret_co_a: (for<'a,'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>, -for<'a> fn(Contra<'a>, Contra<'a>) -> Co<'a>) } -check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> Contra<'a>, -for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>) } - -// If we make those lifetimes invariant, then the two types are not interchangeable. -check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), -for<'a> fn(Inv<'a>, Inv<'a>)) } -check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32, -for<'a> fn(&'a u32, &'a u32) -> &'a u32) } - -fn main() {} diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr index 13e9fa8a894..b7264c7e933 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types - --> $DIR/hr-subtype.rs:59:26 + --> $DIR/hr-subtype.rs:54:13 | LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^ one type is more general than the other + | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other ... LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32, LL | | for<'a> fn(&'a u32, &'a u32) -> &'a u32) } diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr index b66ff5a392e..2355979b0f9 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr @@ -1,15 +1,15 @@ error[E0308]: mismatched types - --> $DIR/hr-subtype.rs:59:26 + --> $DIR/hr-subtype.rs:54:13 | LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^ one type is more general than the other + | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other ... LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32), LL | | fn(&'x u32)) } | |______________- in this macro invocation | = note: expected enum `Option fn(&'a u32)>` - found enum `Option` + found enum `Option` = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr index fa715fd354e..a73c03feb87 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types - --> $DIR/hr-subtype.rs:59:26 + --> $DIR/hr-subtype.rs:54:13 | LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^ one type is more general than the other + | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other ... LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } @@ -12,6 +12,20 @@ LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } found enum `Option fn(Inv<'a>, Inv<'a>)>` = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:54:13 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other +... +LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), +LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } + | |__________________________________- in this macro invocation + | + = note: expected enum `Option fn(Inv<'a>, Inv<'b>)>` + found enum `Option fn(Inv<'a>, Inv<'a>)>` + = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr index 377689603aa..31d36d7168b 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr @@ -1,67 +1,42 @@ -error[E0308]: mismatched types - --> $DIR/hr-subtype.rs:53:26 +error: lifetime may not live long enough + --> $DIR/hr-subtype.rs:48:13 | +LL | fn subtype<'x, 'y: 'x, 'z: 'y>() { + | -- -- lifetime `'y` defined here + | | + | lifetime `'x` defined here LL | gimme::<$t2>(None::<$t1>); - | ^^^^^^^^^^^ lifetime mismatch + | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y` ... LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |______________- in this macro invocation | - = note: expected enum `Option)>` - found enum `Option)>` -note: the lifetime `'x` as defined here... - --> $DIR/hr-subtype.rs:52:20 - | -LL | fn subtype<'x, 'y: 'x, 'z: 'y>() { - | ^^ -... -LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), -LL | | fn(Inv<'y>)) } - | |______________- in this macro invocation -note: ...does not necessarily outlive the lifetime `'y` as defined here - --> $DIR/hr-subtype.rs:52:24 - | -LL | fn subtype<'x, 'y: 'x, 'z: 'y>() { - | ^^ -... -LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), -LL | | fn(Inv<'y>)) } - | |______________- in this macro invocation + = help: consider adding the following bound: `'x: 'y` + = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant + = note: the struct `Inv<'a>` is invariant over the parameter `'a` + = help: see for more information about variance = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0308]: mismatched types - --> $DIR/hr-subtype.rs:59:26 +error: lifetime may not live long enough + --> $DIR/hr-subtype.rs:54:13 | +LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { + | -- -- lifetime `'y` defined here + | | + | lifetime `'x` defined here LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^ lifetime mismatch + | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y` ... LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |______________- in this macro invocation | - = note: expected enum `Option)>` - found enum `Option)>` -note: the lifetime `'x` as defined here... - --> $DIR/hr-subtype.rs:58:22 - | -LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { - | ^^ -... -LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), -LL | | fn(Inv<'y>)) } - | |______________- in this macro invocation -note: ...does not necessarily outlive the lifetime `'y` as defined here - --> $DIR/hr-subtype.rs:58:26 - | -LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { - | ^^ -... -LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), -LL | | fn(Inv<'y>)) } - | |______________- in this macro invocation + = help: consider adding the following bound: `'x: 'y` + = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant + = note: the struct `Inv<'a>` is invariant over the parameter `'a` + = help: see for more information about variance = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr index 9e5eb972f47..269cde54c7e 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr @@ -1,35 +1,19 @@ -error[E0308]: mismatched types - --> $DIR/hr-subtype.rs:59:26 +error: lifetime may not live long enough + --> $DIR/hr-subtype.rs:54:13 | +LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { + | -- -- lifetime `'y` defined here + | | + | lifetime `'x` defined here LL | gimme::<$t1>(None::<$t2>); - | ^^^^^^^^^^^ lifetime mismatch + | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y` ... LL | / check! { free_x_vs_free_y: (fn(&'x u32), LL | | fn(&'y u32)) } | |______________- in this macro invocation | - = note: expected enum `Option` - found enum `Option` -note: the lifetime `'x` as defined here... - --> $DIR/hr-subtype.rs:58:22 - | -LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { - | ^^ -... -LL | / check! { free_x_vs_free_y: (fn(&'x u32), -LL | | fn(&'y u32)) } - | |______________- in this macro invocation -note: ...does not necessarily outlive the lifetime `'y` as defined here - --> $DIR/hr-subtype.rs:58:26 - | -LL | fn supertype<'x, 'y: 'x, 'z: 'y>() { - | ^^ -... -LL | / check! { free_x_vs_free_y: (fn(&'x u32), -LL | | fn(&'y u32)) } - | |______________- in this macro invocation + = help: consider adding the following bound: `'x: 'y` = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/hr-subtype/hr-subtype.rs b/src/test/ui/hr-subtype/hr-subtype.rs index 33929cdb868..c770e0de85c 100644 --- a/src/test/ui/hr-subtype/hr-subtype.rs +++ b/src/test/ui/hr-subtype/hr-subtype.rs @@ -27,11 +27,6 @@ //[bound_a_b_vs_bound_a] check-pass //[bound_contra_a_contra_b_ret_co_a] check-pass -// ignore-compare-mode-nll -// FIXME(nll): When stabilizing, this test should be replaced with `hr-subtype-nll.rs` -// The two would normally be just revisions, but this test uses revisions heavily, so splitting into -// a separate test is just easier. - fn gimme(_: Option) {} struct Inv<'a> { @@ -60,8 +55,9 @@ macro_rules! check { //[bound_a_vs_free_x]~^ ERROR //[free_x_vs_free_y]~^^ ERROR //[bound_inv_a_b_vs_bound_inv_a]~^^^ ERROR - //[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^ ERROR - //[free_inv_x_vs_free_inv_y]~^^^^^ ERROR + //[bound_inv_a_b_vs_bound_inv_a]~| ERROR + //[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^^ ERROR + //[free_inv_x_vs_free_inv_y]~^^^^^^ ERROR } }; } diff --git a/src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr b/src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr deleted file mode 100644 index c6cb77d8d8d..00000000000 --- a/src/test/ui/hr-subtype/placeholder-pattern-fail.base.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/placeholder-pattern-fail.rs:13:47 - | -LL | let _: for<'a, 'b> fn(Inv<'a>, Inv<'b>) = sub; - | ^^^ one type is more general than the other - | - = note: expected fn pointer `for<'a, 'b> fn(Inv<'a>, Inv<'b>)` - found fn pointer `for<'a> fn(Inv<'a>, Inv<'a>)` - -error[E0308]: mismatched types - --> $DIR/placeholder-pattern-fail.rs:18:31 - | -LL | let _x: (&'static i32,) = x; - | ^ lifetime mismatch - | - = note: expected tuple `(&'static i32,)` - found tuple `(&'c i32,)` -note: the lifetime `'c` as defined here... - --> $DIR/placeholder-pattern-fail.rs:17:12 - | -LL | fn simple1<'c>(x: (&'c i32,)) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/placeholder-pattern-fail.rs:23:30 - | -LL | let _: (&'static i32,) = x; - | ^ lifetime mismatch - | - = note: expected tuple `(&'static i32,)` - found tuple `(&'c i32,)` -note: the lifetime `'c` as defined here... - --> $DIR/placeholder-pattern-fail.rs:22:12 - | -LL | fn simple2<'c>(x: (&'c i32,)) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/hr-subtype/placeholder-pattern-fail.rs b/src/test/ui/hr-subtype/placeholder-pattern-fail.rs index ac276a88982..bd4533e0433 100644 --- a/src/test/ui/hr-subtype/placeholder-pattern-fail.rs +++ b/src/test/ui/hr-subtype/placeholder-pattern-fail.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Check that incorrect higher ranked subtyping // causes an error. struct Inv<'a>(fn(&'a ()) -> &'a ()); @@ -16,12 +12,10 @@ fn hr_subtype<'c>(f: for<'a, 'b> fn(Inv<'a>, Inv<'a>)) { fn simple1<'c>(x: (&'c i32,)) { let _x: (&'static i32,) = x; - //[base]~^ ERROR mismatched types } fn simple2<'c>(x: (&'c i32,)) { let _: (&'static i32,) = x; - //[base]~^ ERROR mismatched types } fn main() { diff --git a/src/test/ui/hr-subtype/placeholder-pattern-fail.nll.stderr b/src/test/ui/hr-subtype/placeholder-pattern-fail.stderr similarity index 90% rename from src/test/ui/hr-subtype/placeholder-pattern-fail.nll.stderr rename to src/test/ui/hr-subtype/placeholder-pattern-fail.stderr index a1f713d8afb..73b0a317364 100644 --- a/src/test/ui/hr-subtype/placeholder-pattern-fail.nll.stderr +++ b/src/test/ui/hr-subtype/placeholder-pattern-fail.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/placeholder-pattern-fail.rs:13:47 + --> $DIR/placeholder-pattern-fail.rs:9:47 | LL | let _: for<'a, 'b> fn(Inv<'a>, Inv<'b>) = sub; | ^^^ one type is more general than the other diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.base.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.base.stderr deleted file mode 100644 index e55e56f916b..00000000000 --- a/src/test/ui/hrtb/hrtb-conflate-regions.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `Foo` is not general enough - --> $DIR/hrtb-conflate-regions.rs:31:10 - | -LL | fn b() { want_foo2::(); } - | ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`... - = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2` - -error: aborting due to previous error - diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.rs b/src/test/ui/hrtb/hrtb-conflate-regions.rs index 11285d07575..e83686404a3 100644 --- a/src/test/ui/hrtb/hrtb-conflate-regions.rs +++ b/src/test/ui/hrtb/hrtb-conflate-regions.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test that an impl with only one bound region `'a` cannot be used to // satisfy a constraint where there are two bound regions. @@ -29,8 +25,7 @@ impl<'a> Foo<(&'a isize, &'a isize)> for SomeStruct fn a() { want_foo1::(); } // OK -- foo wants just one region fn b() { want_foo2::(); } -//[base]~^ ERROR -//[nll]~^^ ERROR implementation of -//[nll]~| ERROR implementation of +//~^ ERROR implementation of +//~| ERROR implementation of fn main() { } diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.stderr similarity index 91% rename from src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr rename to src/test/ui/hrtb/hrtb-conflate-regions.stderr index 61b549b9cd7..46f5308dd87 100644 --- a/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr +++ b/src/test/ui/hrtb/hrtb-conflate-regions.stderr @@ -1,5 +1,5 @@ error: implementation of `Foo` is not general enough - --> $DIR/hrtb-conflate-regions.rs:31:10 + --> $DIR/hrtb-conflate-regions.rs:27:10 | LL | fn b() { want_foo2::(); } | ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -8,7 +8,7 @@ LL | fn b() { want_foo2::(); } = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2` error: implementation of `Foo` is not general enough - --> $DIR/hrtb-conflate-regions.rs:31:10 + --> $DIR/hrtb-conflate-regions.rs:27:10 | LL | fn b() { want_foo2::(); } | ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr deleted file mode 100644 index 006b6756b1e..00000000000 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `Trait` is not general enough - --> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5 - | -LL | foo::<()>(); - | ^^^^^^^^^ implementation of `Trait` is not general enough - | - = note: `()` must implement `Trait fn(&'b u32)>` - = note: ...but it actually implements `Trait`, for some specific lifetime `'0` - -error: aborting due to previous error - diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs index 4b33dcb2cab..921061916fc 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test a case where variance and higher-ranked types interact in surprising ways. // // In particular, we test this pattern in trait solving, where it is not connected diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr similarity index 85% rename from src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr rename to src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr index 23b50728264..364b613fc77 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr @@ -1,5 +1,5 @@ error: implementation of `Trait` is not general enough - --> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5 + --> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5 | LL | foo::<()>(); | ^^^^^^^^^^^ implementation of `Trait` is not general enough diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr deleted file mode 100644 index 05575b01834..00000000000 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `Trait` is not general enough - --> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5 - | -LL | foo::<()>(); - | ^^^^^^^^^ implementation of `Trait` is not general enough - | - = note: `()` must implement `Trait fn(Cell<&'b u32>)>` - = note: ...but it actually implements `Trait)>`, for some specific lifetime `'0` - -error: aborting due to previous error - diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs index c779bc3f46c..9b9e4496a87 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test an `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile! // // In particular, we test this pattern in trait solving, where it is not connected diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr similarity index 87% rename from src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr rename to src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr index 58d59f60379..cb2ce8a4116 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr @@ -1,5 +1,5 @@ error: implementation of `Trait` is not general enough - --> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5 + --> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5 | LL | foo::<()>(); | ^^^^^^^^^^^ implementation of `Trait` is not general enough diff --git a/src/test/ui/hrtb/hrtb-just-for-static.base.stderr b/src/test/ui/hrtb/hrtb-just-for-static.base.stderr deleted file mode 100644 index 6e20b100664..00000000000 --- a/src/test/ui/hrtb/hrtb-just-for-static.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: implementation of `Foo` is not general enough - --> $DIR/hrtb-just-for-static.rs:28:5 - | -LL | want_hrtb::() - | ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `StaticInt` must implement `Foo<&'0 isize>`, for any lifetime `'0`... - = note: ...but it actually implements `Foo<&'static isize>` - -error: implementation of `Foo` is not general enough - --> $DIR/hrtb-just-for-static.rs:34:5 - | -LL | want_hrtb::<&'a u32>() - | ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo<&'0 isize>` would have to be implemented for the type `&'a u32`, for any lifetime `'0`... - = note: ...but `Foo<&'1 isize>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1` - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/hrtb/hrtb-just-for-static.rs b/src/test/ui/hrtb/hrtb-just-for-static.rs index dc70609c168..ffafdce2a6c 100644 --- a/src/test/ui/hrtb/hrtb-just-for-static.rs +++ b/src/test/ui/hrtb/hrtb-just-for-static.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test a case where you have an impl of `Foo` for all `X` that // is being applied to `for<'a> Foo<&'a mut X>`. Issue #19730. @@ -32,9 +28,8 @@ fn give_static() { impl<'a> Foo<&'a isize> for &'a u32 { } fn give_some<'a>() { want_hrtb::<&'a u32>() - //[base]~^ ERROR - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR implementation of `Foo` is not general enough + //~^ ERROR lifetime may not live long enough + //~| ERROR implementation of `Foo` is not general enough } fn main() { } diff --git a/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr b/src/test/ui/hrtb/hrtb-just-for-static.stderr similarity index 89% rename from src/test/ui/hrtb/hrtb-just-for-static.nll.stderr rename to src/test/ui/hrtb/hrtb-just-for-static.stderr index 090bd9f68ad..a5770431eaf 100644 --- a/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr +++ b/src/test/ui/hrtb/hrtb-just-for-static.stderr @@ -1,5 +1,5 @@ error: implementation of `Foo` is not general enough - --> $DIR/hrtb-just-for-static.rs:28:5 + --> $DIR/hrtb-just-for-static.rs:24:5 | LL | want_hrtb::() | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -8,7 +8,7 @@ LL | want_hrtb::() = note: ...but it actually implements `Foo<&'static isize>` error: lifetime may not live long enough - --> $DIR/hrtb-just-for-static.rs:34:5 + --> $DIR/hrtb-just-for-static.rs:30:5 | LL | fn give_some<'a>() { | -- lifetime `'a` defined here @@ -16,7 +16,7 @@ LL | want_hrtb::<&'a u32>() | ^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: implementation of `Foo` is not general enough - --> $DIR/hrtb-just-for-static.rs:34:5 + --> $DIR/hrtb-just-for-static.rs:30:5 | LL | want_hrtb::<&'a u32>() | ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr deleted file mode 100644 index 678a1137cd6..00000000000 --- a/src/test/ui/hrtb/hrtb-perfect-forwarding.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: implementation of `Bar` is not general enough - --> $DIR/hrtb-perfect-forwarding.rs:47:5 - | -LL | foo_hrtb_bar_not(&mut t); - | ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough - | - = note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`... - = note: ...but it actually implements `Bar<&'b isize>` - -error: implementation of `Bar` is not general enough - --> $DIR/hrtb-perfect-forwarding.rs:47:5 - | -LL | foo_hrtb_bar_not(&mut t); - | ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough - | - = note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`... - = note: ...but it actually implements `Bar<&'b isize>` - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.rs b/src/test/ui/hrtb/hrtb-perfect-forwarding.rs index 2db9f661cf4..d45fa183c0c 100644 --- a/src/test/ui/hrtb/hrtb-perfect-forwarding.rs +++ b/src/test/ui/hrtb/hrtb-perfect-forwarding.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test a case where you have an impl of `Foo` for all `X` that // is being applied to `for<'a> Foo<&'a mut X>`. Issue #19730. @@ -17,7 +13,7 @@ impl<'a, X, F> Foo for &'a mut F where F: Foo + Bar {} impl<'a, X, F> Bar for &'a mut F where F: Bar {} -fn no_hrtb<'b, T>(mut t: T) //[nll]~ WARN function cannot return +fn no_hrtb<'b, T>(mut t: T) //~ WARN function cannot return where T: Bar<&'b isize>, { @@ -26,7 +22,7 @@ where no_hrtb(&mut t); } -fn bar_hrtb(mut t: T) //[nll]~ WARN function cannot return +fn bar_hrtb(mut t: T) //~ WARN function cannot return where T: for<'b> Bar<&'b isize>, { @@ -36,7 +32,7 @@ where bar_hrtb(&mut t); } -fn foo_hrtb_bar_not<'b, T>(mut t: T) //[nll]~ WARN function cannot return +fn foo_hrtb_bar_not<'b, T>(mut t: T) //~ WARN function cannot return where T: for<'a> Foo<&'a isize> + Bar<&'b isize>, { @@ -46,11 +42,10 @@ where // clause only specifies `T : Bar<&'b isize>`. foo_hrtb_bar_not(&mut t); //~^ ERROR implementation of `Bar` is not general enough - //[base]~^^ ERROR implementation of `Bar` is not general enough - //[nll]~^^^ ERROR lifetime may not live long enough + //~^^ ERROR lifetime may not live long enough } -fn foo_hrtb_bar_hrtb(mut t: T) //[nll]~ WARN function cannot return +fn foo_hrtb_bar_hrtb(mut t: T) //~ WARN function cannot return where T: for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>, { diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr similarity index 89% rename from src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr rename to src/test/ui/hrtb/hrtb-perfect-forwarding.stderr index 3643ce62d40..68da46d46bd 100644 --- a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr +++ b/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr @@ -1,5 +1,5 @@ warning: function cannot return without recursing - --> $DIR/hrtb-perfect-forwarding.rs:20:1 + --> $DIR/hrtb-perfect-forwarding.rs:16:1 | LL | / fn no_hrtb<'b, T>(mut t: T) LL | | where @@ -15,7 +15,7 @@ LL | | } = help: a `loop` may express intention better if this is on purpose warning: function cannot return without recursing - --> $DIR/hrtb-perfect-forwarding.rs:29:1 + --> $DIR/hrtb-perfect-forwarding.rs:25:1 | LL | / fn bar_hrtb(mut t: T) LL | | where @@ -30,7 +30,7 @@ LL | | } = help: a `loop` may express intention better if this is on purpose warning: function cannot return without recursing - --> $DIR/hrtb-perfect-forwarding.rs:39:1 + --> $DIR/hrtb-perfect-forwarding.rs:35:1 | LL | / fn foo_hrtb_bar_not<'b, T>(mut t: T) LL | | where @@ -39,7 +39,7 @@ LL | | { ... | LL | | foo_hrtb_bar_not(&mut t); | | ------------------------ recursive call site -... | +LL | | LL | | LL | | } | |_^ cannot return without recursing @@ -47,7 +47,7 @@ LL | | } = help: a `loop` may express intention better if this is on purpose error: lifetime may not live long enough - --> $DIR/hrtb-perfect-forwarding.rs:47:5 + --> $DIR/hrtb-perfect-forwarding.rs:43:5 | LL | fn foo_hrtb_bar_not<'b, T>(mut t: T) | -- lifetime `'b` defined here @@ -56,7 +56,7 @@ LL | foo_hrtb_bar_not(&mut t); | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static` error: implementation of `Bar` is not general enough - --> $DIR/hrtb-perfect-forwarding.rs:47:5 + --> $DIR/hrtb-perfect-forwarding.rs:43:5 | LL | foo_hrtb_bar_not(&mut t); | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough @@ -65,7 +65,7 @@ LL | foo_hrtb_bar_not(&mut t); = note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1` warning: function cannot return without recursing - --> $DIR/hrtb-perfect-forwarding.rs:53:1 + --> $DIR/hrtb-perfect-forwarding.rs:48:1 | LL | / fn foo_hrtb_bar_hrtb(mut t: T) LL | | where diff --git a/src/test/ui/hrtb/issue-30786.nll.stderr b/src/test/ui/hrtb/issue-30786.nll.stderr deleted file mode 100644 index dba3911d99c..00000000000 --- a/src/test/ui/hrtb/issue-30786.nll.stderr +++ /dev/null @@ -1,53 +0,0 @@ -error[E0599]: the method `filterx` exists for struct `Map`, but its trait bounds were not satisfied - --> $DIR/issue-30786.rs:122:22 - | -LL | pub struct Map { - | -------------------- - | | - | method `filterx` not found for this - | doesn't satisfy `_: StreamExt` -... -LL | let filter = map.filterx(|x: &_| true); - | ^^^^^^^ method cannot be called on `Map` due to unsatisfied trait bounds - | -note: the following trait bounds were not satisfied: - `&'a mut &Map: Stream` - `&'a mut &mut Map: Stream` - `&'a mut Map: Stream` - --> $DIR/issue-30786.rs:100:50 - | -LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} - | --------- - ^^^^^^ unsatisfied trait bound introduced here -help: one of the expressions' fields has a method of the same name - | -LL | let filter = map.stream.filterx(|x: &_| true); - | +++++++ - -error[E0599]: the method `countx` exists for struct `Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>`, but its trait bounds were not satisfied - --> $DIR/issue-30786.rs:134:24 - | -LL | pub struct Filter { - | ----------------------- - | | - | method `countx` not found for this - | doesn't satisfy `_: StreamExt` -... -LL | let count = filter.countx(); - | ^^^^^^ method cannot be called on `Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>` due to unsatisfied trait bounds - | -note: the following trait bounds were not satisfied: - `&'a mut &Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream` - `&'a mut &mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream` - `&'a mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream` - --> $DIR/issue-30786.rs:100:50 - | -LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} - | --------- - ^^^^^^ unsatisfied trait bound introduced here -help: one of the expressions' fields has a method of the same name - | -LL | let count = filter.stream.countx(); - | +++++++ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/hrtb/issue-30786.rs b/src/test/ui/hrtb/issue-30786.rs index c2e01909870..e5f46f711c2 100644 --- a/src/test/ui/hrtb/issue-30786.rs +++ b/src/test/ui/hrtb/issue-30786.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream`, but its trait bounds were not satisfied - --> $DIR/issue-30786.rs:122:22 +error[E0599]: the method `filterx` exists for struct `Map`, but its trait bounds were not satisfied + --> $DIR/issue-30786.rs:118:22 | LL | pub struct Map { | -------------------- @@ -8,13 +8,13 @@ LL | pub struct Map { | doesn't satisfy `_: StreamExt` ... LL | let filter = map.filterx(|x: &_| true); - | ^^^^^^^ method cannot be called on `Map` due to unsatisfied trait bounds + | ^^^^^^^ method cannot be called on `Map` due to unsatisfied trait bounds | note: the following trait bounds were not satisfied: - `&'a mut &Map: Stream` - `&'a mut &mut Map: Stream` - `&'a mut Map: Stream` - --> $DIR/issue-30786.rs:100:50 + `&'a mut &Map: Stream` + `&'a mut &mut Map: Stream` + `&'a mut Map: Stream` + --> $DIR/issue-30786.rs:96:50 | LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} | --------- - ^^^^^^ unsatisfied trait bound introduced here @@ -23,8 +23,8 @@ help: one of the expressions' fields has a method of the same name LL | let filter = map.stream.filterx(|x: &_| true); | +++++++ -error[E0599]: the method `countx` exists for struct `Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>`, but its trait bounds were not satisfied - --> $DIR/issue-30786.rs:134:24 +error[E0599]: the method `countx` exists for struct `Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>`, but its trait bounds were not satisfied + --> $DIR/issue-30786.rs:130:24 | LL | pub struct Filter { | ----------------------- @@ -33,13 +33,13 @@ LL | pub struct Filter { | doesn't satisfy `_: StreamExt` ... LL | let count = filter.countx(); - | ^^^^^^ method cannot be called on `Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>` due to unsatisfied trait bounds + | ^^^^^^ method cannot be called on `Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>` due to unsatisfied trait bounds | note: the following trait bounds were not satisfied: - `&'a mut &Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream` - `&'a mut &mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream` - `&'a mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream` - --> $DIR/issue-30786.rs:100:50 + `&'a mut &Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream` + `&'a mut &mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream` + `&'a mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream` + --> $DIR/issue-30786.rs:96:50 | LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} | --------- - ^^^^^^ unsatisfied trait bound introduced here diff --git a/src/test/ui/hrtb/issue-46989.base.stderr b/src/test/ui/hrtb/issue-46989.base.stderr deleted file mode 100644 index d1f6fed10fd..00000000000 --- a/src/test/ui/hrtb/issue-46989.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `Foo` is not general enough - --> $DIR/issue-46989.rs:42:5 - | -LL | assert_foo::(); - | ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r i32)` - = note: ...but `Foo` is actually implemented for the type `fn(&'0 i32)`, for some specific lifetime `'0` - -error: aborting due to previous error - diff --git a/src/test/ui/hrtb/issue-46989.rs b/src/test/ui/hrtb/issue-46989.rs index 0bb6d7a18eb..4a09f4be156 100644 --- a/src/test/ui/hrtb/issue-46989.rs +++ b/src/test/ui/hrtb/issue-46989.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Regression test for #46989: // // In the move to universes, this test started passing. diff --git a/src/test/ui/hrtb/issue-46989.nll.stderr b/src/test/ui/hrtb/issue-46989.stderr similarity index 92% rename from src/test/ui/hrtb/issue-46989.nll.stderr rename to src/test/ui/hrtb/issue-46989.stderr index e1ddd7235f5..309e1a676ed 100644 --- a/src/test/ui/hrtb/issue-46989.nll.stderr +++ b/src/test/ui/hrtb/issue-46989.stderr @@ -1,5 +1,5 @@ error: implementation of `Foo` is not general enough - --> $DIR/issue-46989.rs:42:5 + --> $DIR/issue-46989.rs:38:5 | LL | assert_foo::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr deleted file mode 100644 index a01560e70e3..00000000000 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/dyn-trait.rs:24:16 - | -LL | fn with_dyn_debug_static<'a>(x: Box) { - | ------------------- this data with lifetime `'a`... -LL | static_val(x); - | ^ ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/dyn-trait.rs:24:5 - | -LL | static_val(x); - | ^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs index a103034a537..c508c0ac9d5 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a, // 'b> MyTrait<'a> for &'b i32`. @@ -22,8 +18,7 @@ fn static_val(_: T) { fn with_dyn_debug_static<'a>(x: Box) { static_val(x); - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR borrowed data escapes outside of function + //~^ ERROR borrowed data escapes outside of function } fn not_static_val(_: T) { diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr similarity index 95% rename from src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr rename to src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr index 762698c4fc1..88c260b18cb 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of function - --> $DIR/dyn-trait.rs:24:5 + --> $DIR/dyn-trait.rs:20:5 | LL | fn with_dyn_debug_static<'a>(x: Box) { | -- - `x` is a reference that is only valid in the function body diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs index d0277336b25..0bddce49b40 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs @@ -1,7 +1,5 @@ // edition:2018 -// build-pass (FIXME(62277): could be check-pass?) -// revisions: migrate mir -//[mir]compile-flags: -Z borrowck=mir +// build-pass (FIXME(62277): could be check-pass? trait Trait<'a, 'b> {} impl Trait<'_, '_> for T {} diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs index 529dcd8ece6..e363fdb36e3 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs @@ -1,7 +1,5 @@ // edition:2018 // check-pass -// revisions: migrate mir -//[mir]compile-flags: -Z borrowck=mir #![feature(type_alias_impl_trait)] trait Trait<'a, 'b> {} diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs index be455f53350..0f21dd5ffe5 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.rs @@ -1,7 +1,5 @@ // edition:2018 // build-pass (FIXME(62277): could be check-pass?) -// revisions: migrate mir -//[mir]compile-flags: -Z borrowck=mir trait Trait<'a, 'b> {} impl Trait<'_, '_> for T {} diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs index 7235d89019f..13ad1f7215f 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-other.rs @@ -1,7 +1,5 @@ // edition:2018 // build-pass (FIXME(62277): could be check-pass?) -// revisions: migrate mir -//[mir]compile-flags: -Z borrowck=mir trait Trait<'a, 'b> {} impl Trait<'_, '_> for T {} diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr deleted file mode 100644 index 45cc935b7cc..00000000000 --- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.base.stderr +++ /dev/null @@ -1,227 +0,0 @@ -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/must_outlive_least_region_or_bound.rs:7:35 - | -LL | fn elided(x: &i32) -> impl Copy { x } - | ---- ^ - | | - | hidden type `&i32` captures the anonymous lifetime defined here - | -help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound - | -LL | fn elided(x: &i32) -> impl Copy + '_ { x } - | ++++ - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/must_outlive_least_region_or_bound.rs:10:44 - | -LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } - | -- ^ - | | - | hidden type `&'a i32` captures the lifetime `'a` as defined here - | -help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound - | -LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x } - | ++++ - -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:13:46 - | -LL | fn elided2(x: &i32) -> impl Copy + 'static { x } - | ---- ^ ...is used here... - | | - | this data with an anonymous lifetime `'_`... - | -note: ...and is required to live as long as `'static` here - --> $DIR/must_outlive_least_region_or_bound.rs:13:24 - | -LL | fn elided2(x: &i32) -> impl Copy + 'static { x } - | ^^^^^^^^^^^^^^^^^^^ -help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x` - | -LL | fn elided2(x: &i32) -> impl Copy + '_ { x } - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x } - | ~~~~~~~~~~~~ - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:17:55 - | -LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } - | ------- ^ ...is used here... - | | - | this data with lifetime `'a`... - | -note: ...and is required to live as long as `'static` here - --> $DIR/must_outlive_least_region_or_bound.rs:17:33 - | -LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } - | ^^^^^^^^^^^^^^^^^^^ -help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x` - | -LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x } - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x } - | ~~~~~~~~~~~~ - -error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/must_outlive_least_region_or_bound.rs:21:24 - | -LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x } - | ---- ^^^^^^^^^^^^^^ lifetime `'a` required - | | - | help: add explicit lifetime `'a` to the type of `x`: `&'a i32` - -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:36:65 - | -LL | fn elided5(x: &i32) -> (Box, impl Debug) { (Box::new(x), x) } - | ---- this data with an anonymous lifetime `'_`... ^ ...is used and required to live as long as `'static` here - | -help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound - | -LL | fn elided5(x: &i32) -> (Box, impl Debug) { (Box::new(x), x) } - | ++++ -help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound - | -LL | fn elided5(x: &i32) -> (Box, impl Debug + '_) { (Box::new(x), x) } - | ++++ - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:43:69 - | -LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } - | ------- this data with lifetime `'a`... ^ ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/must_outlive_least_region_or_bound.rs:43:34 - | -LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x` - | -LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x } - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x } - | ~~~~~~~~~~~~ - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/must_outlive_least_region_or_bound.rs:50:5 - | -LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) { - | -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:50:5: 50:31]` captures the lifetime `'b` as defined here -LL | move |_| println!("{}", y) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound - | -LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + 'b { - | ++++ - -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/must_outlive_least_region_or_bound.rs:54:51 - | -LL | fn ty_param_wont_outlive_static(x: T) -> impl Debug + 'static { - | ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn ty_param_wont_outlive_static(x: T) -> impl Debug + 'static { - | +++++++++ - -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:24:50 - | -LL | fn elided3(x: &i32) -> Box { Box::new(x) } - | ---- ^ ...is used and required to live as long as `'static` here - | | - | this data with an anonymous lifetime `'_`... - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:24:28 - | -LL | fn elided3(x: &i32) -> Box { Box::new(x) } - | ^^^^^^^^^ ----------- because of this returned expression - | | - | `'static` requirement introduced here -help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound - | -LL | fn elided3(x: &i32) -> Box { Box::new(x) } - | ++++ - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:27:59 - | -LL | fn explicit3<'a>(x: &'a i32) -> Box { Box::new(x) } - | ------- ^ ...is used and required to live as long as `'static` here - | | - | this data with lifetime `'a`... - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:27:37 - | -LL | fn explicit3<'a>(x: &'a i32) -> Box { Box::new(x) } - | ^^^^^^^^^ ----------- because of this returned expression - | | - | `'static` requirement introduced here -help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound - | -LL | fn explicit3<'a>(x: &'a i32) -> Box { Box::new(x) } - | ++++ - -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:30:60 - | -LL | fn elided4(x: &i32) -> Box { Box::new(x) } - | ---- ^ ...is used and required to live as long as `'static` here - | | - | this data with an anonymous lifetime `'_`... - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:30:40 - | -LL | fn elided4(x: &i32) -> Box { Box::new(x) } - | ^^^^^^^ ----------- because of this returned expression - | | - | `'static` requirement introduced here -help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` - | -LL | fn elided4(x: &i32) -> Box { Box::new(x) } - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn elided4(x: &'static i32) -> Box { Box::new(x) } - | ~~~~~~~~~~~~ - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/must_outlive_least_region_or_bound.rs:33:69 - | -LL | fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } - | ------- this data with lifetime `'a`... ^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:33:49 - | -LL | fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } - | ^^^^^^^ ----------- because of this returned expression - | | - | `'static` requirement introduced here -help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` - | -LL | fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn explicit4<'a>(x: &'static i32) -> Box { Box::new(x) } - | ~~~~~~~~~~~~ - -error: aborting due to 13 previous errors - -Some errors have detailed explanations: E0310, E0621, E0700, E0759. -For more information about an error, try `rustc --explain E0310`. diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs index 6bb3141b012..18404f98603 100644 --- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs +++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - use std::fmt::Debug; fn elided(x: &i32) -> impl Copy { x } @@ -11,38 +7,30 @@ fn explicit<'a>(x: &'a i32) -> impl Copy { x } //~^ ERROR: captures lifetime that does not appear in bounds fn elided2(x: &i32) -> impl Copy + 'static { x } -//[base]~^ ERROR E0759 -//[nll]~^^ ERROR lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } -//[base]~^ ERROR E0759 -//[nll]~^^ ERROR lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn foo<'a>(x: &i32) -> impl Copy + 'a { x } //~^ ERROR explicit lifetime required in the type of `x` fn elided3(x: &i32) -> Box { Box::new(x) } -//[base]~^ ERROR E0759 fn explicit3<'a>(x: &'a i32) -> Box { Box::new(x) } -//[base]~^ ERROR E0759 fn elided4(x: &i32) -> Box { Box::new(x) } -//[base]~^ ERROR E0759 fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } -//[base]~^ ERROR E0759 fn elided5(x: &i32) -> (Box, impl Debug) { (Box::new(x), x) } -//[base]~^ ERROR E0759 -//[nll]~^^ ERROR lifetime may not live long enough +//~^ ERROR lifetime may not live long enough trait LifetimeTrait<'a> {} impl<'a> LifetimeTrait<'a> for &'a i32 {} fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } -//[base]~^ ERROR E0759 -//[nll]~^^ ERROR lifetime may not live long enough +//~^ ERROR lifetime may not live long enough // Tests that a closure type containing 'b cannot be returned from a type where // only 'a was expected. @@ -52,9 +40,8 @@ fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) { } fn ty_param_wont_outlive_static(x: T) -> impl Debug + 'static { - //[base]~^ ERROR the parameter type `T` may not live long enough x - //[nll]~^ ERROR the parameter type `T` may not live long enough + //~^ ERROR the parameter type `T` may not live long enough } fn main() {} diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr similarity index 90% rename from src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr rename to src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr index 0252e546fb0..f8ff2177bf5 100644 --- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr +++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr @@ -1,5 +1,5 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/must_outlive_least_region_or_bound.rs:7:35 + --> $DIR/must_outlive_least_region_or_bound.rs:3:35 | LL | fn elided(x: &i32) -> impl Copy { x } | ---- ^ @@ -12,7 +12,7 @@ LL | fn elided(x: &i32) -> impl Copy + '_ { x } | ++++ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/must_outlive_least_region_or_bound.rs:10:44 + --> $DIR/must_outlive_least_region_or_bound.rs:6:44 | LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } | -- ^ @@ -25,7 +25,7 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x } | ++++ error: lifetime may not live long enough - --> $DIR/must_outlive_least_region_or_bound.rs:13:46 + --> $DIR/must_outlive_least_region_or_bound.rs:9:46 | LL | fn elided2(x: &i32) -> impl Copy + 'static { x } | - ^ returning this value requires that `'1` must outlive `'static` @@ -42,7 +42,7 @@ LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x } | ~~~~~~~~~~~~ error: lifetime may not live long enough - --> $DIR/must_outlive_least_region_or_bound.rs:17:55 + --> $DIR/must_outlive_least_region_or_bound.rs:12:55 | LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static` @@ -57,7 +57,7 @@ LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x } | ~~~~~~~~~~~~ error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/must_outlive_least_region_or_bound.rs:21:41 + --> $DIR/must_outlive_least_region_or_bound.rs:15:41 | LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x } | ---- ^ lifetime `'a` required @@ -65,7 +65,7 @@ LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x } | help: add explicit lifetime `'a` to the type of `x`: `&'a i32` error: lifetime may not live long enough - --> $DIR/must_outlive_least_region_or_bound.rs:36:55 + --> $DIR/must_outlive_least_region_or_bound.rs:26:55 | LL | fn elided5(x: &i32) -> (Box, impl Debug) { (Box::new(x), x) } | - ^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static` @@ -82,7 +82,7 @@ LL | fn elided5(x: &i32) -> (Box, impl Debug + '_) { (Box::new(x), x) | ++++ error: lifetime may not live long enough - --> $DIR/must_outlive_least_region_or_bound.rs:43:69 + --> $DIR/must_outlive_least_region_or_bound.rs:32:69 | LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static` @@ -97,10 +97,10 @@ LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x | ~~~~~~~~~~~~ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/must_outlive_least_region_or_bound.rs:50:5 + --> $DIR/must_outlive_least_region_or_bound.rs:38:5 | LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) { - | -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:50:5: 50:31]` captures the lifetime `'b` as defined here + | -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:38:5: 38:31]` captures the lifetime `'b` as defined here LL | move |_| println!("{}", y) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | @@ -110,7 +110,7 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32 | ++++ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/must_outlive_least_region_or_bound.rs:56:5 + --> $DIR/must_outlive_least_region_or_bound.rs:43:5 | LL | x | ^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/impl-trait/type_parameters_captured.base.stderr b/src/test/ui/impl-trait/type_parameters_captured.base.stderr deleted file mode 100644 index cfa1d93d571..00000000000 --- a/src/test/ui/impl-trait/type_parameters_captured.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/type_parameters_captured.rs:11:20 - | -LL | fn foo(x: T) -> impl Any + 'static { - | ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn foo(x: T) -> impl Any + 'static { - | +++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/impl-trait/type_parameters_captured.rs b/src/test/ui/impl-trait/type_parameters_captured.rs index 0618beeef97..81ee7d3f8a5 100644 --- a/src/test/ui/impl-trait/type_parameters_captured.rs +++ b/src/test/ui/impl-trait/type_parameters_captured.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - use std::fmt::Debug; trait Any {} @@ -9,9 +5,8 @@ impl Any for T {} // Check that type parameters are captured and not considered 'static fn foo(x: T) -> impl Any + 'static { - //[base]~^ ERROR the parameter type `T` may not live long enough x - //[nll]~^ ERROR the parameter type `T` may not live long enough + //~^ ERROR the parameter type `T` may not live long enough } fn main() {} diff --git a/src/test/ui/impl-trait/type_parameters_captured.nll.stderr b/src/test/ui/impl-trait/type_parameters_captured.stderr similarity index 90% rename from src/test/ui/impl-trait/type_parameters_captured.nll.stderr rename to src/test/ui/impl-trait/type_parameters_captured.stderr index a07ba564490..fb502cfdd2b 100644 --- a/src/test/ui/impl-trait/type_parameters_captured.nll.stderr +++ b/src/test/ui/impl-trait/type_parameters_captured.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/type_parameters_captured.rs:13:5 + --> $DIR/type_parameters_captured.rs:8:5 | LL | x | ^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/issues/issue-10291.base.stderr b/src/test/ui/issues/issue-10291.base.stderr deleted file mode 100644 index cad22b2f3ea..00000000000 --- a/src/test/ui/issues/issue-10291.base.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-10291.rs:7:9 - | -LL | x - | ^ - | -note: ...the reference is valid for the anonymous lifetime #1 defined here... - --> $DIR/issue-10291.rs:6:69 - | -LL | drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { - | _____________________________________________________________________^ -LL | | x -LL | | -LL | | -LL | | })); - | |_____^ -note: ...but the borrowed content is only valid for the lifetime `'x` as defined here - --> $DIR/issue-10291.rs:5:9 - | -LL | fn test<'x>(x: &'x isize) { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/issues/issue-10291.rs b/src/test/ui/issues/issue-10291.rs index 8ee3ce44d3d..31b9e124046 100644 --- a/src/test/ui/issues/issue-10291.rs +++ b/src/test/ui/issues/issue-10291.rs @@ -1,12 +1,7 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn test<'x>(x: &'x isize) { drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { x - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough })); } diff --git a/src/test/ui/issues/issue-10291.nll.stderr b/src/test/ui/issues/issue-10291.stderr similarity index 91% rename from src/test/ui/issues/issue-10291.nll.stderr rename to src/test/ui/issues/issue-10291.stderr index 47c4d4945f3..a7b827d27a8 100644 --- a/src/test/ui/issues/issue-10291.nll.stderr +++ b/src/test/ui/issues/issue-10291.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-10291.rs:7:9 + --> $DIR/issue-10291.rs:3:9 | LL | fn test<'x>(x: &'x isize) { | -- lifetime `'x` defined here diff --git a/src/test/ui/issues/issue-13058.base.stderr b/src/test/ui/issues/issue-13058.base.stderr deleted file mode 100644 index 2b9fff3f981..00000000000 --- a/src/test/ui/issues/issue-13058.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `cont` - --> $DIR/issue-13058.rs:18:26 - | -LL | fn check<'r, I: Iterator, T: Itble<'r, usize, I>>(cont: &T) -> bool - | -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T` -LL | { -LL | let cont_iter = cont.iter(); - | ^^^^ lifetime `'r` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issues/issue-13058.rs b/src/test/ui/issues/issue-13058.rs index cbd52a802e8..a5806feb720 100644 --- a/src/test/ui/issues/issue-13058.rs +++ b/src/test/ui/issues/issue-13058.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::ops::Range; trait Itble<'r, T, I: Iterator> { fn iter(&'r self) -> I; } diff --git a/src/test/ui/issues/issue-13058.nll.stderr b/src/test/ui/issues/issue-13058.stderr similarity index 94% rename from src/test/ui/issues/issue-13058.nll.stderr rename to src/test/ui/issues/issue-13058.stderr index ddefa8a62c9..8368978deab 100644 --- a/src/test/ui/issues/issue-13058.nll.stderr +++ b/src/test/ui/issues/issue-13058.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `cont` - --> $DIR/issue-13058.rs:18:21 + --> $DIR/issue-13058.rs:14:21 | LL | fn check<'r, I: Iterator, T: Itble<'r, usize, I>>(cont: &T) -> bool | -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T` diff --git a/src/test/ui/issues/issue-15034.base.stderr b/src/test/ui/issues/issue-15034.base.stderr deleted file mode 100644 index 293692c1ddc..00000000000 --- a/src/test/ui/issues/issue-15034.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `lexer` - --> $DIR/issue-15034.rs:21:25 - | -LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { - | ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>` -LL | Parser { lexer: lexer } - | ^^^^^ lifetime `'a` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issues/issue-15034.rs b/src/test/ui/issues/issue-15034.rs index f95275e3a7b..9ea6ed89ca2 100644 --- a/src/test/ui/issues/issue-15034.rs +++ b/src/test/ui/issues/issue-15034.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - pub struct Lexer<'a> { input: &'a str, } diff --git a/src/test/ui/issues/issue-15034.nll.stderr b/src/test/ui/issues/issue-15034.stderr similarity index 93% rename from src/test/ui/issues/issue-15034.nll.stderr rename to src/test/ui/issues/issue-15034.stderr index 54af22fb726..f142e260a23 100644 --- a/src/test/ui/issues/issue-15034.nll.stderr +++ b/src/test/ui/issues/issue-15034.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `lexer` - --> $DIR/issue-15034.rs:21:9 + --> $DIR/issue-15034.rs:17:9 | LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { | ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>` diff --git a/src/test/ui/issues/issue-16683.base.stderr b/src/test/ui/issues/issue-16683.base.stderr deleted file mode 100644 index f684dd04a36..00000000000 --- a/src/test/ui/issues/issue-16683.base.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements - --> $DIR/issue-16683.rs:8:14 - | -LL | self.a(); - | ^ - | -note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/issue-16683.rs:7:10 - | -LL | fn b(&self) { - | ^^^^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/issue-16683.rs:8:9 - | -LL | self.a(); - | ^^^^ -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/issue-16683.rs:5:9 - | -LL | trait T<'a> { - | ^^ -note: ...so that the types are compatible - --> $DIR/issue-16683.rs:8:14 - | -LL | self.a(); - | ^ - = note: expected `&'a Self` - found `&Self` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issues/issue-16683.rs b/src/test/ui/issues/issue-16683.rs index 05969bc7b9f..72fa21bddd1 100644 --- a/src/test/ui/issues/issue-16683.rs +++ b/src/test/ui/issues/issue-16683.rs @@ -1,13 +1,8 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait T<'a> { fn a(&'a self) -> &'a bool; fn b(&self) { self.a(); - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/issues/issue-16683.nll.stderr b/src/test/ui/issues/issue-16683.stderr similarity index 92% rename from src/test/ui/issues/issue-16683.nll.stderr rename to src/test/ui/issues/issue-16683.stderr index 308d6352602..fff681b2e0b 100644 --- a/src/test/ui/issues/issue-16683.nll.stderr +++ b/src/test/ui/issues/issue-16683.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-16683.rs:8:9 + --> $DIR/issue-16683.rs:4:9 | LL | trait T<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-16922.base.stderr b/src/test/ui/issues/issue-16922.base.stderr deleted file mode 100644 index e139de2019d..00000000000 --- a/src/test/ui/issues/issue-16922.base.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/issue-16922.rs:8:14 - | -LL | fn foo(value: &T) -> Box { - | -- this data with an anonymous lifetime `'_`... -LL | Box::new(value) as Box - | ^^^^^ ...is used and required to live as long as `'static` here - | -help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound - | -LL | fn foo(value: &T) -> Box { - | ++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/issues/issue-16922.rs b/src/test/ui/issues/issue-16922.rs index 1767017eb3d..bbbbf72dbd5 100644 --- a/src/test/ui/issues/issue-16922.rs +++ b/src/test/ui/issues/issue-16922.rs @@ -1,13 +1,8 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::any::Any; fn foo(value: &T) -> Box { Box::new(value) as Box - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/issues/issue-16922.nll.stderr b/src/test/ui/issues/issue-16922.stderr similarity index 94% rename from src/test/ui/issues/issue-16922.nll.stderr rename to src/test/ui/issues/issue-16922.stderr index 00a42e67242..9d9f32a97c0 100644 --- a/src/test/ui/issues/issue-16922.nll.stderr +++ b/src/test/ui/issues/issue-16922.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-16922.rs:8:5 + --> $DIR/issue-16922.rs:4:5 | LL | fn foo(value: &T) -> Box { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/issues/issue-17728.base.stderr b/src/test/ui/issues/issue-17728.base.stderr deleted file mode 100644 index b52dc444593..00000000000 --- a/src/test/ui/issues/issue-17728.base.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/issue-17728.rs:19:28 - | -LL | fn attemptTraverse(&self, room: &Room, directionStr: &str) -> Result<&Room, &str> { - | ----- ------------------- - | | - | this parameter and the return type are declared with different lifetimes... -... -LL | Some(entry) => Ok(entry), - | ^^^^^^^^^ ...but data from `room` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn attemptTraverse<'a>(&'a self, room: &'a Room, directionStr: &str) -> Result<&Room, &str> { - | ++++ ++ ++ - -error[E0308]: `match` arms have incompatible types - --> $DIR/issue-17728.rs:113:14 - | -LL | / match to_parse { -LL | | "w" | "west" => RoomDirection::West, -LL | | "e" | "east" => RoomDirection::East, -LL | | "n" | "north" => RoomDirection::North, -... | -LL | | "down" => RoomDirection::Down, - | | ------------------- this and all prior arms are found to be of type `RoomDirection` -LL | | _ => None - | | ^^^^ expected enum `RoomDirection`, found enum `Option` -LL | | } - | |_____- `match` arms have incompatible types - | - = note: expected enum `RoomDirection` - found enum `Option<_>` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0308, E0623. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/issues/issue-17728.rs b/src/test/ui/issues/issue-17728.rs index 91b71ad6d0b..6aca159c47e 100644 --- a/src/test/ui/issues/issue-17728.rs +++ b/src/test/ui/issues/issue-17728.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::fmt::{Debug, Formatter, Error}; use std::collections::HashMap; @@ -17,7 +13,6 @@ trait TraversesWorld { let maybe_room = room.direction_to_room.get(&direction); match maybe_room { Some(entry) => Ok(entry), - //[base]~^ ERROR lifetime mismatch [E0623] _ => Err("Direction does not exist in room.") } } diff --git a/src/test/ui/issues/issue-17728.nll.stderr b/src/test/ui/issues/issue-17728.stderr similarity index 95% rename from src/test/ui/issues/issue-17728.nll.stderr rename to src/test/ui/issues/issue-17728.stderr index ddfb890eac3..3b25902d757 100644 --- a/src/test/ui/issues/issue-17728.nll.stderr +++ b/src/test/ui/issues/issue-17728.stderr @@ -1,5 +1,5 @@ error[E0308]: `match` arms have incompatible types - --> $DIR/issue-17728.rs:113:14 + --> $DIR/issue-17728.rs:108:14 | LL | / match to_parse { LL | | "w" | "west" => RoomDirection::West, diff --git a/src/test/ui/issues/issue-17758.base.stderr b/src/test/ui/issues/issue-17758.base.stderr deleted file mode 100644 index 202238a49cb..00000000000 --- a/src/test/ui/issues/issue-17758.base.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements - --> $DIR/issue-17758.rs:11:14 - | -LL | self.foo(); - | ^^^ - | -note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/issue-17758.rs:10:12 - | -LL | fn bar(&self) { - | ^^^^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/issue-17758.rs:11:9 - | -LL | self.foo(); - | ^^^^ -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/issue-17758.rs:8:11 - | -LL | trait Foo<'a> { - | ^^ -note: ...so that the types are compatible - --> $DIR/issue-17758.rs:11:14 - | -LL | self.foo(); - | ^^^ - = note: expected `&'a Self` - found `&Self` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issues/issue-17758.rs b/src/test/ui/issues/issue-17758.rs index 8090022b6d0..e2ee84694e3 100644 --- a/src/test/ui/issues/issue-17758.rs +++ b/src/test/ui/issues/issue-17758.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test that regionck suggestions in a provided method of a trait // don't ICE @@ -9,8 +5,7 @@ trait Foo<'a> { fn foo(&'a self); fn bar(&self) { self.foo(); - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/issues/issue-17758.nll.stderr b/src/test/ui/issues/issue-17758.stderr similarity index 92% rename from src/test/ui/issues/issue-17758.nll.stderr rename to src/test/ui/issues/issue-17758.stderr index 32030540a84..613ef6b907c 100644 --- a/src/test/ui/issues/issue-17758.nll.stderr +++ b/src/test/ui/issues/issue-17758.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-17758.rs:11:9 + --> $DIR/issue-17758.rs:7:9 | LL | trait Foo<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-26217.base.stderr b/src/test/ui/issues/issue-26217.base.stderr deleted file mode 100644 index 8b1ef806abb..00000000000 --- a/src/test/ui/issues/issue-26217.base.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0477]: the type `&'a i32` does not fulfill the required lifetime - --> $DIR/issue-26217.rs:8:5 - | -LL | foo::<&'a i32>(); - | ^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/issues/issue-26217.rs b/src/test/ui/issues/issue-26217.rs index 6cc60b05dc6..422625e73c1 100644 --- a/src/test/ui/issues/issue-26217.rs +++ b/src/test/ui/issues/issue-26217.rs @@ -1,13 +1,8 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo() where for<'a> T: 'a {} fn bar<'a>() { foo::<&'a i32>(); - //[base]~^ ERROR the type `&'a i32` does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/issues/issue-26217.nll.stderr b/src/test/ui/issues/issue-26217.stderr similarity index 88% rename from src/test/ui/issues/issue-26217.nll.stderr rename to src/test/ui/issues/issue-26217.stderr index c8b7d620557..c7601caacdc 100644 --- a/src/test/ui/issues/issue-26217.nll.stderr +++ b/src/test/ui/issues/issue-26217.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-26217.rs:8:5 + --> $DIR/issue-26217.rs:4:5 | LL | fn bar<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-40000.base.stderr b/src/test/ui/issues/issue-40000.base.stderr deleted file mode 100644 index a8518dde22e..00000000000 --- a/src/test/ui/issues/issue-40000.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-40000.rs:10:9 - | -LL | foo(bar); - | ^^^ one type is more general than the other - | - = note: expected trait object `dyn for<'r> Fn(&'r i32)` - found trait object `dyn Fn(&i32)` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issues/issue-40000.rs b/src/test/ui/issues/issue-40000.rs index 3639413bfaf..a6e05e7ba02 100644 --- a/src/test/ui/issues/issue-40000.rs +++ b/src/test/ui/issues/issue-40000.rs @@ -1,13 +1,9 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn main() { let bar: fn(&mut u32) = |_| {}; fn foo(x: Box) {} let bar = Box::new(|x: &i32| {}) as Box; foo(bar); - //~^ ERROR E0308 - //[nll]~^^ ERROR mismatched types + //~^ ERROR mismatched types + //~| ERROR mismatched types } diff --git a/src/test/ui/issues/issue-40000.nll.stderr b/src/test/ui/issues/issue-40000.stderr similarity index 90% rename from src/test/ui/issues/issue-40000.nll.stderr rename to src/test/ui/issues/issue-40000.stderr index 81df9969a4f..e6f0b5fbfba 100644 --- a/src/test/ui/issues/issue-40000.nll.stderr +++ b/src/test/ui/issues/issue-40000.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-40000.rs:10:9 + --> $DIR/issue-40000.rs:6:9 | LL | foo(bar); | ^^^ one type is more general than the other @@ -8,7 +8,7 @@ LL | foo(bar); found trait object `dyn Fn(&i32)` error[E0308]: mismatched types - --> $DIR/issue-40000.rs:10:9 + --> $DIR/issue-40000.rs:6:9 | LL | foo(bar); | ^^^ one type is more general than the other diff --git a/src/test/ui/issues/issue-46983.base.stderr b/src/test/ui/issues/issue-46983.base.stderr deleted file mode 100644 index 97ed4d65093..00000000000 --- a/src/test/ui/issues/issue-46983.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/issue-46983.rs:6:5 - | -LL | fn foo(x: &u32) -> &'static u32 { - | ---- this data with an anonymous lifetime `'_`... -LL | &*x - | ^^^ ...is used and required to live as long as `'static` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/issues/issue-46983.rs b/src/test/ui/issues/issue-46983.rs index e3ecdc8deac..4bd49a8796b 100644 --- a/src/test/ui/issues/issue-46983.rs +++ b/src/test/ui/issues/issue-46983.rs @@ -1,11 +1,6 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(x: &u32) -> &'static u32 { &*x - //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/issues/issue-46983.nll.stderr b/src/test/ui/issues/issue-46983.stderr similarity index 90% rename from src/test/ui/issues/issue-46983.nll.stderr rename to src/test/ui/issues/issue-46983.stderr index 1327ff80c80..38a219bbd7b 100644 --- a/src/test/ui/issues/issue-46983.nll.stderr +++ b/src/test/ui/issues/issue-46983.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-46983.rs:6:5 + --> $DIR/issue-46983.rs:2:5 | LL | fn foo(x: &u32) -> &'static u32 { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/issues/issue-52533.base.stderr b/src/test/ui/issues/issue-52533.base.stderr deleted file mode 100644 index 6556a52de14..00000000000 --- a/src/test/ui/issues/issue-52533.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-52533.rs:9:16 - | -LL | foo(|a, b| b) - | ^ - | -note: ...the reference is valid for the anonymous lifetime #1 defined here... - --> $DIR/issue-52533.rs:9:9 - | -LL | foo(|a, b| b) - | ^^^^^^^^ -note: ...but the borrowed content is only valid for the anonymous lifetime #2 defined here - --> $DIR/issue-52533.rs:9:9 - | -LL | foo(|a, b| b) - | ^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/issues/issue-52533.rs b/src/test/ui/issues/issue-52533.rs index bc6264d0e2f..bb9a1911fdd 100644 --- a/src/test/ui/issues/issue-52533.rs +++ b/src/test/ui/issues/issue-52533.rs @@ -1,12 +1,7 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(_: impl for<'a> FnOnce(&'a u32, &u32) -> &'a u32) { } fn main() { foo(|a, b| b) - //[base]~^ ERROR lifetime of reference outlives lifetime of borrowed content... - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/issues/issue-52533.nll.stderr b/src/test/ui/issues/issue-52533.stderr similarity index 91% rename from src/test/ui/issues/issue-52533.nll.stderr rename to src/test/ui/issues/issue-52533.stderr index 75fe5a5b862..c764736d798 100644 --- a/src/test/ui/issues/issue-52533.nll.stderr +++ b/src/test/ui/issues/issue-52533.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-52533.rs:9:16 + --> $DIR/issue-52533.rs:5:16 | LL | foo(|a, b| b) | - - ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` diff --git a/src/test/ui/issues/issue-54302-cases.base.stderr b/src/test/ui/issues/issue-54302-cases.base.stderr deleted file mode 100644 index db91edf51e3..00000000000 --- a/src/test/ui/issues/issue-54302-cases.base.stderr +++ /dev/null @@ -1,38 +0,0 @@ -error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:67:5 - | -LL | >::ref_foo(a) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo<'static, u32>` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`... - = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1` - -error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:73:5 - | -LL | >::ref_foo(a) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo<'static, i32>` would have to be implemented for the type `&'0 i32`, for any lifetime `'0`... - = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1` - -error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:79:5 - | -LL | >::ref_foo(a) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo<'static, u64>` would have to be implemented for the type `&'0 u64`, for any lifetime `'0`... - = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1` - -error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:85:5 - | -LL | >::ref_foo(a) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo<'static, i64>` would have to be implemented for the type `&'0 i64`, for any lifetime `'0`... - = note: ...but `Foo<'_, i64>` is actually implemented for the type `&'1 i64`, for some specific lifetime `'1` - -error: aborting due to 4 previous errors - diff --git a/src/test/ui/issues/issue-54302-cases.rs b/src/test/ui/issues/issue-54302-cases.rs index f712d9b7718..faa116269ee 100644 --- a/src/test/ui/issues/issue-54302-cases.rs +++ b/src/test/ui/issues/issue-54302-cases.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Mirror { type Image; fn coerce(self) -> Self::Image; diff --git a/src/test/ui/issues/issue-54302-cases.nll.stderr b/src/test/ui/issues/issue-54302-cases.stderr similarity index 92% rename from src/test/ui/issues/issue-54302-cases.nll.stderr rename to src/test/ui/issues/issue-54302-cases.stderr index 89725d3b03a..6e8b69c4bee 100644 --- a/src/test/ui/issues/issue-54302-cases.nll.stderr +++ b/src/test/ui/issues/issue-54302-cases.stderr @@ -1,5 +1,5 @@ error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:67:5 + --> $DIR/issue-54302-cases.rs:63:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -8,7 +8,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:73:5 + --> $DIR/issue-54302-cases.rs:69:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -17,7 +17,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:79:5 + --> $DIR/issue-54302-cases.rs:75:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -26,7 +26,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:85:5 + --> $DIR/issue-54302-cases.rs:81:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/src/test/ui/issues/issue-54943.base.stderr b/src/test/ui/issues/issue-54943.base.stderr deleted file mode 100644 index ebd679996d0..00000000000 --- a/src/test/ui/issues/issue-54943.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0477]: the type `&'a u32` does not fulfill the required lifetime - --> $DIR/issue-54943.rs:10:13 - | -LL | let x = foo::<&'a u32>(); - | ^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/issue-54943.rs:5:11 - | -LL | fn foo() { } - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/issues/issue-54943.rs b/src/test/ui/issues/issue-54943.rs index ad463e7a466..85722300bf0 100644 --- a/src/test/ui/issues/issue-54943.rs +++ b/src/test/ui/issues/issue-54943.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo() { } fn boo<'a>() { diff --git a/src/test/ui/issues/issue-54943.nll.stderr b/src/test/ui/issues/issue-54943.stderr similarity index 89% rename from src/test/ui/issues/issue-54943.nll.stderr rename to src/test/ui/issues/issue-54943.stderr index 2c86a5a3390..59be0f983b9 100644 --- a/src/test/ui/issues/issue-54943.nll.stderr +++ b/src/test/ui/issues/issue-54943.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-54943.rs:10:13 + --> $DIR/issue-54943.rs:6:13 | LL | fn boo<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-55731.base.stderr b/src/test/ui/issues/issue-55731.base.stderr deleted file mode 100644 index 26b1c9ec468..00000000000 --- a/src/test/ui/issues/issue-55731.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `DistributedIteratorMulti` is not general enough - --> $DIR/issue-55731.rs:52:5 - | -LL | multi(Map { - | ^^^^^ implementation of `DistributedIteratorMulti` is not general enough - | - = note: `DistributedIteratorMulti<&'0 ()>` would have to be implemented for the type `Cloned<&()>`, for any lifetime `'0`... - = note: ...but `DistributedIteratorMulti<&'1 ()>` is actually implemented for the type `Cloned<&'1 ()>`, for some specific lifetime `'1` - -error: aborting due to previous error - diff --git a/src/test/ui/issues/issue-55731.rs b/src/test/ui/issues/issue-55731.rs index c6a0ee12589..7b4f4e2cd3b 100644 --- a/src/test/ui/issues/issue-55731.rs +++ b/src/test/ui/issues/issue-55731.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::marker::PhantomData; trait DistributedIterator { diff --git a/src/test/ui/issues/issue-55731.nll.stderr b/src/test/ui/issues/issue-55731.stderr similarity index 94% rename from src/test/ui/issues/issue-55731.nll.stderr rename to src/test/ui/issues/issue-55731.stderr index 168a2cbccd7..97fd6678c99 100644 --- a/src/test/ui/issues/issue-55731.nll.stderr +++ b/src/test/ui/issues/issue-55731.stderr @@ -1,5 +1,5 @@ error: implementation of `DistributedIteratorMulti` is not general enough - --> $DIR/issue-55731.rs:52:5 + --> $DIR/issue-55731.rs:48:5 | LL | / multi(Map { LL | | i: Cloned(PhantomData), diff --git a/src/test/ui/issues/issue-55796.base.stderr b/src/test/ui/issues/issue-55796.base.stderr deleted file mode 100644 index a4c5d68472d..00000000000 --- a/src/test/ui/issues/issue-55796.base.stderr +++ /dev/null @@ -1,53 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/issue-55796.rs:20:9 - | -LL | Box::new(self.out_edges(u).map(|e| e.target())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/issue-55796.rs:9:17 - | -LL | pub trait Graph<'a> { - | ^^ -note: ...so that the type `Map<>::EdgesIter, [closure@$DIR/issue-55796.rs:20:40: 20:54]>` will meet its required lifetime bounds - --> $DIR/issue-55796.rs:20:9 - | -LL | Box::new(self.out_edges(u).map(|e| e.target())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: but, the lifetime must be valid for the static lifetime... -note: ...so that the types are compatible - --> $DIR/issue-55796.rs:20:9 - | -LL | Box::new(self.out_edges(u).map(|e| e.target())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: expected `Box<(dyn Iterator>::Node> + 'static)>` - found `Box>::Node>>` - -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/issue-55796.rs:26:9 - | -LL | Box::new(self.in_edges(u).map(|e| e.target())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/issue-55796.rs:9:17 - | -LL | pub trait Graph<'a> { - | ^^ -note: ...so that the type `Map<>::EdgesIter, [closure@$DIR/issue-55796.rs:26:39: 26:53]>` will meet its required lifetime bounds - --> $DIR/issue-55796.rs:26:9 - | -LL | Box::new(self.in_edges(u).map(|e| e.target())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: but, the lifetime must be valid for the static lifetime... -note: ...so that the types are compatible - --> $DIR/issue-55796.rs:26:9 - | -LL | Box::new(self.in_edges(u).map(|e| e.target())) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: expected `Box<(dyn Iterator>::Node> + 'static)>` - found `Box>::Node>>` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issues/issue-55796.rs b/src/test/ui/issues/issue-55796.rs index a0bc63dd2a7..a7b27a99929 100644 --- a/src/test/ui/issues/issue-55796.rs +++ b/src/test/ui/issues/issue-55796.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - pub trait EdgeTrait { fn target(&self) -> N; } @@ -18,14 +14,12 @@ pub trait Graph<'a> { fn out_neighbors(&'a self, u: &Self::Node) -> Box> { Box::new(self.out_edges(u).map(|e| e.target())) - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn in_neighbors(&'a self, u: &Self::Node) -> Box> { Box::new(self.in_edges(u).map(|e| e.target())) - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/issues/issue-55796.nll.stderr b/src/test/ui/issues/issue-55796.stderr similarity index 91% rename from src/test/ui/issues/issue-55796.nll.stderr rename to src/test/ui/issues/issue-55796.stderr index 2b7d231871a..5809a56cd4b 100644 --- a/src/test/ui/issues/issue-55796.nll.stderr +++ b/src/test/ui/issues/issue-55796.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-55796.rs:20:9 + --> $DIR/issue-55796.rs:16:9 | LL | pub trait Graph<'a> { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | Box::new(self.out_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/issue-55796.rs:26:9 + --> $DIR/issue-55796.rs:21:9 | LL | pub trait Graph<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-75777.base.stderr b/src/test/ui/issues/issue-75777.base.stderr deleted file mode 100644 index d2c6738cb59..00000000000 --- a/src/test/ui/issues/issue-75777.base.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/issue-75777.rs:15:14 - | -LL | Box::new(move |_| fut) - | ^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/issue-75777.rs:13:11 - | -LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box BoxFuture<'a, A>> { - | ^^ -note: ...so that the types are compatible - --> $DIR/issue-75777.rs:15:14 - | -LL | Box::new(move |_| fut) - | ^^^^^^^^^^^^ - = note: expected `(Pin + Send>>,)` - found `(Pin + Send + 'a)>>,)` - = note: but, the lifetime must be valid for the static lifetime... -note: ...so that the types are compatible - --> $DIR/issue-75777.rs:15:5 - | -LL | Box::new(move |_| fut) - | ^^^^^^^^^^^^^^^^^^^^^^ - = note: expected `Box<(dyn FnOnce(&'a Env) -> Pin + Send + 'a)>> + 'static)>` - found `Box Pin + Send + 'a)>>>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issues/issue-75777.rs b/src/test/ui/issues/issue-75777.rs index 930cd7ad37b..a1e438bc617 100644 --- a/src/test/ui/issues/issue-75777.rs +++ b/src/test/ui/issues/issue-75777.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Regression test for #75777. // Checks that a boxed future can be properly constructed. @@ -13,8 +9,7 @@ type BoxFuture<'a, T> = Pin + 'a + Send>>; fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box BoxFuture<'a, A>> { let fut: BoxFuture<'a, A> = Box::pin(future::ready(v)); Box::new(move |_| fut) - //[base]~^ ERROR: cannot infer an appropriate lifetime - //[nll]~^^ ERROR: lifetime may not live long enough + //~^ ERROR: lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/issues/issue-75777.nll.stderr b/src/test/ui/issues/issue-75777.stderr similarity index 93% rename from src/test/ui/issues/issue-75777.nll.stderr rename to src/test/ui/issues/issue-75777.stderr index d1f8d388676..370cd72fd55 100644 --- a/src/test/ui/issues/issue-75777.nll.stderr +++ b/src/test/ui/issues/issue-75777.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-75777.rs:15:5 + --> $DIR/issue-75777.rs:11:5 | LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box BoxFuture<'a, A>> { | -- lifetime `'a` defined here diff --git a/src/test/ui/kindck/kindck-impl-type-params.base.stderr b/src/test/ui/kindck/kindck-impl-type-params.base.stderr deleted file mode 100644 index 2fa8993b71a..00000000000 --- a/src/test/ui/kindck/kindck-impl-type-params.base.stderr +++ /dev/null @@ -1,112 +0,0 @@ -error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:20:13 - | -LL | let a = &t as &dyn Gettable; - | ^^ `T` cannot be sent between threads safely - | -note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 - | -LL | impl Gettable for S {} - | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable` -help: consider restricting type parameter `T` - | -LL | fn f(val: T) { - | +++++++++++++++++++ - -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:20:13 - | -LL | let a = &t as &dyn Gettable; - | ^^ the trait `Copy` is not implemented for `T` - | -note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 - | -LL | impl Gettable for S {} - | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable` -help: consider restricting type parameter `T` - | -LL | fn f(val: T) { - | +++++++++++++++++++ - -error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:27:31 - | -LL | let a: &dyn Gettable = &t; - | ^^ `T` cannot be sent between threads safely - | -note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 - | -LL | impl Gettable for S {} - | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable` -help: consider restricting type parameter `T` - | -LL | fn g(val: T) { - | +++++++++++++++++++ - -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:27:31 - | -LL | let a: &dyn Gettable = &t; - | ^^ the trait `Copy` is not implemented for `T` - | -note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 - | -LL | impl Gettable for S {} - | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable` -help: consider restricting type parameter `T` - | -LL | fn g(val: T) { - | +++++++++++++++++++ - -error[E0477]: the type `&'a isize` does not fulfill the required lifetime - --> $DIR/kindck-impl-type-params.rs:34:13 - | -LL | let a = &t as &dyn Gettable<&'a isize>; - | ^^ - | - = note: type must satisfy the static lifetime - -error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:40:13 - | -LL | let a = t as Box>; - | ^ the trait `Copy` is not implemented for `String` - | - = help: the trait `Gettable` is implemented for `S` -note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 - | -LL | impl Gettable for S {} - | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable` - -error[E0277]: the trait bound `Foo: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:48:37 - | -LL | let a: Box> = t; - | ^ the trait `Copy` is not implemented for `Foo` - | - = help: the trait `Gettable` is implemented for `S` -note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 - | -LL | impl Gettable for S {} - | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable` -help: consider annotating `Foo` with `#[derive(Copy)]` - | -LL | #[derive(Copy)] - | - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0277, E0477. -For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-impl-type-params.rs b/src/test/ui/kindck/kindck-impl-type-params.rs index 1a563872585..72a6599c326 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.rs +++ b/src/test/ui/kindck/kindck-impl-type-params.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Issue #14061: tests the interaction between generic implementation // parameter bounds and trait objects. @@ -32,7 +28,6 @@ fn g(val: T) { fn foo<'a>() { let t: S<&'a isize> = S(marker::PhantomData); let a = &t as &dyn Gettable<&'a isize>; - //[base]~^ ERROR does not fulfill } fn foo2<'a>() { diff --git a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr similarity index 87% rename from src/test/ui/kindck/kindck-impl-type-params.nll.stderr rename to src/test/ui/kindck/kindck-impl-type-params.stderr index c6f5e17fb69..32759d2fa0e 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params.stderr @@ -1,11 +1,11 @@ error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:20:13 + --> $DIR/kindck-impl-type-params.rs:16:13 | LL | let a = &t as &dyn Gettable; | ^^ `T` cannot be sent between threads safely | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 + --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -16,13 +16,13 @@ LL | fn f(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:20:13 + --> $DIR/kindck-impl-type-params.rs:16:13 | LL | let a = &t as &dyn Gettable; | ^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 + --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -33,13 +33,13 @@ LL | fn f(val: T) { | +++++++++++++++++++ error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:27:31 + --> $DIR/kindck-impl-type-params.rs:23:31 | LL | let a: &dyn Gettable = &t; | ^^ `T` cannot be sent between threads safely | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 + --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -50,13 +50,13 @@ LL | fn g(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:27:31 + --> $DIR/kindck-impl-type-params.rs:23:31 | LL | let a: &dyn Gettable = &t; | ^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 + --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -67,28 +67,28 @@ LL | fn g(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:40:13 + --> $DIR/kindck-impl-type-params.rs:35:13 | LL | let a = t as Box>; | ^ the trait `Copy` is not implemented for `String` | = help: the trait `Gettable` is implemented for `S` note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 + --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` error[E0277]: the trait bound `Foo: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:48:37 + --> $DIR/kindck-impl-type-params.rs:43:37 | LL | let a: Box> = t; | ^ the trait `Copy` is not implemented for `Foo` | = help: the trait `Gettable` is implemented for `S` note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:16:32 + --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ diff --git a/src/test/ui/kindck/kindck-send-object1.base.stderr b/src/test/ui/kindck/kindck-send-object1.base.stderr deleted file mode 100644 index 5976c7119c7..00000000000 --- a/src/test/ui/kindck/kindck-send-object1.base.stderr +++ /dev/null @@ -1,45 +0,0 @@ -error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely - --> $DIR/kindck-send-object1.rs:14:5 - | -LL | assert_send::<&'a dyn Dummy>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)` - = note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:9:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error[E0477]: the type `&'a (dyn Dummy + Sync + 'a)` does not fulfill the required lifetime - --> $DIR/kindck-send-object1.rs:18:5 - | -LL | assert_send::<&'a (dyn Dummy + Sync)>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/kindck-send-object1.rs:9:23 - | -LL | fn assert_send() { } - | ^^^^^^^ - -error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely - --> $DIR/kindck-send-object1.rs:33:5 - | -LL | assert_send::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely - | - = help: the trait `Send` is not implemented for `(dyn Dummy + 'a)` - = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>` - = note: required because it appears within the type `Box<(dyn Dummy + 'a)>` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:9:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0277, E0477. -For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-send-object1.rs b/src/test/ui/kindck/kindck-send-object1.rs index 26894dc2ce4..787d0f8f6cb 100644 --- a/src/test/ui/kindck/kindck-send-object1.rs +++ b/src/test/ui/kindck/kindck-send-object1.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test which object types are considered sendable. This test // is broken into two parts because some errors occur in distinct // phases in the compiler. See kindck-send-object2.rs as well! @@ -16,7 +12,6 @@ fn test51<'a>() { } fn test52<'a>() { assert_send::<&'a (dyn Dummy + Sync)>(); - //[base]~^ ERROR does not fulfill the required lifetime } // ...unless they are properly bounded diff --git a/src/test/ui/kindck/kindck-send-object1.nll.stderr b/src/test/ui/kindck/kindck-send-object1.stderr similarity index 89% rename from src/test/ui/kindck/kindck-send-object1.nll.stderr rename to src/test/ui/kindck/kindck-send-object1.stderr index f34374dcc54..1f5e21cbf97 100644 --- a/src/test/ui/kindck/kindck-send-object1.nll.stderr +++ b/src/test/ui/kindck/kindck-send-object1.stderr @@ -1,5 +1,5 @@ error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely - --> $DIR/kindck-send-object1.rs:14:5 + --> $DIR/kindck-send-object1.rs:10:5 | LL | assert_send::<&'a dyn Dummy>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely @@ -7,13 +7,13 @@ LL | assert_send::<&'a dyn Dummy>(); = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)` = note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)` note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:9:18 + --> $DIR/kindck-send-object1.rs:5:18 | LL | fn assert_send() { } | ^^^^ required by this bound in `assert_send` error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely - --> $DIR/kindck-send-object1.rs:33:5 + --> $DIR/kindck-send-object1.rs:28:5 | LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely @@ -22,7 +22,7 @@ LL | assert_send::>(); = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>` = note: required because it appears within the type `Box<(dyn Dummy + 'a)>` note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:9:18 + --> $DIR/kindck-send-object1.rs:5:18 | LL | fn assert_send() { } | ^^^^ required by this bound in `assert_send` diff --git a/src/test/ui/lifetimes/copy_modulo_regions.rs b/src/test/ui/lifetimes/copy_modulo_regions.rs index 1d5d90ffcb4..040fc4a0023 100644 --- a/src/test/ui/lifetimes/copy_modulo_regions.rs +++ b/src/test/ui/lifetimes/copy_modulo_regions.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - #[derive(Clone)] struct Foo<'a>(fn(&'a ()) -> &'a ()); diff --git a/src/test/ui/lifetimes/copy_modulo_regions.stderr b/src/test/ui/lifetimes/copy_modulo_regions.stderr index e027bc45426..87dbb64abd1 100644 --- a/src/test/ui/lifetimes/copy_modulo_regions.stderr +++ b/src/test/ui/lifetimes/copy_modulo_regions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/copy_modulo_regions.rs:14:5 + --> $DIR/copy_modulo_regions.rs:12:5 | LL | fn foo<'a>() -> [Foo<'a>; 100] { | -- lifetime `'a` defined here diff --git a/src/test/ui/lifetimes/issue-79187-2.base.stderr b/src/test/ui/lifetimes/issue-79187-2.base.stderr deleted file mode 100644 index 95591412f7e..00000000000 --- a/src/test/ui/lifetimes/issue-79187-2.base.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-79187-2.rs:12:5 - | -LL | take_foo(|a| a); - | ^^^^^^^^ lifetime mismatch - | - = note: expected type `for<'r> Fn<(&'r i32,)>` - found type `Fn<(&i32,)>` -note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-79187-2.rs:12:14 - | -LL | take_foo(|a| a); - | ^^^^^ -note: the lifetime requirement is introduced here - --> $DIR/issue-79187-2.rs:9:21 - | -LL | fn take_foo(_: impl Foo) {} - | ^^^ - -error[E0308]: mismatched types - --> $DIR/issue-79187-2.rs:16:5 - | -LL | take_foo(|a: &i32| a); - | ^^^^^^^^ lifetime mismatch - | - = note: expected reference `&i32` - found reference `&i32` -note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements - --> $DIR/issue-79187-2.rs:16:14 - | -LL | take_foo(|a: &i32| a); - | ^^^^^^^^^^^ -note: the lifetime requirement is introduced here - --> $DIR/issue-79187-2.rs:9:21 - | -LL | fn take_foo(_: impl Foo) {} - | ^^^ - -error[E0308]: mismatched types - --> $DIR/issue-79187-2.rs:20:5 - | -LL | take_foo(|a: &i32| -> &i32 { a }); - | ^^^^^^^^ lifetime mismatch - | - = note: expected reference `&i32` - found reference `&i32` -note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements - --> $DIR/issue-79187-2.rs:20:14 - | -LL | take_foo(|a: &i32| -> &i32 { a }); - | ^^^^^^^^^^^^^^^^^^^^^^^ -note: the lifetime requirement is introduced here - --> $DIR/issue-79187-2.rs:9:21 - | -LL | fn take_foo(_: impl Foo) {} - | ^^^ - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lifetimes/issue-79187-2.rs b/src/test/ui/lifetimes/issue-79187-2.rs index d122b92f74b..fff92c30b37 100644 --- a/src/test/ui/lifetimes/issue-79187-2.rs +++ b/src/test/ui/lifetimes/issue-79187-2.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo {} impl Foo for F where F: Fn(&i32) -> &i32 {} @@ -10,17 +6,14 @@ fn take_foo(_: impl Foo) {} fn main() { take_foo(|a| a); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR implementation of `FnOnce` is not general enough - //[nll]~| ERROR mismatched types + //~^ ERROR implementation of `FnOnce` is not general enough + //~| ERROR mismatched types take_foo(|a: &i32| a); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR mismatched types + //~^ ERROR lifetime may not live long enough + //~| ERROR mismatched types take_foo(|a: &i32| -> &i32 { a }); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR mismatched types + //~^ ERROR lifetime may not live long enough + //~| ERROR mismatched types // OK take_foo(identity(|a| a)); diff --git a/src/test/ui/lifetimes/issue-79187-2.nll.stderr b/src/test/ui/lifetimes/issue-79187-2.stderr similarity index 87% rename from src/test/ui/lifetimes/issue-79187-2.nll.stderr rename to src/test/ui/lifetimes/issue-79187-2.stderr index 3cbce7600f9..06eac16c88f 100644 --- a/src/test/ui/lifetimes/issue-79187-2.nll.stderr +++ b/src/test/ui/lifetimes/issue-79187-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-79187-2.rs:16:24 + --> $DIR/issue-79187-2.rs:11:24 | LL | take_foo(|a: &i32| a); | - - ^ returning this value requires that `'1` must outlive `'2` @@ -8,7 +8,7 @@ LL | take_foo(|a: &i32| a); | let's call the lifetime of this reference `'1` error: lifetime may not live long enough - --> $DIR/issue-79187-2.rs:20:34 + --> $DIR/issue-79187-2.rs:14:34 | LL | take_foo(|a: &i32| -> &i32 { a }); | - - ^ returning this value requires that `'1` must outlive `'2` @@ -17,7 +17,7 @@ LL | take_foo(|a: &i32| -> &i32 { a }); | let's call the lifetime of this reference `'1` error: implementation of `FnOnce` is not general enough - --> $DIR/issue-79187-2.rs:12:5 + --> $DIR/issue-79187-2.rs:8:5 | LL | take_foo(|a| a); | ^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough @@ -26,7 +26,7 @@ LL | take_foo(|a| a); = note: ...but it actually implements `FnOnce<(&'2 i32,)>`, for some specific lifetime `'2` error[E0308]: mismatched types - --> $DIR/issue-79187-2.rs:12:5 + --> $DIR/issue-79187-2.rs:8:5 | LL | take_foo(|a| a); | ^^^^^^^^^^^^^^^ one type is more general than the other @@ -34,18 +34,18 @@ LL | take_foo(|a| a); = note: expected type `for<'r> Fn<(&'r i32,)>` found type `Fn<(&i32,)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-79187-2.rs:12:14 + --> $DIR/issue-79187-2.rs:8:14 | LL | take_foo(|a| a); | ^^^^^ note: the lifetime requirement is introduced here - --> $DIR/issue-79187-2.rs:9:21 + --> $DIR/issue-79187-2.rs:5:21 | LL | fn take_foo(_: impl Foo) {} | ^^^ error[E0308]: mismatched types - --> $DIR/issue-79187-2.rs:16:5 + --> $DIR/issue-79187-2.rs:11:5 | LL | take_foo(|a: &i32| a); | ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other @@ -53,13 +53,13 @@ LL | take_foo(|a: &i32| a); = note: expected reference `&i32` found reference `&i32` note: the lifetime requirement is introduced here - --> $DIR/issue-79187-2.rs:9:21 + --> $DIR/issue-79187-2.rs:5:21 | LL | fn take_foo(_: impl Foo) {} | ^^^ error[E0308]: mismatched types - --> $DIR/issue-79187-2.rs:20:5 + --> $DIR/issue-79187-2.rs:14:5 | LL | take_foo(|a: &i32| -> &i32 { a }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other @@ -67,7 +67,7 @@ LL | take_foo(|a: &i32| -> &i32 { a }); = note: expected reference `&i32` found reference `&i32` note: the lifetime requirement is introduced here - --> $DIR/issue-79187-2.rs:9:21 + --> $DIR/issue-79187-2.rs:5:21 | LL | fn take_foo(_: impl Foo) {} | ^^^ diff --git a/src/test/ui/lifetimes/issue-79187.base.stderr b/src/test/ui/lifetimes/issue-79187.base.stderr deleted file mode 100644 index c4654ca1517..00000000000 --- a/src/test/ui/lifetimes/issue-79187.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `FnOnce` is not general enough - --> $DIR/issue-79187.rs:9:5 - | -LL | thing(f); - | ^^^^^ implementation of `FnOnce` is not general enough - | - = note: closure with signature `fn(&'2 u32)` must implement `FnOnce<(&'1 u32,)>`, for any lifetime `'1`... - = note: ...but it actually implements `FnOnce<(&'2 u32,)>`, for some specific lifetime `'2` - -error: aborting due to previous error - diff --git a/src/test/ui/lifetimes/issue-79187.rs b/src/test/ui/lifetimes/issue-79187.rs index b97890d94e9..8e13045623b 100644 --- a/src/test/ui/lifetimes/issue-79187.rs +++ b/src/test/ui/lifetimes/issue-79187.rs @@ -1,12 +1,8 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn thing(x: impl FnOnce(&u32)) {} fn main() { let f = |_| (); thing(f); - //[nll]~^ ERROR mismatched types + //~^ ERROR mismatched types //~^^ ERROR implementation of `FnOnce` is not general enough } diff --git a/src/test/ui/lifetimes/issue-79187.nll.stderr b/src/test/ui/lifetimes/issue-79187.stderr similarity index 88% rename from src/test/ui/lifetimes/issue-79187.nll.stderr rename to src/test/ui/lifetimes/issue-79187.stderr index 54dce9b4bac..3a993e88d8a 100644 --- a/src/test/ui/lifetimes/issue-79187.nll.stderr +++ b/src/test/ui/lifetimes/issue-79187.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-79187.rs:9:5 + --> $DIR/issue-79187.rs:5:5 | LL | thing(f); | ^^^^^^^^ one type is more general than the other @@ -7,18 +7,18 @@ LL | thing(f); = note: expected type `for<'r> FnOnce<(&'r u32,)>` found type `FnOnce<(&u32,)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-79187.rs:8:13 + --> $DIR/issue-79187.rs:4:13 | LL | let f = |_| (); | ^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/issue-79187.rs:5:18 + --> $DIR/issue-79187.rs:1:18 | LL | fn thing(x: impl FnOnce(&u32)) {} | ^^^^^^^^^^^^ error: implementation of `FnOnce` is not general enough - --> $DIR/issue-79187.rs:9:5 + --> $DIR/issue-79187.rs:5:5 | LL | thing(f); | ^^^^^^^^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed b/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed deleted file mode 100644 index 4b417afb038..00000000000 --- a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.fixed +++ /dev/null @@ -1,15 +0,0 @@ -// FIXME(nll): On NLL stabilization, this should be replace -// `issue-90170-elision-mismatch.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll -// compile-flags: -Zborrowck=mir - -// run-rustfix - -pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough - -pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough - -pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough - -fn main() {} diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs b/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs deleted file mode 100644 index ec50e8e1d9a..00000000000 --- a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.rs +++ /dev/null @@ -1,15 +0,0 @@ -// FIXME(nll): On NLL stabilization, this should be replace -// `issue-90170-elision-mismatch.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll -// compile-flags: -Zborrowck=mir - -// run-rustfix - -pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough - -pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough - -pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough - -fn main() {} diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr b/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr deleted file mode 100644 index 144fe3bf9da..00000000000 --- a/src/test/ui/lifetimes/issue-90170-elision-mismatch-nll.stderr +++ /dev/null @@ -1,44 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/issue-90170-elision-mismatch-nll.rs:9:40 - | -LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } - | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` - | | | - | | let's call the lifetime of this reference `'1` - | let's call the lifetime of this reference `'2` - | -help: consider introducing a named lifetime parameter - | -LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } - | ++++ ++ ++ - -error: lifetime may not live long enough - --> $DIR/issue-90170-elision-mismatch-nll.rs:11:44 - | -LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } - | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` - | | | - | | let's call the lifetime of this reference `'1` - | let's call the lifetime of this reference `'2` - | -help: consider introducing a named lifetime parameter - | -LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } - | ++++ ~~ ++ - -error: lifetime may not live long enough - --> $DIR/issue-90170-elision-mismatch-nll.rs:13:63 - | -LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } - | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` - | | | - | | let's call the lifetime of this reference `'1` - | let's call the lifetime of this reference `'2` - | -help: consider introducing a named lifetime parameter - | -LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } - | ++ ++ - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed b/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed index f05943284f7..bd85da1a763 100644 --- a/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed +++ b/src/test/ui/lifetimes/issue-90170-elision-mismatch.fixed @@ -1,14 +1,9 @@ -// FIXME(nll): On NLL stabilization, this should be replaced by -// `issue-90170-elision-mismatch-nll.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll - // run-rustfix -pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime mismatch +pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough -pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime mismatch +pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough -pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime mismatch +pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } //~ ERROR lifetime may not live long enough fn main() {} diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs b/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs index fee2b461ef9..3c495368bbc 100644 --- a/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs +++ b/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs @@ -1,14 +1,9 @@ -// FIXME(nll): On NLL stabilization, this should be replaced by -// `issue-90170-elision-mismatch-nll.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll - // run-rustfix -pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch +pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough -pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch +pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough -pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch +pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough fn main() {} diff --git a/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr b/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr index 28f3957041c..48fb3fb4a22 100644 --- a/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr +++ b/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr @@ -1,40 +1,40 @@ -error[E0623]: lifetime mismatch - --> $DIR/issue-90170-elision-mismatch.rs:8:47 +error: lifetime may not live long enough + --> $DIR/issue-90170-elision-mismatch.rs:3:40 | LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } - | --- --- ^ ...but data from `y` flows into `x` here - | | - | these two types are declared with different lifetimes... + | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` + | | | + | | let's call the lifetime of this reference `'1` + | let's call the lifetime of this reference `'2` | - = note: each elided lifetime in input position becomes a distinct lifetime help: consider introducing a named lifetime parameter | LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } | ++++ ++ ++ -error[E0623]: lifetime mismatch - --> $DIR/issue-90170-elision-mismatch.rs:10:51 +error: lifetime may not live long enough + --> $DIR/issue-90170-elision-mismatch.rs:5:44 | LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } - | ------ --- ^ ...but data from `y` flows into `x` here - | | - | these two types are declared with different lifetimes... + | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` + | | | + | | let's call the lifetime of this reference `'1` + | let's call the lifetime of this reference `'2` | - = note: each elided lifetime in input position becomes a distinct lifetime help: consider introducing a named lifetime parameter | LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } | ++++ ~~ ++ -error[E0623]: lifetime mismatch - --> $DIR/issue-90170-elision-mismatch.rs:12:70 +error: lifetime may not live long enough + --> $DIR/issue-90170-elision-mismatch.rs:7:63 | LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } - | --- --- ^ ...but data from `y` flows into `x` here - | | - | these two types are declared with different lifetimes... + | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` + | | | + | | let's call the lifetime of this reference `'1` + | let's call the lifetime of this reference `'2` | - = note: each elided lifetime in input position becomes a distinct lifetime help: consider introducing a named lifetime parameter | LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } @@ -42,4 +42,3 @@ LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push( error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr deleted file mode 100644 index b20ce7b07ff..00000000000 --- a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0759]: `foo` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/issue-90600-expected-return-static-indirect.rs:11:32 - | -LL | fn inner(mut foo: &[u8]) { - | ----- this data with an anonymous lifetime `'_`... -LL | let refcell = RefCell::new(&mut foo); - | ^^^^^^^^ ...is used here... -... -LL | read_thing(read); - | ---- ...and is required to live as long as `'static` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs index fa44be9a912..ce4cddc9b39 100644 --- a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs +++ b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::cell::RefCell; use std::io::Read; @@ -9,10 +5,9 @@ fn main() {} fn inner(mut foo: &[u8]) { let refcell = RefCell::new(&mut foo); - //[base]~^ ERROR `foo` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR `foo` does not live long enough + //~^ ERROR `foo` does not live long enough let read = &refcell as &RefCell; - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough read_thing(read); } diff --git a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.nll.stderr b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr similarity index 85% rename from src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.nll.stderr rename to src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr index b35505ac8c5..99e1e7217b4 100644 --- a/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.nll.stderr +++ b/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr @@ -1,9 +1,9 @@ error[E0597]: `foo` does not live long enough - --> $DIR/issue-90600-expected-return-static-indirect.rs:11:32 + --> $DIR/issue-90600-expected-return-static-indirect.rs:7:32 | LL | let refcell = RefCell::new(&mut foo); | ^^^^^^^^ borrowed value does not live long enough -... +LL | LL | let read = &refcell as &RefCell; | -------- cast requires that `foo` is borrowed for `'static` ... @@ -11,7 +11,7 @@ LL | } | - `foo` dropped here while still borrowed error: lifetime may not live long enough - --> $DIR/issue-90600-expected-return-static-indirect.rs:14:16 + --> $DIR/issue-90600-expected-return-static-indirect.rs:9:16 | LL | fn inner(mut foo: &[u8]) { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr deleted file mode 100644 index 54fa49b47f6..00000000000 --- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.base.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/lifetime-bound-will-change-warning.rs:38:13 - | -LL | ref_obj(x) - | ^ lifetime mismatch - | - = note: expected reference `&Box<(dyn Fn() + 'static)>` - found reference `&Box<(dyn Fn() + 'a)>` -note: the lifetime `'a` as defined here... - --> $DIR/lifetime-bound-will-change-warning.rs:36:10 - | -LL | fn test2<'a>(x: &'a Box) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/lifetime-bound-will-change-warning.rs:45:18 - | -LL | lib::ref_obj(x) - | ^ lifetime mismatch - | - = note: expected reference `&Box<(dyn Fn() + 'static)>` - found reference `&Box<(dyn Fn() + 'a)>` -note: the lifetime `'a` as defined here... - --> $DIR/lifetime-bound-will-change-warning.rs:43:12 - | -LL | fn test2cc<'a>(x: &'a Box) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs index 0a082e1bae8..0d030370527 100644 --- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs +++ b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // aux-build:lifetime_bound_will_change_warning_lib.rs // Test that various corner cases cause an error. These are tests @@ -36,15 +32,13 @@ fn test1cc<'a>(x: &'a Box) { fn test2<'a>(x: &'a Box) { // but ref_obj will not, so warn. ref_obj(x) - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR borrowed data escapes + //~^ ERROR borrowed data escapes } fn test2cc<'a>(x: &'a Box) { // same as test2, but cross crate lib::ref_obj(x) - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR borrowed data escapes + //~^ ERROR borrowed data escapes } fn test3<'a>(x: &'a Box) { diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr similarity index 90% rename from src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr rename to src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr index 10105c5ccec..c51580f287e 100644 --- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of function - --> $DIR/lifetime-bound-will-change-warning.rs:38:5 + --> $DIR/lifetime-bound-will-change-warning.rs:34:5 | LL | fn test2<'a>(x: &'a Box) { | -- - `x` is a reference that is only valid in the function body @@ -13,7 +13,7 @@ LL | ref_obj(x) | argument requires that `'a` must outlive `'static` error[E0521]: borrowed data escapes outside of function - --> $DIR/lifetime-bound-will-change-warning.rs:45:5 + --> $DIR/lifetime-bound-will-change-warning.rs:40:5 | LL | fn test2cc<'a>(x: &'a Box) { | -- - `x` is a reference that is only valid in the function body diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr deleted file mode 100644 index 60cd3493875..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:15:20 - | -LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 { - | ---- ------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | -LL | if x > y { x } else { y } - | ^ ...but data from `x` is returned here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs index fbb523daa1f..f0d73deb3cc 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo { fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32; @@ -13,8 +9,7 @@ impl Foo for () { fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 { if x > y { x } else { y } - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr similarity index 87% rename from src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr index f8e275e9b14..4c788211576 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:15:20 + --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:11:20 | LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 { | -- - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr deleted file mode 100644 index 697950a00fb..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:12:5 - | -LL | fn foo<'a>(&self, x: &'a i32) -> &i32 { - | ------- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | -LL | x - | ^ ...but data from `x` is returned here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs index 704db7dc8b4..49993aca3ca 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Foo { field: i32 } @@ -10,8 +6,7 @@ impl Foo { fn foo<'a>(&self, x: &'a i32) -> &i32 { x - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr similarity index 85% rename from src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr index 97af4b58cbf..11e7fa96d7e 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:12:5 + --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:8:5 | LL | fn foo<'a>(&self, x: &'a i32) -> &i32 { | -- - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr deleted file mode 100644 index 65644d03cdc..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:12:30 - | -LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo { - | ----- ------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | -LL | if true { x } else { self } - | ^^^^ ...but data from `self` is returned here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs index a846c115c06..63d81a57d5d 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Foo { field: i32, } @@ -10,8 +6,7 @@ impl Foo { fn foo<'a>(&self, x: &'a Foo) -> &'a Foo { if true { x } else { self } - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr similarity index 88% rename from src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr index 00a348de4bc..c41f08e691a 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:12:30 + --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:8:30 | LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo { | -- - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr deleted file mode 100644 index 9203d6603bd..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/ex2a-push-one-existing-name-2.rs:10:12 - | -LL | fn foo<'a>(x: Ref, y: &mut Vec>) { - | -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>` -LL | y.push(x); - | ^ lifetime `'a` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs index 7e776baa6a9..998a48ce20c 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, T: 'a> { data: &'a T } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr similarity index 88% rename from src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr index 5ab8b449816..90d4754ebab 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/ex2a-push-one-existing-name-2.rs:10:5 + --> $DIR/ex2a-push-one-existing-name-2.rs:6:5 | LL | fn foo<'a>(x: Ref, y: &mut Vec>) { | -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr deleted file mode 100644 index ec1ab19d5a4..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `y` - --> $DIR/ex2a-push-one-existing-name-early-bound.rs:12:12 - | -LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T) - | -- help: add explicit lifetime `'a` to the type of `y`: `&'a T` -... -LL | x.push(y); - | ^ lifetime `'a` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs index 73613a9bf35..d18b50d0d0c 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo<'a> {} impl<'a, T> Foo<'a> for T {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr similarity index 87% rename from src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr index bd5864bae32..a03e16b3b79 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `y` - --> $DIR/ex2a-push-one-existing-name-early-bound.rs:12:5 + --> $DIR/ex2a-push-one-existing-name-early-bound.rs:8:5 | LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T) | -- help: add explicit lifetime `'a` to the type of `y`: `&'a T` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr deleted file mode 100644 index ab0e202a32e..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `y` - --> $DIR/ex2a-push-one-existing-name.rs:10:12 - | -LL | fn foo<'a>(x: &mut Vec>, y: Ref) { - | -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>` -LL | x.push(y); - | ^ lifetime `'a` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs index 5773e13304c..5188ea1cc9c 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, T: 'a> { data: &'a T } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr similarity index 89% rename from src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr index 01b7f45d81b..487b34e3d18 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `y` - --> $DIR/ex2a-push-one-existing-name.rs:10:5 + --> $DIR/ex2a-push-one-existing-name.rs:6:5 | LL | fn foo<'a>(x: &mut Vec>, y: Ref) { | -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr deleted file mode 100644 index 58a2088df5e..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex2b-push-no-existing-names.rs:10:12 - | -LL | fn foo(x: &mut Vec>, y: Ref) { - | -------- -------- these two types are declared with different lifetimes... -LL | x.push(y); - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs index 8d830343b08..27424d79bc0 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs @@ -1,15 +1,10 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, T: 'a> { data: &'a T } fn foo(x: &mut Vec>, y: Ref) { x.push(y); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr similarity index 87% rename from src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr index afe413bcca5..1622ce42290 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex2b-push-no-existing-names.rs:10:5 + --> $DIR/ex2b-push-no-existing-names.rs:6:5 | LL | fn foo(x: &mut Vec>, y: Ref) { | - - has type `Ref<'1, i32>` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr deleted file mode 100644 index 63033b8d16e..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex2c-push-inference-variable.rs:11:12 - | -LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { - | ------------ ------------ these two types are declared with different lifetimes... -LL | let z = Ref { data: y.data }; -LL | x.push(z); - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs index f676eb403a8..2236d78ef4b 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, T: 'a> { data: &'a T } @@ -9,8 +5,7 @@ struct Ref<'a, T: 'a> { fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { let z = Ref { data: y.data }; x.push(z); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr similarity index 90% rename from src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr index 63a0f2409d9..99fab4631a2 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex2c-push-inference-variable.rs:11:5 + --> $DIR/ex2c-push-inference-variable.rs:7:5 | LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { | -- -- lifetime `'c` defined here diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr deleted file mode 100644 index a50985ca704..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex2d-push-inference-variable-2.rs:10:33 - | -LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { - | ------------ ------------ these two types are declared with different lifetimes... -LL | let a: &mut Vec> = x; - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs index e65638fb0df..f573230293e 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs @@ -1,17 +1,12 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, T: 'a> { data: &'a T } fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { let a: &mut Vec> = x; - //[base]~^ ERROR lifetime mismatch let b = Ref { data: y.data }; a.push(b); - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr similarity index 89% rename from src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr index 0d7461fa682..52c5752f6ea 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex2d-push-inference-variable-2.rs:13:5 + --> $DIR/ex2d-push-inference-variable-2.rs:8:5 | LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { | -- -- lifetime `'c` defined here diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr deleted file mode 100644 index dbe965a340c..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex2e-push-inference-variable-3.rs:10:33 - | -LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { - | ------------ ------------ these two types are declared with different lifetimes... -LL | let a: &mut Vec> = x; - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs index 036afe09be6..4a934bbf080 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs @@ -1,17 +1,12 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, T: 'a> { data: &'a T } fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { let a: &mut Vec> = x; - //[base]~^ ERROR lifetime mismatch let b = Ref { data: y.data }; Vec::push(a, b); - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr similarity index 89% rename from src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr index 74b2739b2c3..e90c81ee3e1 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex2e-push-inference-variable-3.rs:13:5 + --> $DIR/ex2e-push-inference-variable-3.rs:8:5 | LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { | -- -- lifetime `'c` defined here diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr deleted file mode 100644 index 459f18dcc3d..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-2.rs:6:10 - | -LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) { - | --- --- these two types are declared with different lifetimes... -LL | *v = x; - | ^ ...but data from `x` flows here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn foo<'a>(&mut (ref mut v, w): &mut (&'a u8, &u8), x: &'a u8) { - | ++++ ++ ++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs index 668cadd614b..09ee9accccd 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs @@ -1,11 +1,6 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) { *v = x; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr similarity index 93% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr index b072c12ea3b..5a23f1e0e9d 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-2.rs:6:5 + --> $DIR/ex3-both-anon-regions-2.rs:2:5 | LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr deleted file mode 100644 index 28df5f18369..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.base.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-3.rs:6:13 - | -LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) { - | --- --- these two types are declared with different lifetimes... -LL | z.push((x,y)); - | ^ ...but data flows into `z` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn foo<'a>(z: &mut Vec<(&'a u8,&u8)>, (x, y): (&'a u8, &u8)) { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-3.rs:6:15 - | -LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) { - | --- --- these two types are declared with different lifetimes... -LL | z.push((x,y)); - | ^ ...but data flows into `z` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn foo<'a>(z: &mut Vec<(&u8,&'a u8)>, (x, y): (&u8, &'a u8)) { - | ++++ ++ ++ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs index 4d7fd63e5b9..b3106db776f 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs @@ -1,13 +1,7 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) { z.push((x,y)); - //[base]~^ ERROR lifetime mismatch - //[base]~| ERROR lifetime mismatch - //[nll]~^^^ ERROR lifetime may not live long enough - //[nll]~| ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr similarity index 93% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr index c1d809abad5..6ba130308a3 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-3.rs:6:5 + --> $DIR/ex3-both-anon-regions-3.rs:2:5 | LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn foo<'a>(z: &mut Vec<(&'a u8,&u8)>, (x, y): (&'a u8, &u8)) { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-3.rs:6:5 + --> $DIR/ex3-both-anon-regions-3.rs:2:5 | LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) { | - - let's call the lifetime of this reference `'3` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr deleted file mode 100644 index 32263cd56ee..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:11:11 - | -LL | fn foo(mut x: Ref, y: Ref) { - | --- --- these two types are declared with different lifetimes... -LL | x.b = y.b; - | ^^^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs index 30764e2ad17..5d0367783b8 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, 'b> { a: &'a u32, b: &'b u32, @@ -9,8 +5,7 @@ struct Ref<'a, 'b> { fn foo(mut x: Ref, y: Ref) { x.b = y.b; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr similarity index 83% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr index bfde4025194..4c0ffe5c090 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:11:5 + --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:7:5 | LL | fn foo(mut x: Ref, y: Ref) { | ----- - has type `Ref<'_, '1>` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr deleted file mode 100644 index fb4a2f8f6fe..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:11:11 - | -LL | fn foo(mut x: Ref) { - | --- this type is declared with multiple lifetimes... -LL | x.a = x.b; - | ^^^ ...but data with one lifetime flows into the other here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs index 665be2aa2c8..4a479f19c72 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, 'b> { a: &'a u32, b: &'b u32, @@ -9,8 +5,7 @@ struct Ref<'a, 'b> { fn foo(mut x: Ref) { x.a = x.b; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr similarity index 83% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr index 9ba2c38d6fe..97c665347f6 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:11:5 + --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:7:5 | LL | fn foo(mut x: Ref) { | ----- diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr deleted file mode 100644 index 66a993e0340..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:13:12 - | -LL | fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) - | ------- ------- these two types are declared with different lifetimes... -... -LL | x.push(y); - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs index 6e151879f4d..9b8cfe670e6 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a> { x: &'a u32, } @@ -11,8 +7,7 @@ fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) &'b u32: Sized { x.push(y); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr similarity index 97% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr index ddf878ba9f9..b3d0bc2b882 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:13:5 + --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:9:5 | LL | fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) | -- -- lifetime `'b` defined here diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr deleted file mode 100644 index 5453dbb08f1..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:10:12 - | -LL | fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) { - | ------- ------- these two types are declared with different lifetimes... -LL | x.push(y); - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs index ecc04fbc8ad..db934a0bede 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs @@ -1,15 +1,10 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a> { x: &'a u32, } fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) { x.push(y); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr similarity index 97% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr index cfd3186c809..fbe98a4263e 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:10:5 + --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:6:5 | LL | fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr deleted file mode 100644 index 23e752e4a0e..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-both-are-structs.rs:10:12 - | -LL | fn foo(mut x: Vec, y: Ref) { - | --- --- these two types are declared with different lifetimes... -LL | x.push(y); - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs index f002dfc208f..4bf5db41f4e 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs @@ -1,15 +1,10 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a> { x: &'a u32, } fn foo(mut x: Vec, y: Ref) { x.push(y); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr similarity index 84% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr index fa906a90ccc..9630729d0ee 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-both-are-structs.rs:10:5 + --> $DIR/ex3-both-anon-regions-both-are-structs.rs:6:5 | LL | fn foo(mut x: Vec, y: Ref) { | ----- - has type `Ref<'1>` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr deleted file mode 100644 index b5fbc091ebc..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-latebound-regions.rs:6:12 - | -LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) { - | ------ ------ these two types are declared with different lifetimes... -LL | x.push(y); - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs index f0a81eba412..8dcb814b28b 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs @@ -1,11 +1,6 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) { x.push(y); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr similarity index 86% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr index d59bee08748..1e24032fc1c 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-latebound-regions.rs:6:5 + --> $DIR/ex3-both-anon-regions-latebound-regions.rs:2:5 | LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr deleted file mode 100644 index 3d9138f02c6..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.base.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:8:9 - | -LL | fn foo(mut x: Ref, y: &u32) { - | --- ---- - | | - | these two types are declared with different lifetimes... -LL | y = x.b; - | ^^^ ...but data from `x` flows into `y` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs index 31ef28e726d..e4df870bc00 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs @@ -1,14 +1,9 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 } fn foo(mut x: Ref, y: &u32) { y = x.b; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR cannot assign to immutable argument + //~^ ERROR lifetime may not live long enough + //~| ERROR cannot assign to immutable argument } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr similarity index 85% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr index cac2a9470a8..bbd62902d9f 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:8:5 + --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:4:5 | LL | fn foo(mut x: Ref, y: &u32) { | ----- - let's call the lifetime of this reference `'2` @@ -9,7 +9,7 @@ LL | y = x.b; | ^^^^^^^ assignment requires that `'1` must outlive `'2` error[E0384]: cannot assign to immutable argument `y` - --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:8:5 + --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:4:5 | LL | fn foo(mut x: Ref, y: &u32) { | - help: consider making this binding mutable: `mut y` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr deleted file mode 100644 index 77e035562a8..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:8:11 - | -LL | fn foo(mut y: Ref, x: &u32) { - | --- ---- these two types are declared with different lifetimes... -LL | y.b = x; - | ^ ...but data from `x` flows into `y` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs index 9a5ac0a9769..00de48278b2 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs @@ -1,13 +1,8 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 } fn foo(mut y: Ref, x: &u32) { y.b = x; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr similarity index 85% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr index ba41cc3e908..79e7e8e157d 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:8:5 + --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:4:5 | LL | fn foo(mut y: Ref, x: &u32) { | ----- - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr deleted file mode 100644 index 6cbbabb150a..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:8:11 - | -LL | fn foo(mut y: Ref, x: &u32) { - | --- ---- these two types are declared with different lifetimes... -LL | y.b = x; - | ^ ...but data from `x` flows into `y` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs index 9a5ac0a9769..00de48278b2 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs @@ -1,13 +1,8 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 } fn foo(mut y: Ref, x: &u32) { y.b = x; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr similarity index 85% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr index c9570aa7206..53615fd1aba 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:8:5 + --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:4:5 | LL | fn foo(mut y: Ref, x: &u32) { | ----- - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr deleted file mode 100644 index 7caf19e8935..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-one-is-struct.rs:11:11 - | -LL | fn foo(mut x: Ref, y: &u32) { - | --- ---- these two types are declared with different lifetimes... -LL | x.b = y; - | ^ ...but data from `y` flows into `x` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs index 0b4ee5adacc..5bb0e28d46f 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Ref<'a, 'b> { a: &'a u32, b: &'b u32, @@ -9,8 +5,7 @@ struct Ref<'a, 'b> { fn foo(mut x: Ref, y: &u32) { x.b = y; - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr similarity index 85% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr index 9b295248fc9..6ff44116737 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-one-is-struct.rs:11:5 + --> $DIR/ex3-both-anon-regions-one-is-struct.rs:7:5 | LL | fn foo(mut x: Ref, y: &u32) { | ----- - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr deleted file mode 100644 index add05a11193..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.base.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:11:5 - | -LL | fn foo<'a>(&self, x: &i32) -> &i32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | x - | ^ ...but data from `x` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn foo<'a>(&'a self, x: &'a i32) -> &i32 { - | ++ ++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs index a4f838c0747..3ffd7be4e73 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Foo { field: i32 } @@ -9,8 +5,7 @@ struct Foo { impl Foo { fn foo<'a>(&self, x: &i32) -> &i32 { x - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr similarity index 90% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr index 188ff4d77e0..5601335d275 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:11:5 + --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:7:5 | LL | fn foo<'a>(&self, x: &i32) -> &i32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr deleted file mode 100644 index 365a0ab3b10..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.base.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-self-is-anon.rs:11:19 - | -LL | fn foo<'a>(&self, x: &Foo) -> &Foo { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | if true { x } else { self } - | ^ ...but data from `x` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn foo<'a>(&'a self, x: &'a Foo) -> &Foo { - | ++ ++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs index c5854537a5f..9b67a774264 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Foo { field: i32, } @@ -9,8 +5,7 @@ struct Foo { impl Foo { fn foo<'a>(&self, x: &Foo) -> &Foo { if true { x } else { self } - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr similarity index 92% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr index ed9b81f7d01..e221902c4a9 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-self-is-anon.rs:11:19 + --> $DIR/ex3-both-anon-regions-self-is-anon.rs:7:19 | LL | fn foo<'a>(&self, x: &Foo) -> &Foo { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr deleted file mode 100644 index 755e9798170..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-using-fn-items.rs:6:10 - | -LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) { - | --- --- these two types are declared with different lifetimes... -LL | y.push(z); - | ^ ...but data from `z` flows into `y` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn foo<'a>(x:fn(&u8, &u8), y: Vec<&'a u8>, z: &'a u8) { - | ++++ ++ ++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs index 4b2280b66f2..2f67750d89b 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs @@ -1,12 +1,7 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) { y.push(z); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR cannot borrow + //~^ ERROR lifetime may not live long enough + //~| ERROR cannot borrow } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr similarity index 89% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr index 904a09610fc..a909c5fa823 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-using-fn-items.rs:6:3 + --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3 | LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn foo<'a>(x:fn(&u8, &u8), y: Vec<&'a u8>, z: &'a u8) { | ++++ ++ ++ error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable - --> $DIR/ex3-both-anon-regions-using-fn-items.rs:6:3 + --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3 | LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) { | - help: consider changing this to be mutable: `mut y` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr deleted file mode 100644 index 6a8b07dbec8..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-using-impl-items.rs:10:16 - | -LL | fn foo(x: &mut Vec<&u8>, y: &u8) { - | --- --- these two types are declared with different lifetimes... -LL | x.push(y); - | ^ ...but data from `y` flows into `x` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { - | ++++ ++ ++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs index 242a2d6fd4f..73e1789f225 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs @@ -1,15 +1,10 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo { fn foo<'a>(x: &mut Vec<&u8>, y: &u8); } impl Foo for () { fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } fn main() {} diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr similarity index 91% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr index 46b9e98907d..9661f1e5144 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-using-impl-items.rs:10:9 + --> $DIR/ex3-both-anon-regions-using-impl-items.rs:6:9 | LL | fn foo(x: &mut Vec<&u8>, y: &u8) { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr deleted file mode 100644 index e38dd0fc6ee..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:6:10 - | -LL | fn foo(x:Box , y: Vec<&u8>, z: &u8) { - | --- --- these two types are declared with different lifetimes... -LL | y.push(z); - | ^ ...but data from `z` flows into `y` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn foo<'a>(x:Box , y: Vec<&u8>, z: &u8) { - | ++++ ++ ++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs index b93d75b156d..97fa9ef914f 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs @@ -1,12 +1,7 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(x:Box , y: Vec<&u8>, z: &u8) { y.push(z); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR cannot borrow + //~^ ERROR lifetime may not live long enough + //~| ERROR cannot borrow } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr similarity index 89% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr index 54172a845d7..cce0a31bfbb 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:6:3 + --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3 | LL | fn foo(x:Box , y: Vec<&u8>, z: &u8) { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn foo<'a>(x:Box , y: Vec<&u8>, z: &u8) { | ++++ ++ ++ error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable - --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:6:3 + --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3 | LL | fn foo(x:Box , y: Vec<&u8>, z: &u8) { | - help: consider changing this to be mutable: `mut y` diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr deleted file mode 100644 index dd96c6eef68..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ex3-both-anon-regions.rs:6:12 - | -LL | fn foo(x: &mut Vec<&u8>, y: &u8) { - | --- --- these two types are declared with different lifetimes... -LL | x.push(y); - | ^ ...but data from `y` flows into `x` here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { - | ++++ ++ ++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs index b1d30e83b62..ca0feaba851 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs @@ -1,11 +1,6 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr similarity index 93% rename from src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr index 48e09e37241..ec9fac0c288 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions.rs:6:5 + --> $DIR/ex3-both-anon-regions.rs:2:5 | LL | fn foo(x: &mut Vec<&u8>, y: &u8) { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr b/src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr deleted file mode 100644 index ba672f29718..00000000000 --- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `FnOnce` is not general enough - --> $DIR/issue_74400.rs:16:5 - | -LL | f(data, identity) - | ^ implementation of `FnOnce` is not general enough - | - = note: `fn(&'2 T) -> &'2 T {identity::<&'2 T>}` must implement `FnOnce<(&'1 T,)>`, for any lifetime `'1`... - = note: ...but it actually implements `FnOnce<(&'2 T,)>`, for some specific lifetime `'2` - -error: aborting due to previous error - diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs b/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs index fdaf2f8a591..ddb8bacce8f 100644 --- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs +++ b/src/test/ui/lifetimes/lifetime-errors/issue_74400.rs @@ -1,10 +1,6 @@ //! Regression test for #74400: Type mismatch in function arguments E0631, E0271 are falsely //! recognized as E0308 mismatched types. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::convert::identity; fn main() {} @@ -14,8 +10,7 @@ fn f(data: &[T], key: impl Fn(&T) -> S) { fn g(data: &[T]) { f(data, identity) - //[base]~^ ERROR implementation of `FnOnce` is not general - //[nll]~^^ ERROR the parameter type - //[nll]~| ERROR mismatched types - //[nll]~| ERROR implementation of `FnOnce` is not general + //~^ ERROR the parameter type + //~| ERROR mismatched types + //~| ERROR implementation of `FnOnce` is not general } diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr similarity index 90% rename from src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr index 645d14cd54b..2906c05864b 100644 --- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/issue_74400.rs:16:5 + --> $DIR/issue_74400.rs:12:5 | LL | f(data, identity) | ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -10,7 +10,7 @@ LL | fn g(data: &[T]) { | +++++++++ error[E0308]: mismatched types - --> $DIR/issue_74400.rs:16:5 + --> $DIR/issue_74400.rs:12:5 | LL | f(data, identity) | ^^^^^^^^^^^^^^^^^ one type is more general than the other @@ -18,13 +18,13 @@ LL | f(data, identity) = note: expected type `for<'r> Fn<(&'r T,)>` found type `Fn<(&T,)>` note: the lifetime requirement is introduced here - --> $DIR/issue_74400.rs:12:34 + --> $DIR/issue_74400.rs:8:34 | LL | fn f(data: &[T], key: impl Fn(&T) -> S) { | ^^^^^^^^^^^ error: implementation of `FnOnce` is not general enough - --> $DIR/issue_74400.rs:16:5 + --> $DIR/issue_74400.rs:12:5 | LL | f(data, identity) | ^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/lifetimes/re-empty-in-error.base.stderr b/src/test/ui/lifetimes/re-empty-in-error.base.stderr deleted file mode 100644 index 7dfe23f4f01..00000000000 --- a/src/test/ui/lifetimes/re-empty-in-error.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0477]: the type `&'b ()` does not fulfill the required lifetime - --> $DIR/re-empty-in-error.rs:12:5 - | -LL | foo(&10); - | ^^^ - | -note: type must outlive the empty lifetime as required by this binding - --> $DIR/re-empty-in-error.rs:7:47 - | -LL | fn foo<'a>(_a: &'a u32) where for<'b> &'b (): 'a { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/lifetimes/re-empty-in-error.rs b/src/test/ui/lifetimes/re-empty-in-error.rs index fdb0a3002c4..554028a9669 100644 --- a/src/test/ui/lifetimes/re-empty-in-error.rs +++ b/src/test/ui/lifetimes/re-empty-in-error.rs @@ -1,16 +1,10 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // We didn't have a single test mentioning // `ReEmpty` and this test changes that. fn foo<'a>(_a: &'a u32) where for<'b> &'b (): 'a { - //[base]~^ NOTE type must outlive the empty lifetime as required by this binding } fn main() { foo(&10); - //[base]~^ ERROR the type `&'b ()` does not fulfill the required lifetime - //[nll]~^^ ERROR higher-ranked lifetime error - //[nll]~| NOTE could not prove + //~^ ERROR higher-ranked lifetime error + //~| NOTE could not prove } diff --git a/src/test/ui/lifetimes/re-empty-in-error.nll.stderr b/src/test/ui/lifetimes/re-empty-in-error.stderr similarity index 82% rename from src/test/ui/lifetimes/re-empty-in-error.nll.stderr rename to src/test/ui/lifetimes/re-empty-in-error.stderr index cddb5732f98..3a5ab62ab96 100644 --- a/src/test/ui/lifetimes/re-empty-in-error.nll.stderr +++ b/src/test/ui/lifetimes/re-empty-in-error.stderr @@ -1,5 +1,5 @@ error: higher-ranked lifetime error - --> $DIR/re-empty-in-error.rs:12:5 + --> $DIR/re-empty-in-error.rs:7:5 | LL | foo(&10); | ^^^^^^^^ diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr index 4448f9326cb..0d61311350e 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.basenoleak.stderr @@ -1,17 +1,8 @@ -error[E0308]: `match` arms have incompatible types +error[E0308]: mismatched types --> $DIR/old-lub-glb-hr-noteq1.rs:17:14 | -LL | let z = match 22 { - | _____________- -LL | | 0 => x, - | | - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` -LL | | _ => y, - | | ^ one type is more general than the other -LL | | -... | -LL | | -LL | | }; - | |_____- `match` arms have incompatible types +LL | _ => y, + | ^ one type is more general than the other | = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8` diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.basenoleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.leak.stderr similarity index 54% rename from src/test/ui/lub-glb/old-lub-glb-hr-noteq2.basenoleak.stderr rename to src/test/ui/lub-glb/old-lub-glb-hr-noteq1.leak.stderr index 1c9ce115e96..dd0fdf3a12a 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.basenoleak.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.leak.stderr @@ -1,20 +1,19 @@ error[E0308]: `match` arms have incompatible types - --> $DIR/old-lub-glb-hr-noteq2.rs:28:14 + --> $DIR/old-lub-glb-hr-noteq1.rs:14:14 | LL | let z = match 22 { | _____________- -LL | | 0 => y, - | | - this is found to be of type `for<'a> fn(&'a u8, &'a u8) -> &'a u8` -LL | | _ => x, +LL | | 0 => x, + | | - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` +LL | | _ => y, | | ^ one type is more general than the other LL | | LL | | -LL | | LL | | }; | |_____- `match` arms have incompatible types | - = note: expected fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8` - found fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` + = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` + found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8` error: aborting due to previous error diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr index 4448f9326cb..217392aa35b 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr @@ -1,21 +1,2 @@ -error[E0308]: `match` arms have incompatible types - --> $DIR/old-lub-glb-hr-noteq1.rs:17:14 - | -LL | let z = match 22 { - | _____________- -LL | | 0 => x, - | | - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` -LL | | _ => y, - | | ^ one type is more general than the other -LL | | -... | -LL | | -LL | | }; - | |_____- `match` arms have incompatible types - | - = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` - found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8` +error: unknown debugging option: `borrowck` -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr index 0d61311350e..217392aa35b 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr @@ -1,12 +1,2 @@ -error[E0308]: mismatched types - --> $DIR/old-lub-glb-hr-noteq1.rs:17:14 - | -LL | _ => y, - | ^ one type is more general than the other - | - = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` - found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8` +error: unknown debugging option: `borrowck` -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr new file mode 100644 index 00000000000..cb046d0b0ac --- /dev/null +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.noleak.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/old-lub-glb-hr-noteq1.rs:14:14 + | +LL | _ => y, + | ^ one type is more general than the other + | + = note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` + found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs index 2cf123cce7f..589119abb9b 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.rs @@ -2,11 +2,8 @@ // general than the other. Test the case where the more general type (`x`) is the first // match arm specifically. -// revisions: baseleak basenoleak nllleak nllnoleak -// ignore-compare-mode-nll -//[nllleak] compile-flags: -Zborrowck=mir -//[nllnoleak] compile-flags: -Zborrowck=mir -Zno-leak-check -//[basenoleak] compile-flags:-Zno-leak-check +// revisions: leak noleak +//[noleak] compile-flags:-Zno-leak-check fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8) -> &'a u8) { // The two types above are not equivalent. With the older LUB/GLB @@ -15,10 +12,8 @@ fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8 let z = match 22 { 0 => x, _ => y, - //[baseleak]~^ ERROR `match` arms have incompatible types - //[nllleak]~^^ ERROR `match` arms have incompatible types - //[basenoleak]~^^^ ERROR `match` arms have incompatible types - //[nllnoleak]~^^^^ ERROR mismatched types + //[leak]~^ ERROR `match` arms have incompatible types + //[noleak]~^^ ERROR mismatched types }; } diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.baseleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.leak.stderr similarity index 91% rename from src/test/ui/lub-glb/old-lub-glb-hr-noteq2.baseleak.stderr rename to src/test/ui/lub-glb/old-lub-glb-hr-noteq2.leak.stderr index 1c9ce115e96..e54fcf068d8 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.baseleak.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.leak.stderr @@ -1,5 +1,5 @@ error[E0308]: `match` arms have incompatible types - --> $DIR/old-lub-glb-hr-noteq2.rs:28:14 + --> $DIR/old-lub-glb-hr-noteq2.rs:25:14 | LL | let z = match 22 { | _____________- @@ -8,8 +8,6 @@ LL | | 0 => y, LL | | _ => x, | | ^ one type is more general than the other LL | | -LL | | -LL | | LL | | }; | |_____- `match` arms have incompatible types | diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr deleted file mode 100644 index 1c9ce115e96..00000000000 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.nllleak.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0308]: `match` arms have incompatible types - --> $DIR/old-lub-glb-hr-noteq2.rs:28:14 - | -LL | let z = match 22 { - | _____________- -LL | | 0 => y, - | | - this is found to be of type `for<'a> fn(&'a u8, &'a u8) -> &'a u8` -LL | | _ => x, - | | ^ one type is more general than the other -LL | | -LL | | -LL | | -LL | | }; - | |_____- `match` arms have incompatible types - | - = note: expected fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8` - found fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs index d49b85ce05e..9940c40da81 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs +++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs @@ -11,13 +11,10 @@ // choose to make this always in error in the future - we perform the leak check // after coercing a function pointer. -// revisions: baseleak basenoleak nllleak nllnoleak -// ignore-compare-mode-nll -//[nllleak] compile-flags: -Zborrowck=mir -//[nllnoleak] compile-flags: -Zborrowck=mir -Zno-leak-check -//[basenoleak] compile-flags:-Zno-leak-check +// revisions: leak noleak +//[noleak] compile-flags: -Zno-leak-check -//[nllnoleak] check-pass +//[noleak] check-pass fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8) -> &'a u8) { // The two types above are not equivalent. With the older LUB/GLB @@ -26,9 +23,7 @@ fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8 let z = match 22 { 0 => y, _ => x, - //[baseleak]~^ ERROR `match` arms have incompatible types - //[nllleak]~^^ ERROR `match` arms have incompatible types - //[basenoleak]~^^^ ERROR `match` arms have incompatible types + //[leak]~^ ERROR `match` arms have incompatible types }; } diff --git a/src/test/ui/lub-glb/old-lub-glb-object.base.stderr b/src/test/ui/lub-glb/old-lub-glb-object.base.stderr deleted file mode 100644 index da98483906f..00000000000 --- a/src/test/ui/lub-glb/old-lub-glb-object.base.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/old-lub-glb-object.rs:11:13 - | -LL | let z = match 22 { - | _____________^ -LL | | -LL | | 0 => x, -LL | | _ => y, -LL | | -LL | | -LL | | }; - | |_____^ one type is more general than the other - | - = note: expected trait object `dyn for<'a, 'b> Foo<&'a u8, &'b u8>` - found trait object `dyn for<'a> Foo<&'a u8, &'a u8>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lub-glb/old-lub-glb-object.rs b/src/test/ui/lub-glb/old-lub-glb-object.rs index b4dbb0caae6..b6ead9c68c5 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.rs +++ b/src/test/ui/lub-glb/old-lub-glb-object.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test that we give a note when the old LUB/GLB algorithm would have // succeeded but the new code (which is stricter) gives an error. @@ -9,11 +5,10 @@ trait Foo {} fn foo(x: &dyn for<'a, 'b> Foo<&'a u8, &'b u8>, y: &dyn for<'a> Foo<&'a u8, &'a u8>) { let z = match 22 { - //[base]~^ ERROR mismatched types 0 => x, _ => y, - //[nll]~^ ERROR mismatched types - //[nll]~| ERROR mismatched types + //~^ ERROR mismatched types + //~| ERROR mismatched types }; } diff --git a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr b/src/test/ui/lub-glb/old-lub-glb-object.stderr similarity index 89% rename from src/test/ui/lub-glb/old-lub-glb-object.nll.stderr rename to src/test/ui/lub-glb/old-lub-glb-object.stderr index 8f19133be44..3d0c171e013 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-object.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/old-lub-glb-object.rs:14:14 + --> $DIR/old-lub-glb-object.rs:9:14 | LL | _ => y, | ^ one type is more general than the other @@ -8,7 +8,7 @@ LL | _ => y, found trait object `dyn for<'a> Foo<&'a u8, &'a u8>` error[E0308]: mismatched types - --> $DIR/old-lub-glb-object.rs:14:14 + --> $DIR/old-lub-glb-object.rs:9:14 | LL | _ => y, | ^ one type is more general than the other diff --git a/src/test/ui/match/match-ref-mut-invariance.base.stderr b/src/test/ui/match/match-ref-mut-invariance.base.stderr deleted file mode 100644 index 060c8237974..00000000000 --- a/src/test/ui/match/match-ref-mut-invariance.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/match-ref-mut-invariance.rs:14:37 - | -LL | match self.0 { ref mut x => x } - | ^ lifetime mismatch - | - = note: expected mutable reference `&'a mut &'a i32` - found mutable reference `&'a mut &'b i32` -note: the lifetime `'a` as defined here... - --> $DIR/match-ref-mut-invariance.rs:13:12 - | -LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { - | ^^ -note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/match-ref-mut-invariance.rs:12:6 - | -LL | impl<'b> S<'b> { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/match/match-ref-mut-invariance.rs b/src/test/ui/match/match-ref-mut-invariance.rs index f876a4e2498..4250696c674 100644 --- a/src/test/ui/match/match-ref-mut-invariance.rs +++ b/src/test/ui/match/match-ref-mut-invariance.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Check that when making a ref mut binding with type `&mut T`, the // type `T` must match precisely the type `U` of the value being // matched, and in particular cannot be some supertype of `U`. Issue @@ -12,8 +8,7 @@ struct S<'b>(&'b i32); impl<'b> S<'b> { fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { match self.0 { ref mut x => x } - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/match/match-ref-mut-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-invariance.stderr similarity index 94% rename from src/test/ui/match/match-ref-mut-invariance.nll.stderr rename to src/test/ui/match/match-ref-mut-invariance.stderr index b98539d91b6..3b7e53cd527 100644 --- a/src/test/ui/match/match-ref-mut-invariance.nll.stderr +++ b/src/test/ui/match/match-ref-mut-invariance.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/match-ref-mut-invariance.rs:14:9 + --> $DIR/match-ref-mut-invariance.rs:10:9 | LL | impl<'b> S<'b> { | -- lifetime `'b` defined here diff --git a/src/test/ui/match/match-ref-mut-let-invariance.base.stderr b/src/test/ui/match/match-ref-mut-let-invariance.base.stderr deleted file mode 100644 index 7b6dd5af539..00000000000 --- a/src/test/ui/match/match-ref-mut-let-invariance.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/match-ref-mut-let-invariance.rs:15:9 - | -LL | x - | ^ lifetime mismatch - | - = note: expected mutable reference `&'a mut &'a i32` - found mutable reference `&'a mut &'b i32` -note: the lifetime `'a` as defined here... - --> $DIR/match-ref-mut-let-invariance.rs:13:12 - | -LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { - | ^^ -note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/match-ref-mut-let-invariance.rs:12:6 - | -LL | impl<'b> S<'b> { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/match/match-ref-mut-let-invariance.rs b/src/test/ui/match/match-ref-mut-let-invariance.rs index 0a8daed569f..a33be09ac8b 100644 --- a/src/test/ui/match/match-ref-mut-let-invariance.rs +++ b/src/test/ui/match/match-ref-mut-let-invariance.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Check that when making a ref mut binding with type `&mut T`, the // type `T` must match precisely the type `U` of the value being // matched, and in particular cannot be some supertype of `U`. Issue @@ -13,8 +9,7 @@ impl<'b> S<'b> { fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { let ref mut x = self.0; x - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-let-invariance.stderr similarity index 93% rename from src/test/ui/match/match-ref-mut-let-invariance.nll.stderr rename to src/test/ui/match/match-ref-mut-let-invariance.stderr index 4b8bdd157c2..f4d1cea670b 100644 --- a/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr +++ b/src/test/ui/match/match-ref-mut-let-invariance.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/match-ref-mut-let-invariance.rs:15:9 + --> $DIR/match-ref-mut-let-invariance.rs:11:9 | LL | impl<'b> S<'b> { | -- lifetime `'b` defined here diff --git a/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr b/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr index 012071df2bb..87330155eac 100644 --- a/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr +++ b/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/meta-expected-error-wrong-rev.rs:14:18 + --> $DIR/meta-expected-error-wrong-rev.rs:13:18 | LL | let x: u32 = 22_usize; | --- ^^^^^^^^ expected `u32`, found `usize` diff --git a/src/test/ui/meta/meta-expected-error-wrong-rev.rs b/src/test/ui/meta/meta-expected-error-wrong-rev.rs index 80af527a697..c30d4fe0a13 100644 --- a/src/test/ui/meta/meta-expected-error-wrong-rev.rs +++ b/src/test/ui/meta/meta-expected-error-wrong-rev.rs @@ -1,4 +1,3 @@ -// ignore-compare-mode-nll // ignore-compare-mode-polonius // revisions: a diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr deleted file mode 100644 index dfc6ef567f0..00000000000 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr +++ /dev/null @@ -1,102 +0,0 @@ -error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:7:14 - | -LL | a.iter().map(|_: (u32, u32)| 45); - | ^^^ ------------------ found signature of `fn((u32, u32)) -> _` - | | - | expected signature of `fn(&(u32, u32)) -> _` - | -note: required by a bound in `map` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` - -error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:8:14 - | -LL | a.iter().map(|_: &(u16, u16)| 45); - | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _` - | | - | expected signature of `fn(&(u32, u32)) -> _` - | -note: required by a bound in `map` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` - -error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:9:14 - | -LL | a.iter().map(|_: (u16, u16)| 45); - | ^^^ ------------------ found signature of `fn((u16, u16)) -> _` - | | - | expected signature of `fn(&(u32, u32)) -> _` - | -note: required by a bound in `map` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` - -error[E0308]: mismatched types - --> $DIR/closure-arg-type-mismatch.rs:14:5 - | -LL | baz(f); - | ^^^ lifetime mismatch - | - = note: expected type `for<'r> Fn<(*mut &'r u32,)>` - found type `Fn<(*mut &'a u32,)>` -note: the required lifetime does not necessarily outlive the lifetime `'a` as defined here - --> $DIR/closure-arg-type-mismatch.rs:13:10 - | -LL | fn _test<'a>(f: fn(*mut &'a u32)) { - | ^^ -note: the lifetime requirement is introduced here - --> $DIR/closure-arg-type-mismatch.rs:12:11 - | -LL | fn baz(_: F) {} - | ^^^^^^^^^^^^^ - -error: implementation of `FnOnce` is not general enough - --> $DIR/closure-arg-type-mismatch.rs:14:5 - | -LL | baz(f); - | ^^^ implementation of `FnOnce` is not general enough - | - = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`... - = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>` - -error[E0308]: mismatched types - --> $DIR/closure-arg-type-mismatch.rs:14:5 - | -LL | baz(f); - | ^^^ lifetime mismatch - | - = note: expected type `for<'r> Fn<(*mut &'r u32,)>` - found type `Fn<(*mut &'a u32,)>` -note: the lifetime `'a` as defined here doesn't meet the lifetime requirements - --> $DIR/closure-arg-type-mismatch.rs:13:10 - | -LL | fn _test<'a>(f: fn(*mut &'a u32)) { - | ^^ -note: the lifetime requirement is introduced here - --> $DIR/closure-arg-type-mismatch.rs:12:11 - | -LL | fn baz(_: F) {} - | ^^^^^^^^^^^^^ - -error: implementation of `FnOnce` is not general enough - --> $DIR/closure-arg-type-mismatch.rs:14:5 - | -LL | baz(f); - | ^^^ implementation of `FnOnce` is not general enough - | - = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`... - = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>` - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0308, E0631. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs index da8011cc92b..98abb0ba979 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn main() { let a = [(1u32, 2u32)]; a.iter().map(|_: (u32, u32)| 45); //~ ERROR type mismatch @@ -12,8 +8,4 @@ fn main() { fn baz(_: F) {} fn _test<'a>(f: fn(*mut &'a u32)) { baz(f); - //[base]~^ ERROR implementation of `FnOnce` is not general enough - //[base]~| ERROR implementation of `FnOnce` is not general enough - //[base]~| ERROR mismatched types - //[base]~| ERROR mismatched types } diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr similarity index 91% rename from src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr rename to src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index 314000e8848..1f46229cb5a 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -1,5 +1,5 @@ error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:7:14 + --> $DIR/closure-arg-type-mismatch.rs:3:14 | LL | a.iter().map(|_: (u32, u32)| 45); | ^^^ ------------------ found signature of `fn((u32, u32)) -> _` @@ -13,7 +13,7 @@ LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:8:14 + --> $DIR/closure-arg-type-mismatch.rs:4:14 | LL | a.iter().map(|_: &(u16, u16)| 45); | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _` @@ -27,7 +27,7 @@ LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:9:14 + --> $DIR/closure-arg-type-mismatch.rs:5:14 | LL | a.iter().map(|_: (u16, u16)| 45); | ^^^ ------------------ found signature of `fn((u16, u16)) -> _` diff --git a/src/test/ui/mismatched_types/closure-mismatch.base.stderr b/src/test/ui/mismatched_types/closure-mismatch.base.stderr deleted file mode 100644 index 7c81ebdf490..00000000000 --- a/src/test/ui/mismatched_types/closure-mismatch.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/closure-mismatch.rs:12:5 - | -LL | baz(|_| ()); - | ^^^ lifetime mismatch - | - = note: expected type `for<'r> Fn<(&'r (),)>` - found type `Fn<(&(),)>` -note: this closure does not fulfill the lifetime requirements - --> $DIR/closure-mismatch.rs:12:9 - | -LL | baz(|_| ()); - | ^^^^^^ -note: the lifetime requirement is introduced here - --> $DIR/closure-mismatch.rs:9:11 - | -LL | fn baz(_: T) {} - | ^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/mismatched_types/closure-mismatch.rs b/src/test/ui/mismatched_types/closure-mismatch.rs index 5bf3aef9bb0..b0644e79611 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.rs +++ b/src/test/ui/mismatched_types/closure-mismatch.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo {} impl Foo for T {} @@ -10,7 +6,6 @@ fn baz(_: T) {} fn main() { baz(|_| ()); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR implementation of `FnOnce` is not general enough - //[nll]~| ERROR mismatched types + //~^ ERROR implementation of `FnOnce` is not general enough + //~| ERROR mismatched types } diff --git a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr similarity index 86% rename from src/test/ui/mismatched_types/closure-mismatch.nll.stderr rename to src/test/ui/mismatched_types/closure-mismatch.stderr index 9508fc8a9be..bd36fab9288 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr +++ b/src/test/ui/mismatched_types/closure-mismatch.stderr @@ -1,5 +1,5 @@ error: implementation of `FnOnce` is not general enough - --> $DIR/closure-mismatch.rs:12:5 + --> $DIR/closure-mismatch.rs:8:5 | LL | baz(|_| ()); | ^^^^^^^^^^^ implementation of `FnOnce` is not general enough @@ -8,7 +8,7 @@ LL | baz(|_| ()); = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2` error[E0308]: mismatched types - --> $DIR/closure-mismatch.rs:12:5 + --> $DIR/closure-mismatch.rs:8:5 | LL | baz(|_| ()); | ^^^^^^^^^^^ one type is more general than the other @@ -16,12 +16,12 @@ LL | baz(|_| ()); = note: expected type `for<'r> Fn<(&'r (),)>` found type `Fn<(&(),)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/closure-mismatch.rs:12:9 + --> $DIR/closure-mismatch.rs:8:9 | LL | baz(|_| ()); | ^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/closure-mismatch.rs:9:11 + --> $DIR/closure-mismatch.rs:5:11 | LL | fn baz(_: T) {} | ^^^ diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.rs b/src/test/ui/nll/closure-requirements/escape-argument-callee.rs index 9b3a49b7b7e..3aea511b056 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument-callee.rs +++ b/src/test/ui/nll/closure-requirements/escape-argument-callee.rs @@ -12,7 +12,7 @@ // that appear free in its type (hence, we see it before the closure's // "external requirements" report). -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/escape-argument.rs b/src/test/ui/nll/closure-requirements/escape-argument.rs index 6269659c453..066cd436016 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument.rs +++ b/src/test/ui/nll/closure-requirements/escape-argument.rs @@ -12,7 +12,7 @@ // basically checking that the MIR type checker correctly enforces the // closure signature. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs b/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs index b94b3d607c9..765a3cf961c 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs +++ b/src/test/ui/nll/closure-requirements/escape-upvar-nested.rs @@ -5,7 +5,7 @@ // // except that the closure does so via a second closure. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs b/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs index a916ccd6c21..0a562a0a1bc 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs +++ b/src/test/ui/nll/closure-requirements/escape-upvar-ref.rs @@ -9,7 +9,7 @@ // `'b`. This relationship is propagated to the closure creator, // which reports an error. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs index 95355323cdc..35a864b8851 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs @@ -1,7 +1,7 @@ // Test where we fail to approximate due to demanding a postdom // relationship between our upper bounds. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs index 1c409a14b72..7291c6e9749 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs @@ -12,7 +12,7 @@ // Note: the use of `Cell` here is to introduce invariance. One less // variable. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs index ab0bfb956f4..afe6f10a52f 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs @@ -2,7 +2,7 @@ // where `'x` is bound in closure type but `'a` is free. This forces // us to approximate `'x` one way or the other. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs index 779c3671ff5..3722090754b 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs @@ -3,7 +3,7 @@ // because `'y` is higher-ranked but we know of no relations to other // regions. Note that `'static` shows up in the stderr output as `'0`. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs index fbf4be75504..9898777c727 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs @@ -4,7 +4,7 @@ // relations to other regions. Note that `'static` shows up in the // stderr output as `'0`. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs index 233a5dcab08..5bb5eea991b 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs @@ -5,7 +5,7 @@ // relationships. In the 'main' variant, there are a number of // anonymous regions as well. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs index ac182be1556..704a026d29b 100644 --- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs +++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs @@ -3,7 +3,7 @@ // need to propagate; but in fact we do because identity of free // regions is erased. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose // check-pass #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs index 37d47135285..dcd05d7fa2c 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs @@ -7,7 +7,7 @@ // as it knows of no relationships between `'x` and any // non-higher-ranked regions. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs index c1467fcc9b6..98be92d1cd6 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs @@ -7,7 +7,7 @@ // as it only knows of regions that `'x` is outlived by, and none that // `'x` outlives. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs index a578e959148..3bdb5433948 100644 --- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs +++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs @@ -4,7 +4,7 @@ // the same `'a` for which it implements `Trait`, which can only be the `'a` // from the function definition. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] #![allow(dead_code)] diff --git a/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs b/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs index c8f226f5238..8147da09d43 100644 --- a/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs +++ b/src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs @@ -3,7 +3,7 @@ // a variety of errors from the older, AST-based machinery (notably // borrowck), and then we get the NLL error at the end. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose fn foo(x: &u32) -> &'static u32 { &*x diff --git a/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs b/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs index ce75e0700b0..4acd2fc92f3 100644 --- a/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs +++ b/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs @@ -3,7 +3,7 @@ // a variety of errors from the older, AST-based machinery (notably // borrowck), and then we get the NLL error at the end. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose fn foo<'a>(x: &'a u32) -> &'static u32 { &*x diff --git a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs index 4d864c6e588..06e96be80d5 100644 --- a/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs +++ b/src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs @@ -3,7 +3,7 @@ // a variety of errors from the older, AST-based machinery (notably // borrowck), and then we get the NLL error at the end. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 { &*x diff --git a/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs b/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs index a558e8a1813..014959fdbd4 100644 --- a/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs +++ b/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs @@ -2,7 +2,7 @@ // report an error because of the (implied) bound that `'b: 'a`. // check-pass -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose fn foo<'a, 'b>(x: &'a &'b u32) -> &'a u32 { &**x diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs index 5ac00638ec1..e34a3f6f2cb 100644 --- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs +++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs @@ -2,7 +2,7 @@ // the first, but actually returns the second. This should fail within // the closure. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/constant.rs b/src/test/ui/nll/constant.rs index 039b6aaaf0a..47f0eadf99c 100644 --- a/src/test/ui/nll/constant.rs +++ b/src/test/ui/nll/constant.rs @@ -1,7 +1,6 @@ // Test that MIR borrowck and NLL analysis can handle constants of // arbitrary types without ICEs. -// compile-flags:-Zborrowck=mir // check-pass const HI: &str = "hi"; diff --git a/src/test/ui/nll/continue-after-missing-main.base.stderr b/src/test/ui/nll/continue-after-missing-main.base.stderr deleted file mode 100644 index 9d1fa66813d..00000000000 --- a/src/test/ui/nll/continue-after-missing-main.base.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0601]: `main` function not found in crate `continue_after_missing_main` - --> $DIR/continue-after-missing-main.rs:34:2 - | -LL | } - | ^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs` - -error[E0623]: lifetime mismatch - --> $DIR/continue-after-missing-main.rs:32:56 - | -LL | tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>, - | ------------------------------------------------------------------ these two types are declared with different lifetimes... -LL | ) { -LL | let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `tableau` flows into `tableau` here - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0601, E0623. -For more information about an error, try `rustc --explain E0601`. diff --git a/src/test/ui/nll/continue-after-missing-main.rs b/src/test/ui/nll/continue-after-missing-main.rs index ddead7dc233..778639158d7 100644 --- a/src/test/ui/nll/continue-after-missing-main.rs +++ b/src/test/ui/nll/continue-after-missing-main.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![allow(dead_code)] struct Tableau<'a, MP> { @@ -30,5 +26,4 @@ fn create_and_solve_subproblems<'data_provider, 'original_data, MP>( tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>, ) { let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound(); - //[base]~^ ERROR lifetime mismatch } //~ ERROR `main` function not found in crate diff --git a/src/test/ui/nll/continue-after-missing-main.nll.stderr b/src/test/ui/nll/continue-after-missing-main.stderr similarity index 85% rename from src/test/ui/nll/continue-after-missing-main.nll.stderr rename to src/test/ui/nll/continue-after-missing-main.stderr index 2bad3be8b4e..0df8d8d703e 100644 --- a/src/test/ui/nll/continue-after-missing-main.nll.stderr +++ b/src/test/ui/nll/continue-after-missing-main.stderr @@ -1,5 +1,5 @@ error[E0601]: `main` function not found in crate `continue_after_missing_main` - --> $DIR/continue-after-missing-main.rs:34:2 + --> $DIR/continue-after-missing-main.rs:29:2 | LL | } | ^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs` diff --git a/src/test/ui/nll/drop-may-dangle.rs b/src/test/ui/nll/drop-may-dangle.rs index 1897589bd58..b5531c29b98 100644 --- a/src/test/ui/nll/drop-may-dangle.rs +++ b/src/test/ui/nll/drop-may-dangle.rs @@ -2,7 +2,6 @@ // in the type of `p` includes the points after `&v[0]` up to (but not // including) the call to `use_x`. The `else` branch is not included. -// compile-flags:-Zborrowck=mir // check-pass #![allow(warnings)] diff --git a/src/test/ui/nll/drop-no-may-dangle.rs b/src/test/ui/nll/drop-no-may-dangle.rs index 23f7f6c265e..a0ff0c3989c 100644 --- a/src/test/ui/nll/drop-no-may-dangle.rs +++ b/src/test/ui/nll/drop-no-may-dangle.rs @@ -3,8 +3,6 @@ // because of destructor. (Note that the stderr also identifies this // destructor in the error message.) -// compile-flags:-Zborrowck=mir - #![allow(warnings)] #![feature(dropck_eyepatch)] diff --git a/src/test/ui/nll/drop-no-may-dangle.stderr b/src/test/ui/nll/drop-no-may-dangle.stderr index e1d2b038ec8..cb280880950 100644 --- a/src/test/ui/nll/drop-no-may-dangle.stderr +++ b/src/test/ui/nll/drop-no-may-dangle.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `v[_]` because it is borrowed - --> $DIR/drop-no-may-dangle.rs:20:9 + --> $DIR/drop-no-may-dangle.rs:18:9 | LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] }; | ----- borrow of `v[_]` occurs here @@ -11,7 +11,7 @@ LL | } | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle` error[E0506]: cannot assign to `v[_]` because it is borrowed - --> $DIR/drop-no-may-dangle.rs:23:5 + --> $DIR/drop-no-may-dangle.rs:21:5 | LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] }; | ----- borrow of `v[_]` occurs here diff --git a/src/test/ui/nll/extra-unused-mut.rs b/src/test/ui/nll/extra-unused-mut.rs index db056a22855..340f2952acc 100644 --- a/src/test/ui/nll/extra-unused-mut.rs +++ b/src/test/ui/nll/extra-unused-mut.rs @@ -2,7 +2,7 @@ // check-pass -#![feature(generators, nll)] +#![feature(generators)] #![deny(unused_mut)] fn ref_argument(ref _y: i32) {} diff --git a/src/test/ui/nll/generator-distinct-lifetime.rs b/src/test/ui/nll/generator-distinct-lifetime.rs index 3102562cd0a..90fe6b56960 100644 --- a/src/test/ui/nll/generator-distinct-lifetime.rs +++ b/src/test/ui/nll/generator-distinct-lifetime.rs @@ -1,4 +1,4 @@ -#![feature(generators, nll)] +#![feature(generators)] // Test for issue #47189. Here, both `s` and `t` are live for the // generator's lifetime, but within the generator they have distinct diff --git a/src/test/ui/nll/generator-upvar-mutability.rs b/src/test/ui/nll/generator-upvar-mutability.rs index fe4bc6bce1b..c49ea15b824 100644 --- a/src/test/ui/nll/generator-upvar-mutability.rs +++ b/src/test/ui/nll/generator-upvar-mutability.rs @@ -1,6 +1,6 @@ // Check that generators respect the muatability of their upvars. -#![feature(generators, nll)] +#![feature(generators)] fn mutate_upvar() { let x = 0; diff --git a/src/test/ui/nll/guarantor-issue-46974.rs b/src/test/ui/nll/guarantor-issue-46974.rs index 87ed0e642e9..96af4bf5c36 100644 --- a/src/test/ui/nll/guarantor-issue-46974.rs +++ b/src/test/ui/nll/guarantor-issue-46974.rs @@ -1,8 +1,6 @@ // Test that NLL analysis propagates lifetimes correctly through // field accesses, Box accesses, etc. -#![feature(nll)] - fn foo(s: &mut (i32,)) -> i32 { let t = &mut *s; // this borrow should last for the entire function let x = &t.0; diff --git a/src/test/ui/nll/guarantor-issue-46974.stderr b/src/test/ui/nll/guarantor-issue-46974.stderr index 8245aadf826..8854dd8d68c 100644 --- a/src/test/ui/nll/guarantor-issue-46974.stderr +++ b/src/test/ui/nll/guarantor-issue-46974.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `*s` because it is borrowed - --> $DIR/guarantor-issue-46974.rs:9:5 + --> $DIR/guarantor-issue-46974.rs:7:5 | LL | let t = &mut *s; // this borrow should last for the entire function | ------- borrow of `*s` occurs here @@ -10,7 +10,7 @@ LL | *x | -- borrow later used here error: lifetime may not live long enough - --> $DIR/guarantor-issue-46974.rs:15:5 + --> $DIR/guarantor-issue-46974.rs:13:5 | LL | fn bar(s: &Box<(i32,)>) -> &'static i32 { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs index f45370e5c2e..0ec0179e846 100644 --- a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs +++ b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs @@ -2,8 +2,6 @@ // switch below) produces superior diagnostics to the NLL-migrate // mode. -#![feature(nll)] - fn doit(data: &'static mut ()) { || doit(data); //~^ ERROR lifetime may not live long enough diff --git a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr index 4c70a8475f2..f7a525ee9b0 100644 --- a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.stderr +++ b/src/test/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:8:8 + --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:6: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:8:13 + --> $DIR/issue-42574-diagnostic-in-nested-closure.rs:6:13 | LL | || doit(data); | -- -----^^^^- diff --git a/src/test/ui/nll/issue-45696-no-variant-box-recur.rs b/src/test/ui/nll/issue-45696-no-variant-box-recur.rs index c688261fa1c..39f1607a36b 100644 --- a/src/test/ui/nll/issue-45696-no-variant-box-recur.rs +++ b/src/test/ui/nll/issue-45696-no-variant-box-recur.rs @@ -2,9 +2,6 @@ // you declare a variable of type `struct A(Box, ...);` (which is impossible // to construct but *is* possible to declare; see also issues #4287, #44933, // and #52852). -// -// We will explicitly test NLL, and migration modes; thus we will also skip the -// automated compare-mode=nll. // run-pass diff --git a/src/test/ui/nll/issue-48070.rs b/src/test/ui/nll/issue-48070.rs index 47426cdfa57..a9fe3521d5a 100644 --- a/src/test/ui/nll/issue-48070.rs +++ b/src/test/ui/nll/issue-48070.rs @@ -1,5 +1,4 @@ // run-pass -// revisions: lxl nll struct Foo { x: u32 diff --git a/src/test/ui/nll/issue-50716.base.stderr b/src/test/ui/nll/issue-50716.base.stderr deleted file mode 100644 index 0dcf0648142..00000000000 --- a/src/test/ui/nll/issue-50716.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-50716.rs:18:9 - | -LL | let _x = *s; - | ^^ lifetime mismatch - | - = note: expected type `<<&'a T as A>::X as Sized>` - found type `<<&'static T as A>::X as Sized>` -note: the lifetime `'a` as defined here... - --> $DIR/issue-50716.rs:13:8 - | -LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/nll/issue-50716.rs b/src/test/ui/nll/issue-50716.rs index bd44d3eff9f..c2fc345fa2b 100644 --- a/src/test/ui/nll/issue-50716.rs +++ b/src/test/ui/nll/issue-50716.rs @@ -2,10 +2,6 @@ // Regression test for the issue #50716: NLL ignores lifetimes bounds // derived from `Sized` requirements -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait A { type X: ?Sized; } diff --git a/src/test/ui/nll/issue-50716.nll.stderr b/src/test/ui/nll/issue-50716.stderr similarity index 90% rename from src/test/ui/nll/issue-50716.nll.stderr rename to src/test/ui/nll/issue-50716.stderr index a8f4d694ba7..38dd1b5f6fe 100644 --- a/src/test/ui/nll/issue-50716.nll.stderr +++ b/src/test/ui/nll/issue-50716.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-50716.rs:18:14 + --> $DIR/issue-50716.rs:14:14 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/issue-51770.rs b/src/test/ui/nll/issue-51770.rs index bcb37a5f4ff..3d6bc82f115 100644 --- a/src/test/ui/nll/issue-51770.rs +++ b/src/test/ui/nll/issue-51770.rs @@ -3,7 +3,6 @@ #![crate_type = "lib"] // In an older version, when NLL was still a feature, the following previously did not compile -// #![feature(nll)] use std::ops::Index; diff --git a/src/test/ui/nll/issue-52113.rs b/src/test/ui/nll/issue-52113.rs index 2f4cbf8322b..ffaef272a56 100644 --- a/src/test/ui/nll/issue-52113.rs +++ b/src/test/ui/nll/issue-52113.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - trait Bazinga {} impl Bazinga for F {} diff --git a/src/test/ui/nll/issue-52113.stderr b/src/test/ui/nll/issue-52113.stderr index 42ff1866893..84d4eb266f1 100644 --- a/src/test/ui/nll/issue-52113.stderr +++ b/src/test/ui/nll/issue-52113.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-52113.rs:32:9 + --> $DIR/issue-52113.rs:30:9 | LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/issue-52213.base.stderr b/src/test/ui/nll/issue-52213.base.stderr deleted file mode 100644 index fb758ca17a8..00000000000 --- a/src/test/ui/nll/issue-52213.base.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/issue-52213.rs:6:11 - | -LL | match (&t,) { - | ^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/issue-52213.rs:5:23 - | -LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { - | ^^ -note: ...so that the types are compatible - --> $DIR/issue-52213.rs:6:11 - | -LL | match (&t,) { - | ^^^^^ - = note: expected `(&&(T,),)` - found `(&&'a (T,),)` -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/issue-52213.rs:5:27 - | -LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/issue-52213.rs:8:20 - | -LL | ((u,),) => u, - | ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/nll/issue-52213.rs b/src/test/ui/nll/issue-52213.rs index c5918b47f57..a016924a869 100644 --- a/src/test/ui/nll/issue-52213.rs +++ b/src/test/ui/nll/issue-52213.rs @@ -1,12 +1,7 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { match (&t,) { - //[base]~^ ERROR cannot infer an appropriate lifetime ((u,),) => u, - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/nll/issue-52213.nll.stderr b/src/test/ui/nll/issue-52213.stderr similarity index 90% rename from src/test/ui/nll/issue-52213.nll.stderr rename to src/test/ui/nll/issue-52213.stderr index a7553de6910..da31bcd5475 100644 --- a/src/test/ui/nll/issue-52213.nll.stderr +++ b/src/test/ui/nll/issue-52213.stderr @@ -1,11 +1,11 @@ error: lifetime may not live long enough - --> $DIR/issue-52213.rs:8:20 + --> $DIR/issue-52213.rs:3:20 | LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { | -- -- lifetime `'b` defined here | | | lifetime `'a` defined here -... +LL | match (&t,) { LL | ((u,),) => u, | ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` | diff --git a/src/test/ui/nll/issue-52533-1.base.stderr b/src/test/ui/nll/issue-52533-1.base.stderr deleted file mode 100644 index ddcb01b8f46..00000000000 --- a/src/test/ui/nll/issue-52533-1.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-52533-1.rs:13:18 - | -LL | gimme(|x, y| y) - | ^ lifetime mismatch - | - = note: expected reference `&Foo<'_, '_, u32>` - found reference `&Foo<'_, '_, u32>` -note: the anonymous lifetime #3 defined here... - --> $DIR/issue-52533-1.rs:13:11 - | -LL | gimme(|x, y| y) - | ^^^^^^^^ -note: ...does not necessarily outlive the anonymous lifetime #2 defined here - --> $DIR/issue-52533-1.rs:13:11 - | -LL | gimme(|x, y| y) - | ^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/nll/issue-52533-1.rs b/src/test/ui/nll/issue-52533-1.rs index 3ee7dd556a5..d15daeddcc4 100644 --- a/src/test/ui/nll/issue-52533-1.rs +++ b/src/test/ui/nll/issue-52533-1.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - #![allow(warnings)] struct Foo<'a, 'b, T: 'a + 'b> { x: &'a T, y: &'b T } @@ -11,6 +7,5 @@ fn gimme(_: impl for<'a, 'b, 'c> FnOnce(&'a Foo<'a, 'b, u32>, fn main() { gimme(|x, y| y) - //[base]~^ ERROR mismatched types [E0308] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/nll/issue-52533-1.nll.stderr b/src/test/ui/nll/issue-52533-1.stderr similarity index 91% rename from src/test/ui/nll/issue-52533-1.nll.stderr rename to src/test/ui/nll/issue-52533-1.stderr index 5554339eb7c..20f19b25967 100644 --- a/src/test/ui/nll/issue-52533-1.nll.stderr +++ b/src/test/ui/nll/issue-52533-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-52533-1.rs:13:18 + --> $DIR/issue-52533-1.rs:9:18 | LL | gimme(|x, y| y) | - - ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` diff --git a/src/test/ui/nll/issue-52742.base.stderr b/src/test/ui/nll/issue-52742.base.stderr deleted file mode 100644 index 7b1fac082e4..00000000000 --- a/src/test/ui/nll/issue-52742.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-52742.rs:17:18 - | -LL | self.y = b.z - | ^^^ - | -note: ...the reference is valid for the anonymous lifetime as defined here... - --> $DIR/issue-52742.rs:15:10 - | -LL | impl Foo<'_, '_> { - | ^^ -note: ...but the borrowed content is only valid for the anonymous lifetime defined here - --> $DIR/issue-52742.rs:16:31 - | -LL | fn take_bar(&mut self, b: Bar<'_>) { - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/nll/issue-52742.rs b/src/test/ui/nll/issue-52742.rs index 5ec5770c5c2..d3e201b8ae8 100644 --- a/src/test/ui/nll/issue-52742.rs +++ b/src/test/ui/nll/issue-52742.rs @@ -1,8 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - - struct Foo<'a, 'b> { x: &'a u32, y: &'b u32, diff --git a/src/test/ui/nll/issue-52742.nll.stderr b/src/test/ui/nll/issue-52742.stderr similarity index 92% rename from src/test/ui/nll/issue-52742.nll.stderr rename to src/test/ui/nll/issue-52742.stderr index 1a2165e0a9d..a7973829656 100644 --- a/src/test/ui/nll/issue-52742.nll.stderr +++ b/src/test/ui/nll/issue-52742.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-52742.rs:17:9 + --> $DIR/issue-52742.rs:12:9 | LL | fn take_bar(&mut self, b: Bar<'_>) { | --------- - has type `Bar<'1>` diff --git a/src/test/ui/nll/issue-54779-anon-static-lifetime.rs b/src/test/ui/nll/issue-54779-anon-static-lifetime.rs index 4bb983dd358..260b6b109ca 100644 --- a/src/test/ui/nll/issue-54779-anon-static-lifetime.rs +++ b/src/test/ui/nll/issue-54779-anon-static-lifetime.rs @@ -1,7 +1,5 @@ // Regression test for #54779, checks if the diagnostics are confusing. -#![feature(nll)] - trait DebugWith { fn debug_with<'me>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> { DebugCxPair { value: self, cx } diff --git a/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr b/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr index 9dc9bdbab8d..64ad7a21a3c 100644 --- a/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr +++ b/src/test/ui/nll/issue-54779-anon-static-lifetime.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-54779-anon-static-lifetime.rs:34:24 + --> $DIR/issue-54779-anon-static-lifetime.rs:32:24 | LL | cx: &dyn DebugContext, | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/nll/issue-54943-3.rs b/src/test/ui/nll/issue-54943-3.rs index e6c2611b683..077eb156316 100644 --- a/src/test/ui/nll/issue-54943-3.rs +++ b/src/test/ui/nll/issue-54943-3.rs @@ -4,7 +4,6 @@ // out the value of that `_` requires type-checking the surrounding code, but that code is dead, // so our NLL region checker doesn't have access to it. This test should actually fail to compile. -#![feature(nll)] #![allow(warnings)] use std::fmt::Debug; diff --git a/src/test/ui/nll/issue-55394.base.stderr b/src/test/ui/nll/issue-55394.base.stderr deleted file mode 100644 index 2ec6a7af3f2..00000000000 --- a/src/test/ui/nll/issue-55394.base.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements - --> $DIR/issue-55394.rs:13:9 - | -LL | Foo { bar } - | ^^^ - | -note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/issue-55394.rs:12:17 - | -LL | fn new(bar: &mut Bar) -> Self { - | ^^^^^^^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/issue-55394.rs:13:15 - | -LL | Foo { bar } - | ^^^ -note: but, the lifetime must be valid for the anonymous lifetime as defined here... - --> $DIR/issue-55394.rs:11:10 - | -LL | impl Foo<'_> { - | ^^ -note: ...so that the types are compatible - --> $DIR/issue-55394.rs:13:9 - | -LL | Foo { bar } - | ^^^^^^^^^^^ - = note: expected `Foo<'_>` - found `Foo<'_>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/nll/issue-55394.rs b/src/test/ui/nll/issue-55394.rs index 9c4fcdf6419..f813d1c915c 100644 --- a/src/test/ui/nll/issue-55394.rs +++ b/src/test/ui/nll/issue-55394.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Bar; struct Foo<'s> { diff --git a/src/test/ui/nll/issue-55394.nll.stderr b/src/test/ui/nll/issue-55394.stderr similarity index 93% rename from src/test/ui/nll/issue-55394.nll.stderr rename to src/test/ui/nll/issue-55394.stderr index c166c458c50..24b8c84b4a9 100644 --- a/src/test/ui/nll/issue-55394.nll.stderr +++ b/src/test/ui/nll/issue-55394.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-55394.rs:13:9 + --> $DIR/issue-55394.rs:9:9 | LL | fn new(bar: &mut Bar) -> Self { | - ---- return type is Foo<'2> diff --git a/src/test/ui/nll/issue-55401.base.stderr b/src/test/ui/nll/issue-55401.base.stderr deleted file mode 100644 index d4e9f2b4154..00000000000 --- a/src/test/ui/nll/issue-55401.base.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-55401.rs:7:5 - | -LL | *y - | ^^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/issue-55401.rs:5:47 - | -LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/nll/issue-55401.rs b/src/test/ui/nll/issue-55401.rs index 10f38c53dfd..fc45824e903 100644 --- a/src/test/ui/nll/issue-55401.rs +++ b/src/test/ui/nll/issue-55401.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { let (ref y, _z): (&'a u32, u32) = (&22, 44); *y //~ ERROR diff --git a/src/test/ui/nll/issue-55401.nll.stderr b/src/test/ui/nll/issue-55401.stderr similarity index 92% rename from src/test/ui/nll/issue-55401.nll.stderr rename to src/test/ui/nll/issue-55401.stderr index 1318dc67657..4f797f26a1a 100644 --- a/src/test/ui/nll/issue-55401.nll.stderr +++ b/src/test/ui/nll/issue-55401.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-55401.rs:7:5 + --> $DIR/issue-55401.rs:3:5 | LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/issue-55825-const-fn.rs b/src/test/ui/nll/issue-55825-const-fn.rs index 17c4a0496b6..8aaa1981360 100644 --- a/src/test/ui/nll/issue-55825-const-fn.rs +++ b/src/test/ui/nll/issue-55825-const-fn.rs @@ -3,8 +3,6 @@ // check-pass -#![feature(nll)] - const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } fn main() { } diff --git a/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs b/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs index b222b90e4af..eba859cde22 100644 --- a/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs +++ b/src/test/ui/nll/issue-57642-higher-ranked-subtype.rs @@ -1,8 +1,5 @@ // Regression test for issue #57642 // Tests that we reject a bad higher-ranked subtype -// with `#![feature(nll)]` - -#![feature(nll)] trait X { type G; diff --git a/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr b/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr index 95811ea05b8..0ae6b7c1d7f 100644 --- a/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr +++ b/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr @@ -1,5 +1,5 @@ error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'r> fn(&'r ())`, but its trait bounds were not satisfied - --> $DIR/issue-57642-higher-ranked-subtype.rs:34:25 + --> $DIR/issue-57642-higher-ranked-subtype.rs:31:25 | LL | let x = ::make_g(); | ^^^^^^ function or associated item cannot be called on `for<'r> fn(&'r ())` due to unsatisfied trait bounds @@ -8,20 +8,20 @@ LL | let x = ::make_g(); `for<'r> fn(&'r ()): X` = help: items from traits can only be used if the trait is implemented and in scope note: `X` defines an item `make_g`, perhaps you need to implement it - --> $DIR/issue-57642-higher-ranked-subtype.rs:7:1 + --> $DIR/issue-57642-higher-ranked-subtype.rs:4:1 | LL | trait X { | ^^^^^^^ error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'r> fn(&'r ())` in the current scope - --> $DIR/issue-57642-higher-ranked-subtype.rs:38:25 + --> $DIR/issue-57642-higher-ranked-subtype.rs:35:25 | LL | let x = ::make_f(); | ^^^^^^ function or associated item not found in `for<'r> fn(&'r ())` | = help: items from traits can only be used if the trait is implemented and in scope note: `Y` defines an item `make_f`, perhaps you need to implement it - --> $DIR/issue-57642-higher-ranked-subtype.rs:20:1 + --> $DIR/issue-57642-higher-ranked-subtype.rs:17:1 | LL | trait Y { | ^^^^^^^ diff --git a/src/test/ui/nll/issue-58053.rs b/src/test/ui/nll/issue-58053.rs index 0992e3a85ae..d5a2fa1a3fa 100644 --- a/src/test/ui/nll/issue-58053.rs +++ b/src/test/ui/nll/issue-58053.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn main() { let i = &3; diff --git a/src/test/ui/nll/issue-58053.stderr b/src/test/ui/nll/issue-58053.stderr index e41ee8a8970..bf7416e1ab0 100644 --- a/src/test/ui/nll/issue-58053.stderr +++ b/src/test/ui/nll/issue-58053.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-58053.rs:6:33 + --> $DIR/issue-58053.rs:4:33 | LL | let f = |x: &i32| -> &i32 { x }; | - - ^ returning this value requires that `'1` must outlive `'2` @@ -8,7 +8,7 @@ LL | let f = |x: &i32| -> &i32 { x }; | let's call the lifetime of this reference `'1` error: lifetime may not live long enough - --> $DIR/issue-58053.rs:10:25 + --> $DIR/issue-58053.rs:8:25 | LL | let g = |x: &i32| { x }; | - - ^ returning this value requires that `'1` must outlive `'2` diff --git a/src/test/ui/nll/issue-58299.rs b/src/test/ui/nll/issue-58299.rs index 3277a9db8ec..0587fe8b43b 100644 --- a/src/test/ui/nll/issue-58299.rs +++ b/src/test/ui/nll/issue-58299.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct A<'a>(&'a ()); trait Y { diff --git a/src/test/ui/nll/issue-58299.stderr b/src/test/ui/nll/issue-58299.stderr index aba07542d02..509ba67bd10 100644 --- a/src/test/ui/nll/issue-58299.stderr +++ b/src/test/ui/nll/issue-58299.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-58299.rs:16:9 + --> $DIR/issue-58299.rs:14:9 | LL | fn foo<'a>(x: i32) { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | A::<'a>::X..=A::<'static>::X => (), | ^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/issue-58299.rs:24:27 + --> $DIR/issue-58299.rs:22:27 | LL | fn bar<'a>(x: i32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/issue-67007-escaping-data.rs b/src/test/ui/nll/issue-67007-escaping-data.rs index 99b6d512261..49ea2e5964f 100644 --- a/src/test/ui/nll/issue-67007-escaping-data.rs +++ b/src/test/ui/nll/issue-67007-escaping-data.rs @@ -1,8 +1,6 @@ // Regression test for issue #67007 // Ensures that we show information about the specific regions involved -#![feature(nll)] - // Covariant over 'a, invariant over 'tcx struct FnCtxt<'a, 'tcx: 'a>(&'a (), *mut &'tcx ()); diff --git a/src/test/ui/nll/issue-67007-escaping-data.stderr b/src/test/ui/nll/issue-67007-escaping-data.stderr index ce067e23aa3..ac9c59bf7f2 100644 --- a/src/test/ui/nll/issue-67007-escaping-data.stderr +++ b/src/test/ui/nll/issue-67007-escaping-data.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-67007-escaping-data.rs:17:21 + --> $DIR/issue-67007-escaping-data.rs:15:21 | LL | impl<'tcx> Consumer<'tcx> { | ---- lifetime `'tcx` defined here diff --git a/src/test/ui/nll/issue-73159-rpit-static.rs b/src/test/ui/nll/issue-73159-rpit-static.rs index 97dc016068b..3002408b07d 100644 --- a/src/test/ui/nll/issue-73159-rpit-static.rs +++ b/src/test/ui/nll/issue-73159-rpit-static.rs @@ -1,8 +1,6 @@ // Regression test for issue #73159 // Tests thar we don't suggest replacing 'a with 'static' -#![feature(nll)] - struct Foo<'a>(&'a [u8]); impl<'a> Foo<'a> { diff --git a/src/test/ui/nll/issue-73159-rpit-static.stderr b/src/test/ui/nll/issue-73159-rpit-static.stderr index a3e9c0b44c2..ab0dfe5fca4 100644 --- a/src/test/ui/nll/issue-73159-rpit-static.stderr +++ b/src/test/ui/nll/issue-73159-rpit-static.stderr @@ -1,5 +1,5 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/issue-73159-rpit-static.rs:10:9 + --> $DIR/issue-73159-rpit-static.rs:8:9 | LL | impl<'a> Foo<'a> { | -- hidden type `Copied>` captures the lifetime `'a` as defined here diff --git a/src/test/ui/nll/issue-95272.rs b/src/test/ui/nll/issue-95272.rs index 5b5308fb8c2..958cbde3788 100644 --- a/src/test/ui/nll/issue-95272.rs +++ b/src/test/ui/nll/issue-95272.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - use std::cell::Cell; fn check<'a, 'b>(x: Cell<&'a ()>, y: Cell<&'b ()>) diff --git a/src/test/ui/nll/issue-95272.stderr b/src/test/ui/nll/issue-95272.stderr index 41346a4c699..03edbc3a670 100644 --- a/src/test/ui/nll/issue-95272.stderr +++ b/src/test/ui/nll/issue-95272.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-95272.rs:12:13 + --> $DIR/issue-95272.rs:10:13 | LL | fn test<'a, 'b>(x: Cell<&'a ()>, y: Cell<&'b ()>) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/lub-if.base.stderr b/src/test/ui/nll/lub-if.base.stderr deleted file mode 100644 index ea9f5d4b2b1..00000000000 --- a/src/test/ui/nll/lub-if.base.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-if.rs:32:9 - | -LL | s - | ^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-if.rs:27:17 - | -LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { - | ^^ - -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-if.rs:41:9 - | -LL | s - | ^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-if.rs:38:17 - | -LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { - | ^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/nll/lub-if.rs b/src/test/ui/nll/lub-if.rs index 18561d63935..50225a783f2 100644 --- a/src/test/ui/nll/lub-if.rs +++ b/src/test/ui/nll/lub-if.rs @@ -2,10 +2,6 @@ // of the various arms, particularly in the case where regions are // involved. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - pub fn opt_str0<'a>(maybestr: &'a Option) -> &'a str { if maybestr.is_none() { "(none)" @@ -30,8 +26,7 @@ pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { } else { let s: &'a str = maybestr.as_ref().unwrap(); s - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } @@ -39,8 +34,7 @@ pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { if maybestr.is_some() { let s: &'a str = maybestr.as_ref().unwrap(); s - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } else { "(none)" } diff --git a/src/test/ui/nll/lub-if.nll.stderr b/src/test/ui/nll/lub-if.stderr similarity index 91% rename from src/test/ui/nll/lub-if.nll.stderr rename to src/test/ui/nll/lub-if.stderr index 2fd6e69628d..03f7f920468 100644 --- a/src/test/ui/nll/lub-if.nll.stderr +++ b/src/test/ui/nll/lub-if.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lub-if.rs:32:9 + --> $DIR/lub-if.rs:28:9 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | s | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/lub-if.rs:41:9 + --> $DIR/lub-if.rs:36:9 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/lub-match.base.stderr b/src/test/ui/nll/lub-match.base.stderr deleted file mode 100644 index 38952133160..00000000000 --- a/src/test/ui/nll/lub-match.base.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-match.rs:34:13 - | -LL | s - | ^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-match.rs:29:17 - | -LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { - | ^^ - -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-match.rs:45:13 - | -LL | s - | ^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-match.rs:41:17 - | -LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { - | ^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/nll/lub-match.rs b/src/test/ui/nll/lub-match.rs index 084d8b95f58..454dd1fc605 100644 --- a/src/test/ui/nll/lub-match.rs +++ b/src/test/ui/nll/lub-match.rs @@ -2,10 +2,6 @@ // of the various arms, particularly in the case where regions are // involved. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - pub fn opt_str0<'a>(maybestr: &'a Option) -> &'a str { match *maybestr { Some(ref s) => { @@ -32,8 +28,7 @@ pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { Some(ref s) => { let s: &'a str = s; s - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } } @@ -43,8 +38,7 @@ pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { Some(ref s) => { let s: &'a str = s; s - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } None => "(none)", } diff --git a/src/test/ui/nll/lub-match.nll.stderr b/src/test/ui/nll/lub-match.stderr similarity index 90% rename from src/test/ui/nll/lub-match.nll.stderr rename to src/test/ui/nll/lub-match.stderr index c78d0cb641d..208ec07a1a1 100644 --- a/src/test/ui/nll/lub-match.nll.stderr +++ b/src/test/ui/nll/lub-match.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lub-match.rs:34:13 + --> $DIR/lub-match.rs:30:13 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | s | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/lub-match.rs:45:13 + --> $DIR/lub-match.rs:40:13 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/match-cfg-fake-edges2.rs b/src/test/ui/nll/match-cfg-fake-edges2.rs index e61db71220e..48f95e03b78 100644 --- a/src/test/ui/nll/match-cfg-fake-edges2.rs +++ b/src/test/ui/nll/match-cfg-fake-edges2.rs @@ -1,8 +1,6 @@ // Test that we have enough false edges to avoid exposing the exact matching // algorithm in borrow checking. -#![feature(nll)] - fn all_previous_tests_may_be_done(y: &mut (bool, bool)) { let r = &mut y.1; // We don't actually test y.1 to select the second arm, but we don't want diff --git a/src/test/ui/nll/match-cfg-fake-edges2.stderr b/src/test/ui/nll/match-cfg-fake-edges2.stderr index 0ce83849b9f..c6d15a936d8 100644 --- a/src/test/ui/nll/match-cfg-fake-edges2.stderr +++ b/src/test/ui/nll/match-cfg-fake-edges2.stderr @@ -1,5 +1,5 @@ error[E0503]: cannot use `y.1` because it was mutably borrowed - --> $DIR/match-cfg-fake-edges2.rs:10:5 + --> $DIR/match-cfg-fake-edges2.rs:8:5 | LL | let r = &mut y.1; | -------- borrow of `y.1` occurs here diff --git a/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs b/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs index e81479495c4..32e07cd148f 100644 --- a/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs +++ b/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs @@ -1,4 +1,3 @@ -// compile-flags: -Zborrowck=mir // check-pass #![allow(warnings)] diff --git a/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs b/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs index d6cea55c1e0..778212918d2 100644 --- a/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs +++ b/src/test/ui/nll/maybe-initialized-drop-with-fragment.rs @@ -1,5 +1,3 @@ -//compile-flags: -Zborrowck=mir - #![allow(warnings)] struct Wrap<'p> { p: &'p mut i32 } diff --git a/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr b/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr index e4efd98253c..14074472eaf 100644 --- a/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr +++ b/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/maybe-initialized-drop-with-fragment.rs:21:5 + --> $DIR/maybe-initialized-drop-with-fragment.rs:19:5 | LL | let wrap = Wrap { p: &mut x }; | ------ borrow of `x` occurs here diff --git a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs index d2d1b98c41c..b0d6e27a3d5 100644 --- a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs +++ b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs @@ -1,5 +1,3 @@ -//compile-flags: -Zborrowck=mir - #![allow(warnings)] struct Wrap<'p> { p: &'p mut i32 } diff --git a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr index 0e2be68c6d3..91c0afc1dba 100644 --- a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr +++ b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/maybe-initialized-drop-with-uninitialized-fragments.rs:22:5 + --> $DIR/maybe-initialized-drop-with-uninitialized-fragments.rs:20:5 | LL | let wrap = Wrap { p: &mut x }; | ------ borrow of `x` occurs here diff --git a/src/test/ui/nll/maybe-initialized-drop.rs b/src/test/ui/nll/maybe-initialized-drop.rs index cd12e93d555..44a7ede788f 100644 --- a/src/test/ui/nll/maybe-initialized-drop.rs +++ b/src/test/ui/nll/maybe-initialized-drop.rs @@ -1,5 +1,3 @@ -//compile-flags: -Zborrowck=mir - #![allow(warnings)] struct Wrap<'p> { p: &'p mut i32 } diff --git a/src/test/ui/nll/maybe-initialized-drop.stderr b/src/test/ui/nll/maybe-initialized-drop.stderr index 10b9a6dcf5a..9825ba4611b 100644 --- a/src/test/ui/nll/maybe-initialized-drop.stderr +++ b/src/test/ui/nll/maybe-initialized-drop.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/maybe-initialized-drop.rs:16:5 + --> $DIR/maybe-initialized-drop.rs:14:5 | LL | let wrap = Wrap { p: &mut x }; | ------ borrow of `x` occurs here diff --git a/src/test/ui/nll/mir_check_cast_closure.rs b/src/test/ui/nll/mir_check_cast_closure.rs index 0619ff37d97..4aebcfdb4f6 100644 --- a/src/test/ui/nll/mir_check_cast_closure.rs +++ b/src/test/ui/nll/mir_check_cast_closure.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z borrowck=mir - #![allow(dead_code)] fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 { diff --git a/src/test/ui/nll/mir_check_cast_closure.stderr b/src/test/ui/nll/mir_check_cast_closure.stderr index f34cafe308d..72d99aad99e 100644 --- a/src/test/ui/nll/mir_check_cast_closure.stderr +++ b/src/test/ui/nll/mir_check_cast_closure.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/mir_check_cast_closure.rs:7:5 + --> $DIR/mir_check_cast_closure.rs:5:5 | LL | fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/mir_check_cast_reify.rs b/src/test/ui/nll/mir_check_cast_reify.rs index be12e313b42..951459911e7 100644 --- a/src/test/ui/nll/mir_check_cast_reify.rs +++ b/src/test/ui/nll/mir_check_cast_reify.rs @@ -1,5 +1,3 @@ -// compile-flags: -Zborrowck=mir - #![allow(dead_code)] // Test that we relate the type of the fn type to the type of the fn diff --git a/src/test/ui/nll/mir_check_cast_reify.stderr b/src/test/ui/nll/mir_check_cast_reify.stderr index 4e8eec330a5..9be2670fec7 100644 --- a/src/test/ui/nll/mir_check_cast_reify.stderr +++ b/src/test/ui/nll/mir_check_cast_reify.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/mir_check_cast_reify.rs:37:5 + --> $DIR/mir_check_cast_reify.rs:35:5 | LL | fn bar<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/mir_check_cast_unsafe_fn.rs b/src/test/ui/nll/mir_check_cast_unsafe_fn.rs index 9df9c057489..8f55bedfb4a 100644 --- a/src/test/ui/nll/mir_check_cast_unsafe_fn.rs +++ b/src/test/ui/nll/mir_check_cast_unsafe_fn.rs @@ -1,5 +1,3 @@ -// compile-flags: -Zborrowck=mir - #![allow(dead_code)] fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 { diff --git a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr index 52959850a33..321d17ba6b1 100644 --- a/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr +++ b/src/test/ui/nll/mir_check_cast_unsafe_fn.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/mir_check_cast_unsafe_fn.rs:9:14 + --> $DIR/mir_check_cast_unsafe_fn.rs:7:14 | LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/mir_check_cast_unsize.rs b/src/test/ui/nll/mir_check_cast_unsize.rs index d15c4e4f467..f6c100ab6d4 100644 --- a/src/test/ui/nll/mir_check_cast_unsize.rs +++ b/src/test/ui/nll/mir_check_cast_unsize.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z borrowck=mir - #![allow(dead_code)] use std::fmt::Debug; diff --git a/src/test/ui/nll/mir_check_cast_unsize.stderr b/src/test/ui/nll/mir_check_cast_unsize.stderr index 8d02ef71d1b..1cd2579e4c4 100644 --- a/src/test/ui/nll/mir_check_cast_unsize.stderr +++ b/src/test/ui/nll/mir_check_cast_unsize.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/mir_check_cast_unsize.rs:8:5 + --> $DIR/mir_check_cast_unsize.rs:6:5 | LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/outlives-suggestion-more.rs b/src/test/ui/nll/outlives-suggestion-more.rs index 4d80b78ac65..2e1359fe5d4 100644 --- a/src/test/ui/nll/outlives-suggestion-more.rs +++ b/src/test/ui/nll/outlives-suggestion-more.rs @@ -1,7 +1,5 @@ // Test the more elaborate outlives suggestions. -#![feature(nll)] - // Should suggest: 'a: 'c, 'b: 'd fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) { (x, y) //~ERROR lifetime may not live long enough diff --git a/src/test/ui/nll/outlives-suggestion-more.stderr b/src/test/ui/nll/outlives-suggestion-more.stderr index 7f98aa5801d..c8c604b5b4c 100644 --- a/src/test/ui/nll/outlives-suggestion-more.stderr +++ b/src/test/ui/nll/outlives-suggestion-more.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/outlives-suggestion-more.rs:7:5 + --> $DIR/outlives-suggestion-more.rs:5:5 | LL | fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) { | -- -- lifetime `'c` defined here @@ -11,7 +11,7 @@ LL | (x, y) = help: consider adding the following bound: `'a: 'c` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-more.rs:7:5 + --> $DIR/outlives-suggestion-more.rs:5:5 | LL | fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) { | -- -- lifetime `'d` defined here @@ -28,7 +28,7 @@ help: the following changes may resolve your lifetime errors = help: add bound `'b: 'd` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-more.rs:13:5 + --> $DIR/outlives-suggestion-more.rs:11:5 | LL | fn foo2<'a, 'b, 'c>(x: &'a usize, y: &'b usize) -> (&'c usize, &'static usize) { | -- -- lifetime `'c` defined here @@ -40,7 +40,7 @@ LL | (x, y) = help: consider adding the following bound: `'a: 'c` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-more.rs:13:5 + --> $DIR/outlives-suggestion-more.rs:11:5 | LL | fn foo2<'a, 'b, 'c>(x: &'a usize, y: &'b usize) -> (&'c usize, &'static usize) { | -- lifetime `'b` defined here @@ -53,7 +53,7 @@ help: the following changes may resolve your lifetime errors = help: replace `'b` with `'static` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-more.rs:23:5 + --> $DIR/outlives-suggestion-more.rs:21:5 | LL | fn foo3<'a, 'b, 'c, 'd, 'e>( | -- -- lifetime `'b` defined here @@ -66,7 +66,7 @@ LL | (x, y, z) = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-more.rs:23:5 + --> $DIR/outlives-suggestion-more.rs:21:5 | LL | fn foo3<'a, 'b, 'c, 'd, 'e>( | -- -- lifetime `'b` defined here @@ -79,7 +79,7 @@ LL | (x, y, z) = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-more.rs:23:5 + --> $DIR/outlives-suggestion-more.rs:21:5 | LL | fn foo3<'a, 'b, 'c, 'd, 'e>( | -- lifetime `'c` defined here diff --git a/src/test/ui/nll/outlives-suggestion-simple.rs b/src/test/ui/nll/outlives-suggestion-simple.rs index 496cf92400c..2a5c31e3a64 100644 --- a/src/test/ui/nll/outlives-suggestion-simple.rs +++ b/src/test/ui/nll/outlives-suggestion-simple.rs @@ -1,7 +1,5 @@ // Test the simplest of outlives suggestions. -#![feature(nll)] - fn foo1<'a, 'b>(x: &'a usize) -> &'b usize { x //~ERROR lifetime may not live long enough } diff --git a/src/test/ui/nll/outlives-suggestion-simple.stderr b/src/test/ui/nll/outlives-suggestion-simple.stderr index 8e6e4f1a476..a8368c494ed 100644 --- a/src/test/ui/nll/outlives-suggestion-simple.stderr +++ b/src/test/ui/nll/outlives-suggestion-simple.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:6:5 + --> $DIR/outlives-suggestion-simple.rs:4:5 | LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize { | -- -- lifetime `'b` defined here @@ -11,7 +11,7 @@ LL | x = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:10:5 + --> $DIR/outlives-suggestion-simple.rs:8:5 | LL | fn foo2<'a>(x: &'a usize) -> &'static usize { | -- lifetime `'a` defined here @@ -19,7 +19,7 @@ LL | x | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:14:5 + --> $DIR/outlives-suggestion-simple.rs:12:5 | LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) { | -- -- lifetime `'b` defined here @@ -31,7 +31,7 @@ LL | (x, y) = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:14:5 + --> $DIR/outlives-suggestion-simple.rs:12:5 | LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) { | -- -- lifetime `'b` defined here @@ -45,7 +45,7 @@ LL | (x, y) help: `'a` and `'b` must be the same: replace one with the other error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:22:5 + --> $DIR/outlives-suggestion-simple.rs:20:5 | LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) { | -- -- lifetime `'b` defined here @@ -58,7 +58,7 @@ LL | (x, x) = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:31:9 + --> $DIR/outlives-suggestion-simple.rs:29:9 | LL | pub fn foo<'a>(x: &'a usize) -> Self { | -- lifetime `'a` defined here @@ -66,7 +66,7 @@ LL | Foo { x } | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:41:9 + --> $DIR/outlives-suggestion-simple.rs:39:9 | LL | impl<'a> Bar<'a> { | -- lifetime `'a` defined here @@ -78,7 +78,7 @@ LL | self.x = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:52:9 + --> $DIR/outlives-suggestion-simple.rs:50:9 | LL | impl<'a> Baz<'a> { | -- lifetime `'a` defined here @@ -90,7 +90,7 @@ LL | self.x = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/outlives-suggestion-simple.rs:73:9 + --> $DIR/outlives-suggestion-simple.rs:71:9 | LL | impl<'a> Foo2<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/polonius/assignment-kills-loans.rs b/src/test/ui/nll/polonius/assignment-kills-loans.rs index a80c62d19d5..c4cf20389ac 100644 --- a/src/test/ui/nll/polonius/assignment-kills-loans.rs +++ b/src/test/ui/nll/polonius/assignment-kills-loans.rs @@ -5,8 +5,7 @@ // for code accepted by NLL. They are all variations from example code in the NLL RFC. // check-pass -// compile-flags: -Z borrowck=mir -Z polonius -// ignore-compare-mode-nll +// compile-flags: -Z polonius struct List { value: T, diff --git a/src/test/ui/nll/polonius/assignment-to-differing-field.rs b/src/test/ui/nll/polonius/assignment-to-differing-field.rs index c0ba1b983fc..7ec3b9049fd 100644 --- a/src/test/ui/nll/polonius/assignment-to-differing-field.rs +++ b/src/test/ui/nll/polonius/assignment-to-differing-field.rs @@ -4,8 +4,7 @@ // that we do not kill too many borrows. Assignments to the `.1` // field projections should leave the borrows on `.0` intact. -// compile-flags: -Z borrowck=mir -Z polonius -// ignore-compare-mode-nll +// compile-flags: -Z polonius struct List { value: T, diff --git a/src/test/ui/nll/polonius/assignment-to-differing-field.stderr b/src/test/ui/nll/polonius/assignment-to-differing-field.stderr index fd5e4531b2e..afa1b934439 100644 --- a/src/test/ui/nll/polonius/assignment-to-differing-field.stderr +++ b/src/test/ui/nll/polonius/assignment-to-differing-field.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `list.0.value` as mutable more than once at a time - --> $DIR/assignment-to-differing-field.rs:21:21 + --> $DIR/assignment-to-differing-field.rs:20:21 | LL | fn assignment_to_field_projection<'a, T>( | -- lifetime `'a` defined here @@ -11,7 +11,7 @@ LL | return result; | ------ returning this value requires that `list.0.value` is borrowed for `'a` error[E0499]: cannot borrow `list.0.next` as mutable more than once at a time - --> $DIR/assignment-to-differing-field.rs:24:26 + --> $DIR/assignment-to-differing-field.rs:23:26 | LL | fn assignment_to_field_projection<'a, T>( | -- lifetime `'a` defined here @@ -23,7 +23,7 @@ LL | if let Some(n) = (list.0).next.as_mut() { | argument requires that `list.0.next` is borrowed for `'a` error[E0499]: cannot borrow `list.0.0.0.0.0.value` as mutable more than once at a time - --> $DIR/assignment-to-differing-field.rs:38:21 + --> $DIR/assignment-to-differing-field.rs:37:21 | LL | fn assignment_through_projection_chain<'a, T>( | -- lifetime `'a` defined here @@ -35,7 +35,7 @@ LL | return result; | ------ returning this value requires that `list.0.0.0.0.0.value` is borrowed for `'a` error[E0499]: cannot borrow `list.0.0.0.0.0.next` as mutable more than once at a time - --> $DIR/assignment-to-differing-field.rs:41:26 + --> $DIR/assignment-to-differing-field.rs:40:26 | LL | fn assignment_through_projection_chain<'a, T>( | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/polonius/call-kills-loans.rs b/src/test/ui/nll/polonius/call-kills-loans.rs index 57dc1401102..f430e9211e7 100644 --- a/src/test/ui/nll/polonius/call-kills-loans.rs +++ b/src/test/ui/nll/polonius/call-kills-loans.rs @@ -5,8 +5,7 @@ // missing `killed` facts. // check-pass -// compile-flags: -Z borrowck=mir -Z polonius -// ignore-compare-mode-nll +// compile-flags: -Z polonius struct Thing; diff --git a/src/test/ui/nll/polonius/issue-46589.rs b/src/test/ui/nll/polonius/issue-46589.rs index b5792587ff0..648280a1dcd 100644 --- a/src/test/ui/nll/polonius/issue-46589.rs +++ b/src/test/ui/nll/polonius/issue-46589.rs @@ -3,8 +3,7 @@ // revision/compile-flags. We ensure here that it passes in Polonius mode. // check-pass -// compile-flags: -Z borrowck=mir -Z polonius -// ignore-compare-mode-nll +// compile-flags: -Z polonius struct Foo; diff --git a/src/test/ui/nll/polonius/polonius-smoke-test.rs b/src/test/ui/nll/polonius/polonius-smoke-test.rs index bea5e455998..c4344af7175 100644 --- a/src/test/ui/nll/polonius/polonius-smoke-test.rs +++ b/src/test/ui/nll/polonius/polonius-smoke-test.rs @@ -1,6 +1,5 @@ // Check that Polonius borrow check works for simple cases. -// ignore-compare-mode-nll -// compile-flags: -Z borrowck=mir -Zpolonius +// compile-flags: -Z polonius pub fn return_ref_to_local() -> &'static i32 { let x = 0; diff --git a/src/test/ui/nll/polonius/polonius-smoke-test.stderr b/src/test/ui/nll/polonius/polonius-smoke-test.stderr index 1faf8e2212a..fa1a6a9c957 100644 --- a/src/test/ui/nll/polonius/polonius-smoke-test.stderr +++ b/src/test/ui/nll/polonius/polonius-smoke-test.stderr @@ -1,11 +1,11 @@ error[E0515]: cannot return reference to local variable `x` - --> $DIR/polonius-smoke-test.rs:7:5 + --> $DIR/polonius-smoke-test.rs:6:5 | LL | &x | ^^ returns a reference to data owned by the current function error[E0503]: cannot use `x` because it was mutably borrowed - --> $DIR/polonius-smoke-test.rs:13:13 + --> $DIR/polonius-smoke-test.rs:12:13 | LL | let y = &mut x; | ------ borrow of `x` occurs here @@ -15,7 +15,7 @@ LL | let w = y; | - borrow later used here error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/polonius-smoke-test.rs:19:13 + --> $DIR/polonius-smoke-test.rs:18:13 | LL | pub fn use_while_mut_fr(x: &mut i32) -> &mut i32 { | - let's call the lifetime of this reference `'1` @@ -27,7 +27,7 @@ LL | y | - returning this value requires that `*x` is borrowed for `'1` error[E0505]: cannot move out of `s` because it is borrowed - --> $DIR/polonius-smoke-test.rs:43:5 + --> $DIR/polonius-smoke-test.rs:42:5 | LL | let r = &mut *s; | ------- borrow of `*s` occurs here diff --git a/src/test/ui/nll/polonius/storagedead-kills-loans.rs b/src/test/ui/nll/polonius/storagedead-kills-loans.rs index ff801cbf9f3..669e077dea4 100644 --- a/src/test/ui/nll/polonius/storagedead-kills-loans.rs +++ b/src/test/ui/nll/polonius/storagedead-kills-loans.rs @@ -4,8 +4,7 @@ // Polonius because of these missing `killed` facts. // check-pass -// compile-flags: -Z borrowck=mir -Z polonius -// ignore-compare-mode-nll +// compile-flags: -Z polonius use std::{io, mem}; use std::io::Read; diff --git a/src/test/ui/nll/polonius/subset-relations.rs b/src/test/ui/nll/polonius/subset-relations.rs index 3f6f67ebf40..f223ab177b5 100644 --- a/src/test/ui/nll/polonius/subset-relations.rs +++ b/src/test/ui/nll/polonius/subset-relations.rs @@ -3,8 +3,7 @@ // two free regions outlive each other, without any evidence that this // relation holds. -// ignore-compare-mode-nll -// compile-flags: -Z borrowck=mir -Zpolonius +// compile-flags: -Z polonius // returning `y` requires that `'b: 'a`, but it's not known to be true fn missing_subset<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 { diff --git a/src/test/ui/nll/polonius/subset-relations.stderr b/src/test/ui/nll/polonius/subset-relations.stderr index 63645106f82..6df5563eabb 100644 --- a/src/test/ui/nll/polonius/subset-relations.stderr +++ b/src/test/ui/nll/polonius/subset-relations.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/subset-relations.rs:11:5 + --> $DIR/subset-relations.rs:10:5 | LL | fn missing_subset<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/projection-return.rs b/src/test/ui/nll/projection-return.rs index 017f53d1457..be141339a3f 100644 --- a/src/test/ui/nll/projection-return.rs +++ b/src/test/ui/nll/projection-return.rs @@ -1,4 +1,3 @@ -// compile-flags:-Zborrowck=mir // check-pass #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/relate_tys/fn-subtype.rs b/src/test/ui/nll/relate_tys/fn-subtype.rs index 0730dcc9e49..ba89fa19ca6 100644 --- a/src/test/ui/nll/relate_tys/fn-subtype.rs +++ b/src/test/ui/nll/relate_tys/fn-subtype.rs @@ -2,8 +2,6 @@ // // compile-flags:-Zno-leak-check -#![feature(nll)] - fn main() { let x: fn(&'static ()) = |_| {}; let y: for<'a> fn(&'a ()) = x; //~ ERROR mismatched types [E0308] diff --git a/src/test/ui/nll/relate_tys/fn-subtype.stderr b/src/test/ui/nll/relate_tys/fn-subtype.stderr index 6256c4a01d3..21073647ea7 100644 --- a/src/test/ui/nll/relate_tys/fn-subtype.stderr +++ b/src/test/ui/nll/relate_tys/fn-subtype.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/fn-subtype.rs:9:33 + --> $DIR/fn-subtype.rs:7:33 | LL | let y: for<'a> fn(&'a ()) = x; | ^ one type is more general than the other diff --git a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs index a6d6ffa0ce3..7891bab092b 100644 --- a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs +++ b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs @@ -4,8 +4,6 @@ // // compile-flags:-Zno-leak-check -#![feature(nll)] - fn make_it() -> for<'a> fn(&'a u32, &'a u32) -> &'a u32 { panic!() } diff --git a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr index b839015f97f..7d76c916d6d 100644 --- a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr +++ b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/hr-fn-aaa-as-aba.rs:14:58 + --> $DIR/hr-fn-aaa-as-aba.rs:12:58 | LL | let a: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it(); | ^^^^^^^^^ one type is more general than the other @@ -8,7 +8,7 @@ LL | let a: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it(); found fn pointer `for<'a> fn(&'a u32, &'a u32) -> &'a u32` error[E0308]: mismatched types - --> $DIR/hr-fn-aaa-as-aba.rs:22:12 + --> $DIR/hr-fn-aaa-as-aba.rs:20:12 | LL | let _: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other diff --git a/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs b/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs index 527cca13395..92730341c11 100644 --- a/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs +++ b/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs @@ -9,8 +9,6 @@ // check-pass // compile-flags:-Zno-leak-check -#![feature(nll)] - use std::cell::Cell; fn make_cell_aa() -> Cell fn(&'a u32, &'a u32)> { diff --git a/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs b/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs index 3a46188d119..7cc0acf45f2 100644 --- a/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs +++ b/src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs @@ -5,8 +5,6 @@ // check-pass // compile-flags:-Zno-leak-check -#![feature(nll)] - fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 { panic!() } diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs index 37a01f28946..c4db6fc97dc 100644 --- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs +++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs @@ -6,15 +6,13 @@ // contravariance, this effectively requires a `T = &'b ()` where // `forall<'a> { 'a: 'b }`. Therefore, we get an error. // -// Note the use of `-Zno-leak-check` and `feature(nll)` here. These -// are presently required in order to skip the leak-check errors. +// Note the use of `-Zno-leak-check` here. This is presently required in order +// to skip the leak-check errors. // // c.f. Issue #57642. // // compile-flags:-Zno-leak-check -#![feature(nll)] - trait Y { type F; fn make_f() -> Self::F; diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr index ed79c7df25e..51adfca3e79 100644 --- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr +++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr @@ -1,5 +1,5 @@ error: implementation of `Y` is not general enough - --> $DIR/impl-fn-ignore-binder-via-bottom.rs:32:14 + --> $DIR/impl-fn-ignore-binder-via-bottom.rs:30:14 | LL | let _x = ::make_f(); | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough @@ -8,7 +8,7 @@ LL | let _x = ::make_f(); = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0` error: implementation of `Y` is not general enough - --> $DIR/impl-fn-ignore-binder-via-bottom.rs:32:14 + --> $DIR/impl-fn-ignore-binder-via-bottom.rs:30:14 | LL | let _x = ::make_f(); | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough diff --git a/src/test/ui/nll/relate_tys/opaque-hrtb.rs b/src/test/ui/nll/relate_tys/opaque-hrtb.rs index 0fbe6a63c0b..2613725235c 100644 --- a/src/test/ui/nll/relate_tys/opaque-hrtb.rs +++ b/src/test/ui/nll/relate_tys/opaque-hrtb.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - trait MyTrait {} struct Foo; diff --git a/src/test/ui/nll/relate_tys/opaque-hrtb.stderr b/src/test/ui/nll/relate_tys/opaque-hrtb.stderr index 4c8b66f21ab..d75ec2b57d4 100644 --- a/src/test/ui/nll/relate_tys/opaque-hrtb.stderr +++ b/src/test/ui/nll/relate_tys/opaque-hrtb.stderr @@ -1,5 +1,5 @@ error: implementation of `MyTrait` is not general enough - --> $DIR/opaque-hrtb.rs:13:5 + --> $DIR/opaque-hrtb.rs:11:5 | LL | bar() | ^^^^^ implementation of `MyTrait` is not general enough diff --git a/src/test/ui/nll/relate_tys/trait-hrtb.rs b/src/test/ui/nll/relate_tys/trait-hrtb.rs index 2e94fc5c12d..7f40e93cd87 100644 --- a/src/test/ui/nll/relate_tys/trait-hrtb.rs +++ b/src/test/ui/nll/relate_tys/trait-hrtb.rs @@ -2,8 +2,6 @@ // // compile-flags:-Zno-leak-check -#![feature(nll)] - trait Foo<'a> {} fn make_foo<'a>() -> Box> { diff --git a/src/test/ui/nll/relate_tys/trait-hrtb.stderr b/src/test/ui/nll/relate_tys/trait-hrtb.stderr index 6d144a4be6e..aa1927711b3 100644 --- a/src/test/ui/nll/relate_tys/trait-hrtb.stderr +++ b/src/test/ui/nll/relate_tys/trait-hrtb.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/trait-hrtb.rs:15:39 + --> $DIR/trait-hrtb.rs:13:39 | LL | let y: Box Foo<'a>> = x; | ^ one type is more general than the other diff --git a/src/test/ui/nll/relate_tys/universe-violation.rs b/src/test/ui/nll/relate_tys/universe-violation.rs index 8389c8e8377..c5f9d4406e2 100644 --- a/src/test/ui/nll/relate_tys/universe-violation.rs +++ b/src/test/ui/nll/relate_tys/universe-violation.rs @@ -4,8 +4,6 @@ // // compile-flags:-Zno-leak-check -#![feature(nll)] - fn make_it() -> fn(&'static u32) -> &'static u32 { panic!() } diff --git a/src/test/ui/nll/relate_tys/universe-violation.stderr b/src/test/ui/nll/relate_tys/universe-violation.stderr index ff4c7abc250..6f38154e379 100644 --- a/src/test/ui/nll/relate_tys/universe-violation.stderr +++ b/src/test/ui/nll/relate_tys/universe-violation.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/universe-violation.rs:15:31 + --> $DIR/universe-violation.rs:13:31 | LL | let b: fn(&u32) -> &u32 = a; | ^ one type is more general than the other diff --git a/src/test/ui/nll/ty-outlives/impl-trait-captures.rs b/src/test/ui/nll/ty-outlives/impl-trait-captures.rs index c04185d0814..67b31b8bcd4 100644 --- a/src/test/ui/nll/ty-outlives/impl-trait-captures.rs +++ b/src/test/ui/nll/ty-outlives/impl-trait-captures.rs @@ -1,4 +1,4 @@ -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![allow(warnings)] diff --git a/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs b/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs index 3548ad03a7d..68ccb51fcd0 100644 --- a/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs +++ b/src/test/ui/nll/ty-outlives/impl-trait-outlives.rs @@ -1,4 +1,4 @@ -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![allow(warnings)] diff --git a/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs b/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs index fb50dce1af6..e1dac082409 100644 --- a/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs +++ b/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs @@ -1,7 +1,7 @@ // Test that we can deduce when projections like `T::Item` outlive the // function body. Test that this does not imply that `T: 'a` holds. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose use std::cell::Cell; diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs index 28010e198d6..2d9c008c759 100644 --- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs +++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs @@ -1,4 +1,4 @@ -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose // Tests closures that propagate an outlives relationship to their // creator where the subject is a projection with no regions (`>::Output` may not live long enough - --> $DIR/projection-where-clause-env-wrong-bound.rs:19:5 - | -LL | bar::() - | ^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `>::Output: 'a`... - = note: ...so that the type `>::Output` will meet its required lifetime bounds... -note: ...that is required by this bound - --> $DIR/projection-where-clause-env-wrong-bound.rs:33:8 - | -LL | T: 'a, - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs index 22edb22a536..dce88b88c75 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test that we are able to establish that `>::Output` outlives `'b` here. We need to prove however // that `>::Output` outlives `'a`, so we also have to diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr similarity index 88% rename from src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr rename to src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr index d235dee6444..b4435fe06bc 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr @@ -1,5 +1,5 @@ error[E0309]: the associated type `>::Output` may not live long enough - --> $DIR/projection-where-clause-env-wrong-bound.rs:19:5 + --> $DIR/projection-where-clause-env-wrong-bound.rs:15:5 | LL | bar::() | ^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr deleted file mode 100644 index c3e2301bd66..00000000000 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0309]: the associated type `>::Output` may not live long enough - --> $DIR/projection-where-clause-env-wrong-lifetime.rs:18:5 - | -LL | bar::<>::Output>() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `>::Output: 'a`... - = note: ...so that the type `>::Output` will meet its required lifetime bounds... -note: ...that is required by this bound - --> $DIR/projection-where-clause-env-wrong-lifetime.rs:25:8 - | -LL | T: 'a, - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs index d89b065673b..987148dcefb 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Test that if we need to prove that `>::Output: // 'a`, but we only know that `>::Output: 'a`, that // doesn't suffice. @@ -16,8 +12,7 @@ where >::Output: 'a, { bar::<>::Output>() - //[base]~^ ERROR the associated type `>::Output` may not live long enough - //[nll]~^^ ERROR the associated type `>::Output` may not live long enough + //~^ ERROR the associated type `>::Output` may not live long enough } fn bar<'a, T>() -> &'a () diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr similarity index 88% rename from src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr rename to src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr index 82fe2fad9f7..ddeaf3c1f9e 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr @@ -1,5 +1,5 @@ error[E0309]: the associated type `>::Output` may not live long enough - --> $DIR/projection-where-clause-env-wrong-lifetime.rs:18:5 + --> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5 | LL | bar::<>::Output>() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs index f0f72f5d27f..bb201e5c075 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Test that we are NOT able to establish that `>::Output: 'a` outlives `'a` here -- we have only one // recourse, which is to prove that `T: 'a` and `'a: 'a`, but we don't diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr index e28b89580bc..0df44644d6a 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr @@ -1,5 +1,5 @@ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/projection-where-clause-none.rs:16:5 + --> $DIR/projection-where-clause-none.rs:14:5 | LL | bar::() | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs index 8d0c10a639e..1a40d3b4c2f 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Test that we are able to establish that `>::Output: 'a` outlives `'a` (because the trait says // so). diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs index fd36e7573ff..4d83805993a 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs @@ -1,4 +1,4 @@ -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![allow(warnings)] #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs index 7fce771fc8b..4343c3aee53 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs @@ -1,4 +1,4 @@ -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![allow(warnings)] #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs index c93172885bf..d7702def32c 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs @@ -2,7 +2,7 @@ // `correct_region` for an explanation of how this test is setup; it's // somewhat intricate. -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose #![allow(warnings)] #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs b/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs index ec94258af4a..98239f41609 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs +++ b/src/test/ui/nll/ty-outlives/ty-param-fn-body.rs @@ -1,5 +1,3 @@ -// compile-flags:-Zborrowck=mir - // Test that we assume that universal types like `T` outlive the // function body. diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr index ba79137d18d..5fb69255dba 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr @@ -1,5 +1,5 @@ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/ty-param-fn-body.rs:19:5 + --> $DIR/ty-param-fn-body.rs:17:5 | LL | outlives(cell, t) | ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn.rs b/src/test/ui/nll/ty-outlives/ty-param-fn.rs index a8d229fee51..4393a3b4169 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn.rs +++ b/src/test/ui/nll/ty-outlives/ty-param-fn.rs @@ -1,5 +1,3 @@ -// compile-flags:-Zborrowck=mir - #![allow(warnings)] use std::fmt::Debug; diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn.stderr index 729f14d84ad..825b26d2f77 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr +++ b/src/test/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:11:5 + --> $DIR/ty-param-fn.rs:9:5 | LL | x | ^ ...so that the type `T` will meet its required lifetime bounds @@ -10,7 +10,7 @@ LL | T: Debug + 'a, | ++++ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/ty-param-fn.rs:26:5 + --> $DIR/ty-param-fn.rs:24:5 | LL | x | ^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs b/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs index 6547ae39817..9042844e848 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs +++ b/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs @@ -1,4 +1,4 @@ -// compile-flags:-Zborrowck=mir -Zverbose +// compile-flags:-Zverbose // check-pass // Test that we assume that universal types like `T` outlive the diff --git a/src/test/ui/nll/ty-outlives/wf-unreachable.rs b/src/test/ui/nll/ty-outlives/wf-unreachable.rs index a2e3ab41614..c6f4c4afa3d 100644 --- a/src/test/ui/nll/ty-outlives/wf-unreachable.rs +++ b/src/test/ui/nll/ty-outlives/wf-unreachable.rs @@ -1,8 +1,6 @@ // Test that we check that user type annotations are well-formed, even in dead // code. -#![feature(nll)] - fn uninit<'a>() { return; let x: &'static &'a (); //~ ERROR lifetime may not live long enough diff --git a/src/test/ui/nll/ty-outlives/wf-unreachable.stderr b/src/test/ui/nll/ty-outlives/wf-unreachable.stderr index 9128fd16479..a62157f44f5 100644 --- a/src/test/ui/nll/ty-outlives/wf-unreachable.stderr +++ b/src/test/ui/nll/ty-outlives/wf-unreachable.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:8:12 + --> $DIR/wf-unreachable.rs:6:12 | LL | fn uninit<'a>() { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | let x: &'static &'a (); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:13:12 + --> $DIR/wf-unreachable.rs:11:12 | LL | fn var_type<'a>() { | -- lifetime `'a` defined here @@ -17,7 +17,7 @@ LL | let x: &'static &'a () = &&(); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:17:12 + --> $DIR/wf-unreachable.rs:15:12 | LL | fn uninit_infer<'a>() { | -- lifetime `'a` defined here @@ -25,7 +25,7 @@ LL | let x: &'static &'a _; | ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:23:12 + --> $DIR/wf-unreachable.rs:21:12 | LL | fn infer<'a>() { | -- lifetime `'a` defined here @@ -34,7 +34,7 @@ LL | let x: &'static &'a _ = &&(); | ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:28:12 + --> $DIR/wf-unreachable.rs:26:12 | LL | fn uninit_no_var<'a>() { | -- lifetime `'a` defined here @@ -43,7 +43,7 @@ LL | let _: &'static &'a (); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:33:12 + --> $DIR/wf-unreachable.rs:31:12 | LL | fn no_var<'a>() { | -- lifetime `'a` defined here @@ -52,7 +52,7 @@ LL | let _: &'static &'a () = &&(); | ^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:38:12 + --> $DIR/wf-unreachable.rs:36:12 | LL | fn infer_no_var<'a>() { | -- lifetime `'a` defined here @@ -61,7 +61,7 @@ LL | let _: &'static &'a _ = &&(); | ^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/wf-unreachable.rs:51:12 + --> $DIR/wf-unreachable.rs:49:12 | LL | fn required_substs<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/type-alias-free-regions.base.stderr b/src/test/ui/nll/type-alias-free-regions.base.stderr deleted file mode 100644 index 010535fec6d..00000000000 --- a/src/test/ui/nll/type-alias-free-regions.base.stderr +++ /dev/null @@ -1,65 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements - --> $DIR/type-alias-free-regions.rs:21:9 - | -LL | C { f: b } - | ^ - | -note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/type-alias-free-regions.rs:20:24 - | -LL | fn from_box(b: Box) -> Self { - | ^ -note: ...so that the expression is assignable - --> $DIR/type-alias-free-regions.rs:21:16 - | -LL | C { f: b } - | ^ - = note: expected `Box>` - found `Box>` -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/type-alias-free-regions.rs:19:6 - | -LL | impl<'a> FromBox<'a> for C<'a> { - | ^^ -note: ...so that the types are compatible - --> $DIR/type-alias-free-regions.rs:21:9 - | -LL | C { f: b } - | ^^^^^^^^^^ - = note: expected `C<'a>` - found `C<'_>` - -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/type-alias-free-regions.rs:31:16 - | -LL | C { f: Box::new(b.0) } - | ^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/type-alias-free-regions.rs:30:23 - | -LL | fn from_tuple(b: (B,)) -> Self { - | ^ -note: ...so that the expression is assignable - --> $DIR/type-alias-free-regions.rs:31:25 - | -LL | C { f: Box::new(b.0) } - | ^^^ - = note: expected `Box<&isize>` - found `Box<&isize>` -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/type-alias-free-regions.rs:29:6 - | -LL | impl<'a> FromTuple<'a> for C<'a> { - | ^^ -note: ...so that the types are compatible - --> $DIR/type-alias-free-regions.rs:31:9 - | -LL | C { f: Box::new(b.0) } - | ^^^^^^^^^^^^^^^^^^^^^^ - = note: expected `C<'a>` - found `C<'_>` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/nll/type-alias-free-regions.rs b/src/test/ui/nll/type-alias-free-regions.rs index 59ef0344937..fd5566f35d5 100644 --- a/src/test/ui/nll/type-alias-free-regions.rs +++ b/src/test/ui/nll/type-alias-free-regions.rs @@ -1,10 +1,6 @@ // Test that we don't assume that type aliases have the same type parameters // as the type they alias and then panic when we see this. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - type A<'a> = &'a isize; type B<'a> = Box>; diff --git a/src/test/ui/nll/type-alias-free-regions.nll.stderr b/src/test/ui/nll/type-alias-free-regions.stderr similarity index 90% rename from src/test/ui/nll/type-alias-free-regions.nll.stderr rename to src/test/ui/nll/type-alias-free-regions.stderr index 6b746602d7f..45fd5a2f1d6 100644 --- a/src/test/ui/nll/type-alias-free-regions.nll.stderr +++ b/src/test/ui/nll/type-alias-free-regions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/type-alias-free-regions.rs:21:9 + --> $DIR/type-alias-free-regions.rs:17:9 | LL | impl<'a> FromBox<'a> for C<'a> { | -- lifetime `'a` defined here @@ -9,7 +9,7 @@ LL | C { f: b } | ^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/type-alias-free-regions.rs:31:9 + --> $DIR/type-alias-free-regions.rs:27:9 | LL | impl<'a> FromTuple<'a> for C<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/type-check-pointer-coercions.rs b/src/test/ui/nll/type-check-pointer-coercions.rs index b6a25eddb86..66da57248f9 100644 --- a/src/test/ui/nll/type-check-pointer-coercions.rs +++ b/src/test/ui/nll/type-check-pointer-coercions.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn shared_to_const<'a, 'b>(x: &&'a i32) -> *const &'b i32 { x //~ ERROR } diff --git a/src/test/ui/nll/type-check-pointer-coercions.stderr b/src/test/ui/nll/type-check-pointer-coercions.stderr index 24b07cabbac..ef2d928786f 100644 --- a/src/test/ui/nll/type-check-pointer-coercions.stderr +++ b/src/test/ui/nll/type-check-pointer-coercions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:4:5 + --> $DIR/type-check-pointer-coercions.rs:2:5 | LL | fn shared_to_const<'a, 'b>(x: &&'a i32) -> *const &'b i32 { | -- -- lifetime `'b` defined here @@ -11,7 +11,7 @@ LL | x = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:8:5 + --> $DIR/type-check-pointer-coercions.rs:6:5 | LL | fn unique_to_const<'a, 'b>(x: &mut &'a i32) -> *const &'b i32 { | -- -- lifetime `'b` defined here @@ -23,7 +23,7 @@ LL | x = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:13:5 + --> $DIR/type-check-pointer-coercions.rs:11:5 | LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 { | -- -- lifetime `'b` defined here @@ -39,7 +39,7 @@ LL | x = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:13:5 + --> $DIR/type-check-pointer-coercions.rs:11:5 | LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 { | -- -- lifetime `'b` defined here @@ -57,7 +57,7 @@ LL | x help: `'b` and `'a` must be the same: replace one with the other error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:18:5 + --> $DIR/type-check-pointer-coercions.rs:16:5 | LL | fn mut_to_const<'a, 'b>(x: *mut &'a i32) -> *const &'b i32 { | -- -- lifetime `'b` defined here @@ -69,7 +69,7 @@ LL | x = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:24:5 + --> $DIR/type-check-pointer-coercions.rs:22:5 | LL | fn array_elem<'a, 'b>(x: &'a i32) -> *const &'b i32 { | -- -- lifetime `'b` defined here @@ -82,7 +82,7 @@ LL | y = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:30:5 + --> $DIR/type-check-pointer-coercions.rs:28:5 | LL | fn array_coerce<'a, 'b>(x: &'a i32) -> *const [&'b i32; 3] { | -- -- lifetime `'b` defined here @@ -95,7 +95,7 @@ LL | y = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/type-check-pointer-coercions.rs:36:5 + --> $DIR/type-check-pointer-coercions.rs:34:5 | LL | fn nested_array<'a, 'b>(x: &'a i32) -> *const [&'b i32; 2] { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/type-check-pointer-comparisons.rs b/src/test/ui/nll/type-check-pointer-comparisons.rs index 3c900356fab..7b0ffeaef0e 100644 --- a/src/test/ui/nll/type-check-pointer-comparisons.rs +++ b/src/test/ui/nll/type-check-pointer-comparisons.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Check that we assert that pointers have a common subtype for comparisons fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) { diff --git a/src/test/ui/nll/type-check-pointer-comparisons.stderr b/src/test/ui/nll/type-check-pointer-comparisons.stderr index 8c88b229039..0d8480a42c1 100644 --- a/src/test/ui/nll/type-check-pointer-comparisons.stderr +++ b/src/test/ui/nll/type-check-pointer-comparisons.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/type-check-pointer-comparisons.rs:6:5 + --> $DIR/type-check-pointer-comparisons.rs:4:5 | LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) { | -- -- lifetime `'b` defined here @@ -14,7 +14,7 @@ LL | x == y; = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/type-check-pointer-comparisons.rs:6:10 + --> $DIR/type-check-pointer-comparisons.rs:4:10 | LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) { | -- -- lifetime `'b` defined here @@ -31,7 +31,7 @@ LL | x == y; help: `'a` and `'b` must be the same: replace one with the other error: lifetime may not live long enough - --> $DIR/type-check-pointer-comparisons.rs:12:5 + --> $DIR/type-check-pointer-comparisons.rs:10:5 | LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) { | -- -- lifetime `'b` defined here @@ -46,7 +46,7 @@ LL | x == y; = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/type-check-pointer-comparisons.rs:12:10 + --> $DIR/type-check-pointer-comparisons.rs:10:10 | LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) { | -- -- lifetime `'b` defined here @@ -63,7 +63,7 @@ LL | x == y; help: `'a` and `'b` must be the same: replace one with the other error: lifetime may not live long enough - --> $DIR/type-check-pointer-comparisons.rs:18:5 + --> $DIR/type-check-pointer-comparisons.rs:16:5 | LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) { | -- -- lifetime `'b` defined here @@ -78,7 +78,7 @@ LL | f == g; = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/type-check-pointer-comparisons.rs:18:10 + --> $DIR/type-check-pointer-comparisons.rs:16:10 | LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/user-annotations/closure-substs.rs b/src/test/ui/nll/user-annotations/closure-substs.rs index cafdd9257fd..f7af54e8df4 100644 --- a/src/test/ui/nll/user-annotations/closure-substs.rs +++ b/src/test/ui/nll/user-annotations/closure-substs.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Test that we enforce user-provided type annotations on closures. fn foo<'a>() { diff --git a/src/test/ui/nll/user-annotations/closure-substs.stderr b/src/test/ui/nll/user-annotations/closure-substs.stderr index 20002e4591d..1e8de4ba905 100644 --- a/src/test/ui/nll/user-annotations/closure-substs.stderr +++ b/src/test/ui/nll/user-annotations/closure-substs.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/closure-substs.rs:8:16 + --> $DIR/closure-substs.rs:6:16 | LL | fn foo<'a>() { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | return x; | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/closure-substs.rs:15:16 + --> $DIR/closure-substs.rs:13:16 | LL | |x: &i32| -> &'static i32 { | - let's call the lifetime of this reference `'1` @@ -16,7 +16,7 @@ LL | return x; | ^ returning this value requires that `'1` must outlive `'static` error: lifetime may not live long enough - --> $DIR/closure-substs.rs:22:9 + --> $DIR/closure-substs.rs:20:9 | LL | fn bar<'a>() { | -- lifetime `'a` defined here @@ -25,7 +25,7 @@ LL | b(x); | ^^^^ argument requires that `'a` must outlive `'static` error[E0521]: borrowed data escapes outside of closure - --> $DIR/closure-substs.rs:29:9 + --> $DIR/closure-substs.rs:27:9 | LL | |x: &i32, b: fn(&'static i32)| { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr deleted file mode 100644 index ba17994b437..00000000000 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0759]: `fn` parameter has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/constant-in-expr-inherent-1.rs:12:5 - | -LL | fn foo<'a>(_: &'a u32) -> &'static u32 { - | ------- this data with lifetime `'a`... -LL | >::C - | ^^^^^^^^^^^^ ...is used and required to live as long as `'static` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs index 0bd316aa84c..e3a8a5f58df 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Foo<'a> { x: &'a u32 } impl<'a> Foo<'a> { diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr similarity index 85% rename from src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr index 0399d5f893d..c39301588ac 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-inherent-1.rs:12:5 + --> $DIR/constant-in-expr-inherent-1.rs:8:5 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr deleted file mode 100644 index 61efa879fc0..00000000000 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/constant-in-expr-normalize.rs:22:5 - | -LL | <() as Foo<'a>>::C - | ^^^^^^^^^^^^^^^^^^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/constant-in-expr-normalize.rs:21:8 - | -LL | fn foo<'a>(_: &'a u32) -> &'static u32 { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs index 262f0ae318f..b7095430d8b 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Mirror { type Me; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr similarity index 86% rename from src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr index 4c1e6bee2aa..541a2cfaf29 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-normalize.rs:22:5 + --> $DIR/constant-in-expr-normalize.rs:18:5 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr deleted file mode 100644 index 93f7156e557..00000000000 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/constant-in-expr-trait-item-1.rs:14:5 - | -LL | <() as Foo<'a>>::C - | ^^^^^^^^^^^^^^^^^^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/constant-in-expr-trait-item-1.rs:13:8 - | -LL | fn foo<'a>(_: &'a u32) -> &'static u32 { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs index 512edb501c4..e0400b2cc02 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr similarity index 85% rename from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr index 990d0ae385f..ea0fcb6d634 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-1.rs:14:5 + --> $DIR/constant-in-expr-trait-item-1.rs:10:5 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr deleted file mode 100644 index f43ade38937..00000000000 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/constant-in-expr-trait-item-2.rs:14:5 - | -LL | >::C - | ^^^^^^^^^^^^^^^^^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/constant-in-expr-trait-item-2.rs:13:8 - | -LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs index b3dfbd984eb..73c4e577b05 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr similarity index 85% rename from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr index 8c0430f1e09..ff549f1d88b 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-2.rs:14:5 + --> $DIR/constant-in-expr-trait-item-2.rs:10:5 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr deleted file mode 100644 index e9393aa05ab..00000000000 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements - --> $DIR/constant-in-expr-trait-item-3.rs:14:5 - | -LL | T::C - | ^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/constant-in-expr-trait-item-3.rs:13:8 - | -LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { - | ^^ -note: ...so that the types are compatible - --> $DIR/constant-in-expr-trait-item-3.rs:14:5 - | -LL | T::C - | ^^^^ - = note: expected `Foo<'_>` - found `Foo<'a>` - = note: but, the lifetime must be valid for the static lifetime... -note: ...so that reference does not outlive borrowed content - --> $DIR/constant-in-expr-trait-item-3.rs:14:5 - | -LL | T::C - | ^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs index 6e78d94c2f6..567e31ef936 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr similarity index 84% rename from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr index cbcaf042f05..7f160d8e398 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-3.rs:14:5 + --> $DIR/constant-in-expr-trait-item-3.rs:10:5 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs index 45f56836d18..ccda9129dab 100644 --- a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs +++ b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.rs @@ -4,7 +4,6 @@ // compile-flags:-Zverbose #![allow(warnings)] -#![feature(nll)] #![feature(rustc_attrs)] struct SomeStruct { t: T } diff --git a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr index ae123b8ab54..5860621909c 100644 --- a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr +++ b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr @@ -1,5 +1,5 @@ error: user substs: UserSubsts { substs: [&ReStatic u32], user_self_ty: None } - --> $DIR/dump-adt-brace-struct.rs:20:5 + --> $DIR/dump-adt-brace-struct.rs:19:5 | LL | SomeStruct::<&'static u32> { t: &22 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/nll/user-annotations/dump-fn-method.rs b/src/test/ui/nll/user-annotations/dump-fn-method.rs index b689f18c225..148d63d848f 100644 --- a/src/test/ui/nll/user-annotations/dump-fn-method.rs +++ b/src/test/ui/nll/user-annotations/dump-fn-method.rs @@ -3,7 +3,6 @@ // compile-flags:-Zverbose -#![feature(nll)] #![feature(rustc_attrs)] // Note: we reference the names T and U in the comments below. diff --git a/src/test/ui/nll/user-annotations/dump-fn-method.stderr b/src/test/ui/nll/user-annotations/dump-fn-method.stderr index 631bcde4ee8..d139efa888f 100644 --- a/src/test/ui/nll/user-annotations/dump-fn-method.stderr +++ b/src/test/ui/nll/user-annotations/dump-fn-method.stderr @@ -1,23 +1,23 @@ error: user substs: UserSubsts { substs: [&ReStatic u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:30:13 + --> $DIR/dump-fn-method.rs:29:13 | LL | let x = foo::<&'static u32>; | ^^^^^^^^^^^^^^^^^^^ error: user substs: UserSubsts { substs: [^0, u32, ^1], user_self_ty: None } - --> $DIR/dump-fn-method.rs:36:13 + --> $DIR/dump-fn-method.rs:35:13 | LL | let x = <_ as Bazoom>::method::<_>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: user substs: UserSubsts { substs: [u8, &ReStatic u16, u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:45:13 + --> $DIR/dump-fn-method.rs:44:13 | LL | let x = >::method::; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: user substs: UserSubsts { substs: [^0, ^1, u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:53:5 + --> $DIR/dump-fn-method.rs:52:5 | LL | y.method::(44, 66); | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/nll/user-annotations/inherent-associated-constants.rs b/src/test/ui/nll/user-annotations/inherent-associated-constants.rs index 2490187605a..fe2641fd63b 100644 --- a/src/test/ui/nll/user-annotations/inherent-associated-constants.rs +++ b/src/test/ui/nll/user-annotations/inherent-associated-constants.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct A<'a>(&'a ()); impl A<'static> { diff --git a/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr b/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr index 76845469898..ffbfc40f537 100644 --- a/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr +++ b/src/test/ui/nll/user-annotations/inherent-associated-constants.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/inherent-associated-constants.rs:10:5 + --> $DIR/inherent-associated-constants.rs:8:5 | LL | fn non_wf_associated_const<'a>(x: i32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/issue-54124.rs b/src/test/ui/nll/user-annotations/issue-54124.rs index e1de67aa938..5ae03c89406 100644 --- a/src/test/ui/nll/user-annotations/issue-54124.rs +++ b/src/test/ui/nll/user-annotations/issue-54124.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn test<'a>() { let _:fn(&()) = |_:&'a ()| {}; //~ ERROR lifetime may not live long enough //~^ ERROR lifetime may not live long enough diff --git a/src/test/ui/nll/user-annotations/issue-54124.stderr b/src/test/ui/nll/user-annotations/issue-54124.stderr index 6cfccf7cb69..2556af2dd7d 100644 --- a/src/test/ui/nll/user-annotations/issue-54124.stderr +++ b/src/test/ui/nll/user-annotations/issue-54124.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-54124.rs:4:22 + --> $DIR/issue-54124.rs:2:22 | LL | fn test<'a>() { | -- lifetime `'a` defined here @@ -9,7 +9,7 @@ LL | let _:fn(&()) = |_:&'a ()| {}; | requires that `'1` must outlive `'a` error: lifetime may not live long enough - --> $DIR/issue-54124.rs:4:22 + --> $DIR/issue-54124.rs:2:22 | LL | fn test<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs index 3d042d442d5..c71937a5021 100644 --- a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs +++ b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs @@ -7,8 +7,6 @@ // 2. the bindings (if any) nested within the pattern on the left-hand // side (and here, the type-constraint is *invariant*). -#![feature(nll)] - #![allow(dead_code, unused_mut)] type PairUncoupled<'a, 'b, T> = (&'a T, &'b T); type PairCoupledRegions<'a, T> = (&'a T, &'a T); diff --git a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr index 5929707e41e..8399ef04e83 100644 --- a/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr +++ b/src/test/ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-55748-pat-types-constrain-bindings.rs:35:5 + --> $DIR/issue-55748-pat-types-constrain-bindings.rs:33:5 | LL | fn coupled_regions_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | y | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/issue-55748-pat-types-constrain-bindings.rs:49:5 + --> $DIR/issue-55748-pat-types-constrain-bindings.rs:47:5 | LL | fn coupled_types_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { | -- lifetime `'a` defined here @@ -17,7 +17,7 @@ LL | y | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/issue-55748-pat-types-constrain-bindings.rs:62:5 + --> $DIR/issue-55748-pat-types-constrain-bindings.rs:60:5 | LL | fn coupled_wilds_lhs<'a>(_x: &'a u32, s: &'static u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs b/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs index f4969bb4067..9b3ec702c75 100644 --- a/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs +++ b/src/test/ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs @@ -1,7 +1,7 @@ // Check that repeated type variables are correctly handled #![allow(unused)] -#![feature(nll, type_ascription)] +#![feature(type_ascription)] type PairUncoupled<'a, 'b, T> = (&'a T, &'b T); type PairCoupledTypes = (T, T); diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs index b7292c0acbe..7bfed61d40a 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Check that substitutions given on the self type (here, `A`) carry // through to NLL. diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr index 70e1cda004b..94861babd6f 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-1.stderr @@ -1,5 +1,5 @@ error[E0597]: `v` does not live long enough - --> $DIR/method-ufcs-inherent-1.rs:16:26 + --> $DIR/method-ufcs-inherent-1.rs:14:26 | LL | fn foo<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs index 24d83c468f4..7ddb1336082 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Check that inherent methods invoked with `::new` style // carry their annotations through to NLL. diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr index 50e4fb25991..4ad61dc81c4 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-3.stderr @@ -1,5 +1,5 @@ error[E0597]: `v` does not live long enough - --> $DIR/method-ufcs-inherent-3.rs:16:26 + --> $DIR/method-ufcs-inherent-3.rs:14:26 | LL | fn foo<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/patterns.rs b/src/test/ui/nll/user-annotations/patterns.rs index 8c8e61cd6fb..1f635d7f50c 100644 --- a/src/test/ui/nll/user-annotations/patterns.rs +++ b/src/test/ui/nll/user-annotations/patterns.rs @@ -1,7 +1,5 @@ // Test that various patterns also enforce types. -#![feature(nll)] - fn variable_no_initializer() { let x = 22; let y: &'static u32; diff --git a/src/test/ui/nll/user-annotations/patterns.stderr b/src/test/ui/nll/user-annotations/patterns.stderr index 7ebd0ae227a..60d6e6db363 100644 --- a/src/test/ui/nll/user-annotations/patterns.stderr +++ b/src/test/ui/nll/user-annotations/patterns.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:8:9 + --> $DIR/patterns.rs:6:9 | LL | let y: &'static u32; | ------------ type annotation requires that `x` is borrowed for `'static` @@ -9,7 +9,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:16:9 + --> $DIR/patterns.rs:14:9 | LL | let (y, z): (&'static u32, &'static u32); | ---------------------------- type annotation requires that `x` is borrowed for `'static` @@ -19,7 +19,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:22:13 + --> $DIR/patterns.rs:20:13 | LL | let y = &x; | ^^ borrowed value does not live long enough @@ -30,7 +30,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:41:9 + --> $DIR/patterns.rs:39:9 | LL | let Single { value: y }: Single<&'static u32>; | -------------------- type annotation requires that `x` is borrowed for `'static` @@ -40,7 +40,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:53:10 + --> $DIR/patterns.rs:51:10 | LL | let Single2 { value: mut _y }: Single2; | ------------------ type annotation requires that `x` is borrowed for `'static` @@ -50,7 +50,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:58:27 + --> $DIR/patterns.rs:56:27 | LL | let y: &'static u32 = &x; | ------------ ^^ borrowed value does not live long enough @@ -60,7 +60,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:63:27 + --> $DIR/patterns.rs:61:27 | LL | let _: &'static u32 = &x; | ------------ ^^ borrowed value does not live long enough @@ -71,7 +71,7 @@ LL | } | - `x` dropped here while still borrowed error[E0716]: temporary value dropped while borrowed - --> $DIR/patterns.rs:65:41 + --> $DIR/patterns.rs:63:41 | LL | let _: Vec<&'static String> = vec![&String::new()]; | -------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement @@ -80,7 +80,7 @@ LL | let _: Vec<&'static String> = vec![&String::new()]; | type annotation requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/patterns.rs:68:52 + --> $DIR/patterns.rs:66:52 | LL | let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44); | ------------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement @@ -89,7 +89,7 @@ LL | let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44); | type annotation requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/patterns.rs:71:53 + --> $DIR/patterns.rs:69:53 | LL | let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44); | ------------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement @@ -98,7 +98,7 @@ LL | let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44); | type annotation requires that borrow lasts for `'static` error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:77:40 + --> $DIR/patterns.rs:75:40 | LL | let (_, _): (&'static u32, u32) = (&x, 44); | ------------------- ^^ borrowed value does not live long enough @@ -108,7 +108,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:82:40 + --> $DIR/patterns.rs:80:40 | LL | let (y, _): (&'static u32, u32) = (&x, 44); | ------------------- ^^ borrowed value does not live long enough @@ -118,7 +118,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:87:69 + --> $DIR/patterns.rs:85:69 | LL | let Single { value: y }: Single<&'static u32> = Single { value: &x }; | -------------------- ^^ borrowed value does not live long enough @@ -128,7 +128,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:92:69 + --> $DIR/patterns.rs:90:69 | LL | let Single { value: _ }: Single<&'static u32> = Single { value: &x }; | -------------------- ^^ borrowed value does not live long enough @@ -138,7 +138,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/patterns.rs:100:17 + --> $DIR/patterns.rs:98:17 | LL | let Double { value1: _, value2: _ }: Double<&'static u32> = Double { | -------------------- type annotation requires that `x` is borrowed for `'static` @@ -149,7 +149,7 @@ LL | } | - `x` dropped here while still borrowed error: lifetime may not live long enough - --> $DIR/patterns.rs:113:5 + --> $DIR/patterns.rs:111:5 | LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here @@ -158,7 +158,7 @@ LL | y | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/patterns.rs:125:5 + --> $DIR/patterns.rs:123:5 | LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here @@ -167,7 +167,7 @@ LL | y | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/patterns.rs:130:5 + --> $DIR/patterns.rs:128:5 | LL | fn static_to_a_to_static_through_struct<'a>(_x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here @@ -176,7 +176,7 @@ LL | y | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/patterns.rs:134:18 + --> $DIR/patterns.rs:132:18 | LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/wf-self-type.rs b/src/test/ui/nll/user-annotations/wf-self-type.rs index d8caf4693b5..539226aabd7 100644 --- a/src/test/ui/nll/user-annotations/wf-self-type.rs +++ b/src/test/ui/nll/user-annotations/wf-self-type.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Foo<'a, 'b: 'a>(&'a &'b ()); impl<'a, 'b> Foo<'a, 'b> { diff --git a/src/test/ui/nll/user-annotations/wf-self-type.stderr b/src/test/ui/nll/user-annotations/wf-self-type.stderr index 902b4c68755..1d3ae7cfbd7 100644 --- a/src/test/ui/nll/user-annotations/wf-self-type.stderr +++ b/src/test/ui/nll/user-annotations/wf-self-type.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/wf-self-type.rs:12:5 + --> $DIR/wf-self-type.rs:10:5 | LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/where_clauses_in_functions.rs b/src/test/ui/nll/where_clauses_in_functions.rs index 0d35c09b8ef..826065d0290 100644 --- a/src/test/ui/nll/where_clauses_in_functions.rs +++ b/src/test/ui/nll/where_clauses_in_functions.rs @@ -1,5 +1,3 @@ -// compile-flags: -Zborrowck=mir - #![allow(dead_code)] fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) diff --git a/src/test/ui/nll/where_clauses_in_functions.stderr b/src/test/ui/nll/where_clauses_in_functions.stderr index 1badb7d753b..afb25e3bc69 100644 --- a/src/test/ui/nll/where_clauses_in_functions.stderr +++ b/src/test/ui/nll/where_clauses_in_functions.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/where_clauses_in_functions.rs:13:5 + --> $DIR/where_clauses_in_functions.rs:11:5 | LL | fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/where_clauses_in_structs.rs b/src/test/ui/nll/where_clauses_in_structs.rs index 8bc6b2e4a4f..fae5d3811ec 100644 --- a/src/test/ui/nll/where_clauses_in_structs.rs +++ b/src/test/ui/nll/where_clauses_in_structs.rs @@ -1,5 +1,3 @@ -// compile-flags: -Z borrowck=mir - #![allow(dead_code)] use std::cell::Cell; diff --git a/src/test/ui/nll/where_clauses_in_structs.stderr b/src/test/ui/nll/where_clauses_in_structs.stderr index b88c90e8f54..c46cfcb4134 100644 --- a/src/test/ui/nll/where_clauses_in_structs.stderr +++ b/src/test/ui/nll/where_clauses_in_structs.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/where_clauses_in_structs.rs:13:11 + --> $DIR/where_clauses_in_structs.rs:11:11 | LL | fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr deleted file mode 100644 index c402d1fefad..00000000000 --- a/src/test/ui/object-lifetime/object-lifetime-default-elision.base.stderr +++ /dev/null @@ -1,61 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements - --> $DIR/object-lifetime-default-elision.rs:75:5 - | -LL | ss - | ^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/object-lifetime-default-elision.rs:58:10 - | -LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/object-lifetime-default-elision.rs:75:5 - | -LL | ss - | ^^ -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/object-lifetime-default-elision.rs:58:13 - | -LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { - | ^^ -note: ...so that the types are compatible - --> $DIR/object-lifetime-default-elision.rs:75:5 - | -LL | ss - | ^^ - = note: expected `&'b (dyn SomeTrait + 'b)` - found `&dyn SomeTrait` - -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/object-lifetime-default-elision.rs:75:5 - | -LL | ss - | ^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/object-lifetime-default-elision.rs:58:10 - | -LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { - | ^^ -note: ...so that the declared lifetime parameter bounds are satisfied - --> $DIR/object-lifetime-default-elision.rs:75:5 - | -LL | ss - | ^^ -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/object-lifetime-default-elision.rs:58:13 - | -LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { - | ^^ -note: ...so that the types are compatible - --> $DIR/object-lifetime-default-elision.rs:75:5 - | -LL | ss - | ^^ - = note: expected `&'b (dyn SomeTrait + 'b)` - found `&dyn SomeTrait` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.rs b/src/test/ui/object-lifetime/object-lifetime-default-elision.rs index 16b4df7bad5..f7c0261cfbb 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-elision.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test various cases where the old rules under lifetime elision // yield slightly different results than the new rules. @@ -73,9 +69,7 @@ fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { // which fails to type check. ss - //[base]~^ ERROR cannot infer - //[base]~| ERROR cannot infer - //[nll]~^^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr similarity index 89% rename from src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr rename to src/test/ui/object-lifetime/object-lifetime-default-elision.stderr index 49bbadf7224..61e96f59fed 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/object-lifetime-default-elision.rs:75:5 + --> $DIR/object-lifetime-default-elision.rs:71:5 | LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr deleted file mode 100644 index 5a8cba175e9..00000000000 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.base.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0759]: `ss` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/object-lifetime-default-from-box-error.rs:22:5 - | -LL | fn load(ss: &mut SomeStruct) -> Box { - | --------------- this data with an anonymous lifetime `'_`... -... -LL | ss.r - | ^^^^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/object-lifetime-default-from-box-error.rs:18:37 - | -LL | fn load(ss: &mut SomeStruct) -> Box { - | ^^^^^^^^^^^^^ `'static` requirement introduced here -... -LL | ss.r - | ---- because of this returned expression -help: to declare that the trait object captures data from argument `ss`, you can add an explicit `'_` lifetime bound - | -LL | fn load(ss: &mut SomeStruct) -> Box { - | ++++ - -error[E0621]: explicit lifetime required in the type of `ss` - --> $DIR/object-lifetime-default-from-box-error.rs:38:12 - | -LL | fn store1<'b>(ss: &mut SomeStruct, b: Box) { - | --------------- help: add explicit lifetime `'b` to the type of `ss`: `&mut SomeStruct<'b>` -... -LL | ss.r = b; - | ^ lifetime `'b` required - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0621, E0759. -For more information about an error, try `rustc --explain E0621`. diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs index 1cb9834913c..f9b3e2238d3 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test various cases where the defaults should lead to errors being // reported. @@ -20,9 +16,8 @@ fn load(ss: &mut SomeStruct) -> Box { // is illegal. ss.r - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR cannot move out of + //~^ ERROR lifetime may not live long enough + //~| ERROR cannot move out of } fn store(ss: &mut SomeStruct, b: Box) { diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr similarity index 87% rename from src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr rename to src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr index 7907813f267..15b36925c47 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/object-lifetime-default-from-box-error.rs:22:5 + --> $DIR/object-lifetime-default-from-box-error.rs:18:5 | LL | fn load(ss: &mut SomeStruct) -> Box { | -- has type `&mut SomeStruct<'1>` @@ -13,13 +13,13 @@ LL | fn load(ss: &mut SomeStruct) -> Box { | ++++ error[E0507]: cannot move out of `ss.r` which is behind a mutable reference - --> $DIR/object-lifetime-default-from-box-error.rs:22:5 + --> $DIR/object-lifetime-default-from-box-error.rs:18:5 | LL | ss.r | ^^^^ move occurs because `ss.r` has type `Box`, which does not implement the `Copy` trait error[E0621]: explicit lifetime required in the type of `ss` - --> $DIR/object-lifetime-default-from-box-error.rs:38:5 + --> $DIR/object-lifetime-default-from-box-error.rs:33:5 | LL | fn store1<'b>(ss: &mut SomeStruct, b: Box) { | --------------- help: add explicit lifetime `'b` to the type of `ss`: `&mut SomeStruct<'b>` diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr deleted file mode 100644 index 7e88aa32357..00000000000 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/object-lifetime-default-from-rptr-box-error.rs:19:12 - | -LL | ss.t = t; - | ^ lifetime mismatch - | - = note: expected reference `&'a Box<(dyn Test + 'static)>` - found reference `&'a Box<(dyn Test + 'a)>` -note: the lifetime `'a` as defined here... - --> $DIR/object-lifetime-default-from-rptr-box-error.rs:18:6 - | -LL | fn c<'a>(t: &'a Box, mut ss: SomeStruct<'a>) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs index 8cdd64be193..de79eee6a7d 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test that the lifetime from the enclosing `&` is "inherited" // through the `Box` struct. @@ -17,8 +13,7 @@ struct SomeStruct<'a> { fn c<'a>(t: &'a Box, mut ss: SomeStruct<'a>) { ss.t = t; - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr similarity index 81% rename from src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr index a07cc0718f1..7d6f9f39d13 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/object-lifetime-default-from-rptr-box-error.rs:19:5 + --> $DIR/object-lifetime-default-from-rptr-box-error.rs:15:5 | LL | fn c<'a>(t: &'a Box, mut ss: SomeStruct<'a>) { | -- lifetime `'a` defined here diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr deleted file mode 100644 index b97a7d22549..00000000000 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:24:12 - | -LL | ss.t = t; - | ^ lifetime mismatch - | - = note: expected reference `&'a MyBox<(dyn Test + 'static)>` - found reference `&'a MyBox<(dyn Test + 'a)>` -note: the lifetime `'a` as defined here... - --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:23:6 - | -LL | fn c<'a>(t: &'a MyBox, mut ss: SomeStruct<'a>) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs index 2d9a148a389..877486e1557 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test that the lifetime from the enclosing `&` is "inherited" // through the `MyBox` struct. @@ -22,8 +18,7 @@ struct MyBox { fn c<'a>(t: &'a MyBox, mut ss: SomeStruct<'a>) { ss.t = t; - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr similarity index 81% rename from src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr index 63d51b5c28c..2bc8e097859 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:24:5 + --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:20:5 | LL | fn c<'a>(t: &'a MyBox, mut ss: SomeStruct<'a>) { | -- lifetime `'a` defined here diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr deleted file mode 100644 index 6a72fab307b..00000000000 --- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.base.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/object-lifetime-default-mybox.rs:31:5 - | -LL | fn load1<'a,'b>(a: &'a MyBox, - | ------------------------ this parameter and the return type are declared with different lifetimes... -LL | b: &'b MyBox) -LL | -> &'b MyBox - | ------------------------ -LL | { -LL | a - | ^ ...but data from `a` is returned here - -error[E0308]: mismatched types - --> $DIR/object-lifetime-default-mybox.rs:37:11 - | -LL | load0(ss) - | ^^ lifetime mismatch - | - = note: expected reference `&MyBox<(dyn SomeTrait + 'static)>` - found reference `&MyBox<(dyn SomeTrait + 'a)>` -note: the lifetime `'a` as defined here... - --> $DIR/object-lifetime-default-mybox.rs:36:10 - | -LL | fn load2<'a>(ss: &MyBox) -> MyBox { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0308, E0623. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs b/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs index 874556dafeb..5e6e5e2c063 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default-mybox.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - // Test a "pass-through" object-lifetime-default that produces errors. #![allow(dead_code)] @@ -29,14 +25,12 @@ fn load1<'a,'b>(a: &'a MyBox, -> &'b MyBox { a - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn load2<'a>(ss: &MyBox) -> MyBox { load0(ss) - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR borrowed data escapes outside of function + //~^ ERROR borrowed data escapes outside of function } fn main() { diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr similarity index 90% rename from src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr rename to src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr index aa454cb9931..a1ef0243e3a 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/object-lifetime-default-mybox.rs:31:5 + --> $DIR/object-lifetime-default-mybox.rs:27:5 | LL | fn load1<'a,'b>(a: &'a MyBox, | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | a = help: consider adding the following bound: `'a: 'b` error[E0521]: borrowed data escapes outside of function - --> $DIR/object-lifetime-default-mybox.rs:37:5 + --> $DIR/object-lifetime-default-mybox.rs:32:5 | LL | fn load2<'a>(ss: &MyBox) -> MyBox { | -- -- `ss` is a reference that is only valid in the function body diff --git a/src/test/ui/object-lifetime/object-lifetime-default.rs b/src/test/ui/object-lifetime/object-lifetime-default.rs index 379b92e6dc7..60b6629e694 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default.rs @@ -1,5 +1,3 @@ -// ignore-compare-mode-nll - #![feature(rustc_attrs)] #[rustc_object_lifetime_default] diff --git a/src/test/ui/object-lifetime/object-lifetime-default.stderr b/src/test/ui/object-lifetime/object-lifetime-default.stderr index f71c8cd0e0c..60cb98c8fd3 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default.stderr @@ -1,41 +1,41 @@ error: BaseDefault - --> $DIR/object-lifetime-default.rs:6:1 + --> $DIR/object-lifetime-default.rs:4:1 | LL | struct A(T); | ^^^^^^^^^^^^^^^ error: BaseDefault - --> $DIR/object-lifetime-default.rs:9:1 + --> $DIR/object-lifetime-default.rs:7:1 | LL | struct B<'a,T>(&'a (), T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: 'a - --> $DIR/object-lifetime-default.rs:12:1 + --> $DIR/object-lifetime-default.rs:10:1 | LL | struct C<'a,T:'a>(&'a T); | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: Ambiguous - --> $DIR/object-lifetime-default.rs:15:1 + --> $DIR/object-lifetime-default.rs:13:1 | LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: 'b - --> $DIR/object-lifetime-default.rs:18:1 + --> $DIR/object-lifetime-default.rs:16:1 | LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: 'a,'b - --> $DIR/object-lifetime-default.rs:21:1 + --> $DIR/object-lifetime-default.rs:19:1 | LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: 'a,Ambiguous - --> $DIR/object-lifetime-default.rs:24:1 + --> $DIR/object-lifetime-default.rs:22:1 | LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser/issues/issue-14303-fncall.full.stderr b/src/test/ui/parser/issues/issue-14303-fncall.full.stderr index 02af61e8539..0c152516abc 100644 --- a/src/test/ui/parser/issues/issue-14303-fncall.full.stderr +++ b/src/test/ui/parser/issues/issue-14303-fncall.full.stderr @@ -1,5 +1,5 @@ error[E0747]: type provided when a lifetime was expected - --> $DIR/issue-14303-fncall.rs:16:26 + --> $DIR/issue-14303-fncall.rs:15:26 | LL | .collect::>>(); | ^ diff --git a/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr b/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr index 9f3359b3f68..57181577600 100644 --- a/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr +++ b/src/test/ui/parser/issues/issue-14303-fncall.generic_arg.stderr @@ -1,5 +1,5 @@ error[E0747]: inferred provided when a lifetime was expected - --> $DIR/issue-14303-fncall.rs:16:26 + --> $DIR/issue-14303-fncall.rs:15:26 | LL | .collect::>>(); | ^ diff --git a/src/test/ui/parser/issues/issue-14303-fncall.rs b/src/test/ui/parser/issues/issue-14303-fncall.rs index 976a79a59b1..afc4959f175 100644 --- a/src/test/ui/parser/issues/issue-14303-fncall.rs +++ b/src/test/ui/parser/issues/issue-14303-fncall.rs @@ -1,5 +1,4 @@ // revisions: full generic_arg -// compile-flags: -Zborrowck=mir // can't run rustfix because it doesn't handle multipart suggestions correctly // we need the above to avoid ast borrowck failure in recovered code #![cfg_attr(generic_arg, feature(generic_arg_infer))] diff --git a/src/test/ui/regions/issue-28848.base.stderr b/src/test/ui/regions/issue-28848.base.stderr deleted file mode 100644 index f10b19738c4..00000000000 --- a/src/test/ui/regions/issue-28848.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0478]: lifetime bound not satisfied - --> $DIR/issue-28848.rs:14:5 - | -LL | Foo::<'a, 'b>::xmute(u) - | ^^^^^^^^^^^^^ - | -note: lifetime parameter instantiated with the lifetime `'b` as defined here - --> $DIR/issue-28848.rs:13:16 - | -LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { - | ^^ -note: but lifetime parameter must outlive the lifetime `'a` as defined here - --> $DIR/issue-28848.rs:13:12 - | -LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0478`. diff --git a/src/test/ui/regions/issue-28848.rs b/src/test/ui/regions/issue-28848.rs index d8ab42a08d4..0eb3d89c590 100644 --- a/src/test/ui/regions/issue-28848.rs +++ b/src/test/ui/regions/issue-28848.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Foo<'a, 'b: 'a>(&'a &'b ()); impl<'a, 'b> Foo<'a, 'b> { @@ -12,8 +8,7 @@ impl<'a, 'b> Foo<'a, 'b> { pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { Foo::<'a, 'b>::xmute(u) - //[base]~^ ERROR lifetime bound not satisfied - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/issue-28848.nll.stderr b/src/test/ui/regions/issue-28848.stderr similarity index 92% rename from src/test/ui/regions/issue-28848.nll.stderr rename to src/test/ui/regions/issue-28848.stderr index f9de8948272..a29dac4c9c8 100644 --- a/src/test/ui/regions/issue-28848.nll.stderr +++ b/src/test/ui/regions/issue-28848.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-28848.rs:14:5 + --> $DIR/issue-28848.rs:10:5 | LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/issue-78262.nll.stderr b/src/test/ui/regions/issue-78262.base.stderr similarity index 94% rename from src/test/ui/regions/issue-78262.nll.stderr rename to src/test/ui/regions/issue-78262.base.stderr index 721dafac0be..7f232e4a7b2 100644 --- a/src/test/ui/regions/issue-78262.nll.stderr +++ b/src/test/ui/regions/issue-78262.base.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of closure - --> $DIR/issue-78262.rs:14:26 + --> $DIR/issue-78262.rs:12:26 | LL | let f = |x: &dyn TT| x.func(); | - - ^^^^^^^^ diff --git a/src/test/ui/regions/issue-78262.default.stderr b/src/test/ui/regions/issue-78262.default.stderr deleted file mode 100644 index dcb67e6a654..00000000000 --- a/src/test/ui/regions/issue-78262.default.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-78262.rs:14:28 - | -LL | let f = |x: &dyn TT| x.func(); - | ^^^^ lifetime mismatch - | - = note: expected reference `&(dyn TT + 'static)` - found reference `&dyn TT` -note: the anonymous lifetime #1 defined here... - --> $DIR/issue-78262.rs:14:13 - | -LL | let f = |x: &dyn TT| x.func(); - | ^^^^^^^^^^^^^^^^^^^^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/issue-78262.polonius.stderr b/src/test/ui/regions/issue-78262.polonius.stderr index 721dafac0be..7f232e4a7b2 100644 --- a/src/test/ui/regions/issue-78262.polonius.stderr +++ b/src/test/ui/regions/issue-78262.polonius.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of closure - --> $DIR/issue-78262.rs:14:26 + --> $DIR/issue-78262.rs:12:26 | LL | let f = |x: &dyn TT| x.func(); | - - ^^^^^^^^ diff --git a/src/test/ui/regions/issue-78262.rs b/src/test/ui/regions/issue-78262.rs index b88ad678ee6..642dbd7f821 100644 --- a/src/test/ui/regions/issue-78262.rs +++ b/src/test/ui/regions/issue-78262.rs @@ -1,8 +1,6 @@ -// revisions: default nll polonius -// ignore-compare-mode-nll +// revisions: base polonius // ignore-compare-mode-polonius -// [nll] compile-flags: -Z borrowck=mir -// [polonius] compile-flags: -Z borrowck=mir -Z polonius +// [polonius] compile-flags: -Z polonius trait TT {} @@ -11,7 +9,7 @@ impl dyn TT { } fn main() { - let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types - //[nll]~^ ERROR: borrowed data escapes outside of closure + let f = |x: &dyn TT| x.func(); + //[base]~^ ERROR: borrowed data escapes outside of closure //[polonius]~^^ ERROR: borrowed data escapes outside of closure } diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.base.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.base.stderr deleted file mode 100644 index ce21751a95a..00000000000 --- a/src/test/ui/regions/region-invariant-static-error-reporting.base.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0308]: `if` and `else` have incompatible types - --> $DIR/region-invariant-static-error-reporting.rs:21:9 - | -LL | let bad = if x.is_some() { - | _______________- -LL | | x.unwrap() - | | ---------- expected because of this -LL | | } else { -LL | | mk_static() - | | ^^^^^^^^^^^ lifetime mismatch -LL | | }; - | |_____- `if` and `else` have incompatible types - | - = note: expected struct `Invariant<'a>` - found struct `Invariant<'static>` -note: the lifetime `'a` as defined here... - --> $DIR/region-invariant-static-error-reporting.rs:17:10 - | -LL | fn unify<'a>(x: Option>, f: fn(Invariant<'a>)) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.rs b/src/test/ui/regions/region-invariant-static-error-reporting.rs index b81022ca4b4..c8288b5923c 100644 --- a/src/test/ui/regions/region-invariant-static-error-reporting.rs +++ b/src/test/ui/regions/region-invariant-static-error-reporting.rs @@ -3,12 +3,7 @@ // over time, but this test used to exhibit some pretty bogus messages // that were not remotely helpful. -// revisions: base nll -// ignore-compare-mode-nll -//[base] error-pattern:the lifetime `'a` -//[base] error-pattern:the static lifetime -//[nll] compile-flags: -Z borrowck=mir -//[nll] error-pattern:argument requires that `'a` must outlive `'static` +// error-pattern:argument requires that `'a` must outlive `'static` struct Invariant<'a>(Option<&'a mut &'a mut ()>); @@ -16,9 +11,9 @@ fn mk_static() -> Invariant<'static> { Invariant(None) } fn unify<'a>(x: Option>, f: fn(Invariant<'a>)) { let bad = if x.is_some() { - x.unwrap() //[nll]~ ERROR borrowed data escapes outside of function [E0521] + x.unwrap() //~ ERROR borrowed data escapes outside of function [E0521] } else { - mk_static() //[base]~ ERROR `if` and `else` have incompatible types [E0308] + mk_static() }; f(bad); } diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.stderr similarity index 93% rename from src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr rename to src/test/ui/regions/region-invariant-static-error-reporting.stderr index 6905fd008c5..2ad39b00071 100644 --- a/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr +++ b/src/test/ui/regions/region-invariant-static-error-reporting.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of function - --> $DIR/region-invariant-static-error-reporting.rs:19:9 + --> $DIR/region-invariant-static-error-reporting.rs:14:9 | LL | fn unify<'a>(x: Option>, f: fn(Invariant<'a>)) { | -- - `x` is a reference that is only valid in the function body diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr deleted file mode 100644 index b8b9de627af..00000000000 --- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.base.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:12:10 - | -LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { - | --------- --------- these two types are declared with different lifetimes... -LL | // Illegal now because there is no `'b:'a` declaration. -LL | *x = *y; - | ^^ ...but data from `y` flows into `x` here - -error[E0623]: lifetime mismatch - --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:19:7 - | -LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { - | --------- --------- these two types are declared with different lifetimes... -... -LL | a(x, y); - | ^ ...but data from `y` flows into `x` here - -error[E0308]: mismatched types - --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:26:43 - | -LL | let _: fn(&mut &isize, &mut &isize) = a; - | ^ one type is more general than the other - | - = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` - found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0308, E0623. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs index 61ae1cc3fad..d364c467714 100644 --- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs +++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn a<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) where 'b: 'a { // Note: this is legal because of the `'b:'a` declaration. *x = *y; @@ -10,14 +6,12 @@ fn a<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) where 'b: 'a { fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { // Illegal now because there is no `'b:'a` declaration. *x = *y; - //[base]~^ ERROR E0623 } fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { // Here we try to call `foo` but do not know that `'a` and `'b` are // related as required. a(x, y); - //[base]~^ ERROR lifetime mismatch [E0623] } fn d() { diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr similarity index 88% rename from src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr rename to src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr index 8a4b3132646..48f2e1a2fa2 100644 --- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr +++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:26:43 + --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43 | LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ one type is more general than the other diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr deleted file mode 100644 index 062411e6f68..00000000000 --- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.base.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:13:10 - | -LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { - | --------- --------- these two types are declared with different lifetimes... -LL | // Illegal now because there is no `'b:'a` declaration. -LL | *x = *y; - | ^^ ...but data from `y` flows into `x` here - -error[E0623]: lifetime mismatch - --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:15:10 - | -LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { - | --------- --------- - | | - | these two types are declared with different lifetimes... -... -LL | *z = *y; - | ^^ ...but data from `y` flows into `z` here - -error[E0623]: lifetime mismatch - --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:21:7 - | -LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { - | --------- --------- these two types are declared with different lifetimes... -... -LL | a(x, y, z); - | ^ ...but data from `y` flows into `x` here - -error[E0308]: mismatched types - --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:28:56 - | -LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; - | ^ one type is more general than the other - | - = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` - found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0308, E0623. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs index da225d842d9..60dafdd528c 100644 --- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs +++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn a<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) where 'b: 'a + 'c { // Note: this is legal because of the `'b:'a` declaration. *x = *y; @@ -11,15 +7,13 @@ fn a<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) where fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { // Illegal now because there is no `'b:'a` declaration. *x = *y; - //[base]~^ ERROR E0623 - *z = *y; //[base]~ ERROR E0623 + *z = *y; } fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { // Here we try to call `foo` but do not know that `'a` and `'b` are // related as required. a(x, y, z); - //[base]~^ ERROR lifetime mismatch [E0623] } fn d() { diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr similarity index 98% rename from src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr rename to src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr index f304c69d44b..36f40cd9a0f 100644 --- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr +++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:28:56 + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56 | LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; | ^ one type is more general than the other diff --git a/src/test/ui/regions/region-object-lifetime-2.base.stderr b/src/test/ui/regions/region-object-lifetime-2.base.stderr deleted file mode 100644 index 118fe476500..00000000000 --- a/src/test/ui/regions/region-object-lifetime-2.base.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements - --> $DIR/region-object-lifetime-2.rs:14:7 - | -LL | x.borrowed() - | ^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/region-object-lifetime-2.rs:13:42 - | -LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/region-object-lifetime-2.rs:14:5 - | -LL | x.borrowed() - | ^ -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/region-object-lifetime-2.rs:13:45 - | -LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/region-object-lifetime-2.rs:14:5 - | -LL | x.borrowed() - | ^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/region-object-lifetime-2.rs b/src/test/ui/regions/region-object-lifetime-2.rs index e12b9822f60..cfdb8fefed3 100644 --- a/src/test/ui/regions/region-object-lifetime-2.rs +++ b/src/test/ui/regions/region-object-lifetime-2.rs @@ -1,10 +1,6 @@ // Various tests related to testing how region inference works // with respect to the object receivers. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo { fn borrowed<'a>(&'a self) -> &'a (); } @@ -12,8 +8,7 @@ trait Foo { // Borrowed receiver but two distinct lifetimes, we get an error. fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () { x.borrowed() - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/region-object-lifetime-2.nll.stderr b/src/test/ui/regions/region-object-lifetime-2.stderr similarity index 92% rename from src/test/ui/regions/region-object-lifetime-2.nll.stderr rename to src/test/ui/regions/region-object-lifetime-2.stderr index c0b09ebb6f5..d95289f3f9d 100644 --- a/src/test/ui/regions/region-object-lifetime-2.nll.stderr +++ b/src/test/ui/regions/region-object-lifetime-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/region-object-lifetime-2.rs:14:5 + --> $DIR/region-object-lifetime-2.rs:10:5 | LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/region-object-lifetime-4.base.stderr b/src/test/ui/regions/region-object-lifetime-4.base.stderr deleted file mode 100644 index 3765076a9c5..00000000000 --- a/src/test/ui/regions/region-object-lifetime-4.base.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements - --> $DIR/region-object-lifetime-4.rs:16:7 - | -LL | x.borrowed() - | ^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/region-object-lifetime-4.rs:15:41 - | -LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/region-object-lifetime-4.rs:16:5 - | -LL | x.borrowed() - | ^ -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/region-object-lifetime-4.rs:15:44 - | -LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/region-object-lifetime-4.rs:16:5 - | -LL | x.borrowed() - | ^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/region-object-lifetime-4.rs b/src/test/ui/regions/region-object-lifetime-4.rs index aad9c2c9521..8f42df831e3 100644 --- a/src/test/ui/regions/region-object-lifetime-4.rs +++ b/src/test/ui/regions/region-object-lifetime-4.rs @@ -1,10 +1,6 @@ // Various tests related to testing how region inference works // with respect to the object receivers. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo { fn borrowed<'a>(&'a self) -> &'a (); } @@ -14,8 +10,7 @@ trait Foo { // that it lives as long as the shorter lifetime. Therefore, error. fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () { x.borrowed() - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/region-object-lifetime-4.nll.stderr b/src/test/ui/regions/region-object-lifetime-4.stderr similarity index 92% rename from src/test/ui/regions/region-object-lifetime-4.nll.stderr rename to src/test/ui/regions/region-object-lifetime-4.stderr index a2a958f90b2..fda66a2412c 100644 --- a/src/test/ui/regions/region-object-lifetime-4.nll.stderr +++ b/src/test/ui/regions/region-object-lifetime-4.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/region-object-lifetime-4.rs:16:5 + --> $DIR/region-object-lifetime-4.rs:12:5 | LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr deleted file mode 100644 index 85bfa16b3d3..00000000000 --- a/src/test/ui/regions/region-object-lifetime-in-coercion.base.stderr +++ /dev/null @@ -1,98 +0,0 @@ -error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/region-object-lifetime-in-coercion.rs:12:46 - | -LL | fn a(v: &[u8]) -> Box { - | ----- this data with an anonymous lifetime `'_`... -LL | let x: Box = Box::new(v); - | ^ ...is used and required to live as long as `'static` here - | -help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` - | -LL | fn a(v: &[u8]) -> Box { - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn a(v: &'static [u8]) -> Box { - | ~~~~~~~~~~~~~ - -error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/region-object-lifetime-in-coercion.rs:19:14 - | -LL | fn b(v: &[u8]) -> Box { - | ----- this data with an anonymous lifetime `'_`... -LL | Box::new(v) - | ^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/region-object-lifetime-in-coercion.rs:18:33 - | -LL | fn b(v: &[u8]) -> Box { - | ^^^^^^^ `'static` requirement introduced here -LL | Box::new(v) - | ----------- because of this returned expression -help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` - | -LL | fn b(v: &[u8]) -> Box { - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn b(v: &'static [u8]) -> Box { - | ~~~~~~~~~~~~~ - -error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/region-object-lifetime-in-coercion.rs:27:14 - | -LL | fn c(v: &[u8]) -> Box { - | ----- this data with an anonymous lifetime `'_`... -... -LL | Box::new(v) - | ^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/region-object-lifetime-in-coercion.rs:24:23 - | -LL | fn c(v: &[u8]) -> Box { - | ^^^^^^^ `'static` requirement introduced here -... -LL | Box::new(v) - | ----------- because of this returned expression -help: to declare that the trait object captures data from argument `v`, you can add an explicit `'_` lifetime bound - | -LL | fn c(v: &[u8]) -> Box { - | ++++ - -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/region-object-lifetime-in-coercion.rs:33:14 - | -LL | Box::new(v) - | ^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/region-object-lifetime-in-coercion.rs:32:6 - | -LL | fn d<'a,'b>(v: &'a [u8]) -> Box { - | ^^ -note: ...so that the expression is assignable - --> $DIR/region-object-lifetime-in-coercion.rs:33:14 - | -LL | Box::new(v) - | ^ - = note: expected `&[u8]` - found `&'a [u8]` -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/region-object-lifetime-in-coercion.rs:32:9 - | -LL | fn d<'a,'b>(v: &'a [u8]) -> Box { - | ^^ -note: ...so that the types are compatible - --> $DIR/region-object-lifetime-in-coercion.rs:33:5 - | -LL | Box::new(v) - | ^^^^^^^^^^^ - = note: expected `Box<(dyn Foo + 'b)>` - found `Box` - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0495, E0759. -For more information about an error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.rs b/src/test/ui/regions/region-object-lifetime-in-coercion.rs index ed28d6c0ff1..95708de04d2 100644 --- a/src/test/ui/regions/region-object-lifetime-in-coercion.rs +++ b/src/test/ui/regions/region-object-lifetime-in-coercion.rs @@ -1,38 +1,30 @@ // Test that attempts to implicitly coerce a value into an // object respect the lifetime bound on the object type. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo {} impl<'a> Foo for &'a [u8] {} fn a(v: &[u8]) -> Box { let x: Box = Box::new(v); - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough x } fn b(v: &[u8]) -> Box { Box::new(v) - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn c(v: &[u8]) -> Box { // same as previous case due to RFC 599 Box::new(v) - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn d<'a,'b>(v: &'a [u8]) -> Box { Box::new(v) - //[base]~^ ERROR cannot infer an appropriate lifetime due to conflicting - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn e<'a:'b,'b>(v: &'a [u8]) -> Box { diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr similarity index 90% rename from src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr rename to src/test/ui/regions/region-object-lifetime-in-coercion.stderr index 724b06ce8b1..b5bb08c73c8 100644 --- a/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr +++ b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/region-object-lifetime-in-coercion.rs:12:12 + --> $DIR/region-object-lifetime-in-coercion.rs:8:12 | LL | fn a(v: &[u8]) -> Box { | - let's call the lifetime of this reference `'1` @@ -16,7 +16,7 @@ LL | fn a(v: &'static [u8]) -> Box { | ~~~~~~~~~~~~~ error: lifetime may not live long enough - --> $DIR/region-object-lifetime-in-coercion.rs:19:5 + --> $DIR/region-object-lifetime-in-coercion.rs:14:5 | LL | fn b(v: &[u8]) -> Box { | - let's call the lifetime of this reference `'1` @@ -33,7 +33,7 @@ LL | fn b(v: &'static [u8]) -> Box { | ~~~~~~~~~~~~~ error: lifetime may not live long enough - --> $DIR/region-object-lifetime-in-coercion.rs:27:5 + --> $DIR/region-object-lifetime-in-coercion.rs:21:5 | LL | fn c(v: &[u8]) -> Box { | - let's call the lifetime of this reference `'1` @@ -47,7 +47,7 @@ LL | fn c(v: &[u8]) -> Box { | ++++ error: lifetime may not live long enough - --> $DIR/region-object-lifetime-in-coercion.rs:33:5 + --> $DIR/region-object-lifetime-in-coercion.rs:26:5 | LL | fn d<'a,'b>(v: &'a [u8]) -> Box { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-addr-of-self.base.stderr b/src/test/ui/regions/regions-addr-of-self.base.stderr deleted file mode 100644 index 3167c2f2107..00000000000 --- a/src/test/ui/regions/regions-addr-of-self.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-addr-of-self.rs:11:37 - | -LL | pub fn chase_cat(&mut self) { - | --------- this data with an anonymous lifetime `'_`... -LL | let p: &'static mut usize = &mut self.cats_chased; - | ^^^^^^^^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/regions/regions-addr-of-self.rs b/src/test/ui/regions/regions-addr-of-self.rs index 698433c71b3..23647182fcf 100644 --- a/src/test/ui/regions/regions-addr-of-self.rs +++ b/src/test/ui/regions/regions-addr-of-self.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Dog { cats_chased: usize, } @@ -9,8 +5,7 @@ struct Dog { impl Dog { pub fn chase_cat(&mut self) { let p: &'static mut usize = &mut self.cats_chased; - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough *p += 1; } diff --git a/src/test/ui/regions/regions-addr-of-self.nll.stderr b/src/test/ui/regions/regions-addr-of-self.stderr similarity index 89% rename from src/test/ui/regions/regions-addr-of-self.nll.stderr rename to src/test/ui/regions/regions-addr-of-self.stderr index 1f720520f6b..3d7aac74bd4 100644 --- a/src/test/ui/regions/regions-addr-of-self.nll.stderr +++ b/src/test/ui/regions/regions-addr-of-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-addr-of-self.rs:11:16 + --> $DIR/regions-addr-of-self.rs:7:16 | LL | pub fn chase_cat(&mut self) { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.base.stderr b/src/test/ui/regions/regions-addr-of-upvar-self.base.stderr deleted file mode 100644 index 42d0638e8b7..00000000000 --- a/src/test/ui/regions/regions-addr-of-upvar-self.base.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements - --> $DIR/regions-addr-of-upvar-self.rs:12:41 - | -LL | let p: &'static mut usize = &mut self.food; - | ^^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'_` as defined here... - --> $DIR/regions-addr-of-upvar-self.rs:11:18 - | -LL | let _f = || { - | ^^ -note: ...so that closure can access `self` - --> $DIR/regions-addr-of-upvar-self.rs:12:41 - | -LL | let p: &'static mut usize = &mut self.food; - | ^^^^^^^^^^^^^^ - = note: but, the lifetime must be valid for the static lifetime... -note: ...so that reference does not outlive borrowed content - --> $DIR/regions-addr-of-upvar-self.rs:12:41 - | -LL | let p: &'static mut usize = &mut self.food; - | ^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.rs b/src/test/ui/regions/regions-addr-of-upvar-self.rs index 36cc592d47c..171eca32e29 100644 --- a/src/test/ui/regions/regions-addr-of-upvar-self.rs +++ b/src/test/ui/regions/regions-addr-of-upvar-self.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Dog { food: usize, } @@ -10,10 +6,9 @@ impl Dog { pub fn chase_cat(&mut self) { let _f = || { let p: &'static mut usize = &mut self.food; - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~^^^ ERROR lifetime may not live long enough - //[nll]~^^^^ ERROR E0597 + //~^ ERROR lifetime may not live long enough + //~^^ ERROR lifetime may not live long enough + //~^^^ ERROR E0597 *p = 3; }; } diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr b/src/test/ui/regions/regions-addr-of-upvar-self.stderr similarity index 90% rename from src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr rename to src/test/ui/regions/regions-addr-of-upvar-self.stderr index b8e37e92316..c16a6f8585b 100644 --- a/src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr +++ b/src/test/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:12:20 + --> $DIR/regions-addr-of-upvar-self.rs:8: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:12:20 + --> $DIR/regions-addr-of-upvar-self.rs:8: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:12:46 + --> $DIR/regions-addr-of-upvar-self.rs:8:46 | LL | let _f = || { | -- value captured here diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr deleted file mode 100644 index d9fd1aebf27..00000000000 --- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.migrate.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references - --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:44:12 - | -LL | let _: &'a WithAssoc> = loop { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:38:15 - | -LL | fn with_assoc<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:38:18 - | -LL | fn with_assoc<'a,'b>() { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs index 08bc64926fa..eb6e66818fc 100644 --- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs +++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs @@ -3,14 +3,6 @@ // outlive the location in which the type appears, even when the // associted type is in a supertype. Issue #22246. -// revisions: migrate nll -//[nll]compile-flags: -Z borrowck=mir - -// Since we are testing nll (and migration) explicitly as a separate -// revisions, don't worry about the --compare-mode=nll on this test. - -// ignore-compare-mode-nll - #![allow(dead_code)] pub trait TheTrait { @@ -42,8 +34,7 @@ fn with_assoc<'a,'b>() { // which is &'b (), must outlive 'a. let _: &'a WithAssoc> = loop { }; - //[migrate]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr similarity index 98% rename from src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr rename to src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr index ba7572ebe31..87e33e1ccff 100644 --- a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.nll.stderr +++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:44:12 + --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:36:12 | LL | fn with_assoc<'a,'b>() { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr deleted file mode 100644 index 9b45dcfd95a..00000000000 --- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.base.stderr +++ /dev/null @@ -1,75 +0,0 @@ -error[E0477]: the type `&'a isize` does not fulfill the required lifetime - --> $DIR/regions-bounded-by-trait-requiring-static.rs:26:5 - | -LL | assert_send::<&'a isize>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18 - | -LL | fn assert_send() { } - | ^^^^^^^ - -error[E0477]: the type `&'a str` does not fulfill the required lifetime - --> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5 - | -LL | assert_send::<&'a str>(); - | ^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18 - | -LL | fn assert_send() { } - | ^^^^^^^ - -error[E0477]: the type `&'a [isize]` does not fulfill the required lifetime - --> $DIR/regions-bounded-by-trait-requiring-static.rs:38:5 - | -LL | assert_send::<&'a [isize]>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18 - | -LL | fn assert_send() { } - | ^^^^^^^ - -error[E0477]: the type `Box<&'a isize>` does not fulfill the required lifetime - --> $DIR/regions-bounded-by-trait-requiring-static.rs:54:5 - | -LL | assert_send::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18 - | -LL | fn assert_send() { } - | ^^^^^^^ - -error[E0477]: the type `*const &'a isize` does not fulfill the required lifetime - --> $DIR/regions-bounded-by-trait-requiring-static.rs:67:5 - | -LL | assert_send::<*const &'a isize>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18 - | -LL | fn assert_send() { } - | ^^^^^^^ - -error[E0477]: the type `*mut &'a isize` does not fulfill the required lifetime - --> $DIR/regions-bounded-by-trait-requiring-static.rs:73:5 - | -LL | assert_send::<*mut &'a isize>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/regions-bounded-by-trait-requiring-static.rs:10:18 - | -LL | fn assert_send() { } - | ^^^^^^^ - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs index 37dc1300d39..7d02a46193e 100644 --- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs +++ b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs @@ -2,10 +2,6 @@ // in this file all test region bound and lifetime violations that are // detected during type check. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Dummy : 'static { } fn assert_send() { } @@ -24,20 +20,17 @@ fn static_lifime_ok<'a,T,U:Send>(_: &'a isize) { fn param_not_ok<'a>(x: &'a isize) { assert_send::<&'a isize>(); - //[base]~^ ERROR does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn param_not_ok1<'a>(_: &'a isize) { assert_send::<&'a str>(); - //[base]~^ ERROR does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn param_not_ok2<'a>(_: &'a isize) { assert_send::<&'a [isize]>(); - //[base]~^ ERROR does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // boxes are ok @@ -52,8 +45,7 @@ fn box_ok() { fn box_with_region_not_ok<'a>() { assert_send::>(); - //[base]~^ ERROR does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // raw pointers are ok unless they point at unsendable things @@ -65,14 +57,12 @@ fn unsafe_ok1<'a>(_: &'a isize) { fn unsafe_ok2<'a>(_: &'a isize) { assert_send::<*const &'a isize>(); - //[base]~^ ERROR does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn unsafe_ok3<'a>(_: &'a isize) { assert_send::<*mut &'a isize>(); - //[base]~^ ERROR does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr similarity index 84% rename from src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr rename to src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr index 558a77516bb..eea68cc8f1c 100644 --- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr +++ b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-bounded-by-trait-requiring-static.rs:26:5 + --> $DIR/regions-bounded-by-trait-requiring-static.rs:22:5 | LL | fn param_not_ok<'a>(x: &'a isize) { | -- lifetime `'a` defined here @@ -7,7 +7,7 @@ LL | assert_send::<&'a isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5 + --> $DIR/regions-bounded-by-trait-requiring-static.rs:27:5 | LL | fn param_not_ok1<'a>(_: &'a isize) { | -- lifetime `'a` defined here @@ -15,7 +15,7 @@ LL | assert_send::<&'a str>(); | ^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/regions-bounded-by-trait-requiring-static.rs:38:5 + --> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5 | LL | fn param_not_ok2<'a>(_: &'a isize) { | -- lifetime `'a` defined here @@ -23,7 +23,7 @@ LL | assert_send::<&'a [isize]>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/regions-bounded-by-trait-requiring-static.rs:54:5 + --> $DIR/regions-bounded-by-trait-requiring-static.rs:47:5 | LL | fn box_with_region_not_ok<'a>() { | -- lifetime `'a` defined here @@ -31,7 +31,7 @@ LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/regions-bounded-by-trait-requiring-static.rs:67:5 + --> $DIR/regions-bounded-by-trait-requiring-static.rs:59:5 | LL | fn unsafe_ok2<'a>(_: &'a isize) { | -- lifetime `'a` defined here @@ -39,7 +39,7 @@ LL | assert_send::<*const &'a isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/regions-bounded-by-trait-requiring-static.rs:73:5 + --> $DIR/regions-bounded-by-trait-requiring-static.rs:64:5 | LL | fn unsafe_ok3<'a>(_: &'a isize) { | -- lifetime `'a` defined here diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr deleted file mode 100644 index e031f0db412..00000000000 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:23:7 - | -LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) { - | ------- ------- these two types are declared with different lifetimes... -LL | // Here the value provided for 'y is 'y, and hence 'y:'x does not hold. -LL | a.bigger_region(b) - | ^^^^^^^^^^^^^ ...but data from `b` flows into `a` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs index e0965613f1d..c014b2ccf1e 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs +++ b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs @@ -1,7 +1,4 @@ // aux-build:rbmtp_cross_crate_lib.rs -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir // Check explicit region bounds on methods in the cross crate case. @@ -21,8 +18,7 @@ fn call_into_maybe_owned<'x,F:IntoMaybeOwned<'x>>(f: F) { fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) { // Here the value provided for 'y is 'y, and hence 'y:'x does not hold. a.bigger_region(b) - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr similarity index 99% rename from src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr rename to src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr index 4f5d747be71..6193bf02f6d 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr +++ b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:23:5 + --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:20:5 | LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) { | -- -- lifetime `'y` defined here diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr deleted file mode 100644 index 0a213e3f779..00000000000 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:24:7 - | -LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { - | ------- ------- these two types are declared with different lifetimes... -LL | // Here the value provided for 'y is 'b, and hence 'b:'a does not hold. -LL | f.method(b); - | ^^^^^^ ...but data from `b` flows into `a` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs index 8a52a1549ab..5548cb915d8 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs +++ b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs @@ -2,10 +2,6 @@ // nominal types (but not on other types) and that they are type // checked. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Inv<'a> { // invariant w/r/t 'a x: &'a mut &'a isize } @@ -22,8 +18,7 @@ fn caller1<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { // Here the value provided for 'y is 'b, and hence 'b:'a does not hold. f.method(b); - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn caller3<'a,'b:'a,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr similarity index 99% rename from src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr rename to src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr index 1c2f46a5fc1..0e0086be9ea 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr +++ b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:24:5 + --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:20:5 | LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr deleted file mode 100644 index 3d37a1ba47b..00000000000 --- a/src/test/ui/regions/regions-bounded-method-type-parameters.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0477]: the type `&'a isize` does not fulfill the required lifetime - --> $DIR/regions-bounded-method-type-parameters.rs:16:9 - | -LL | Foo.some_method::<&'a isize>(); - | ^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/regions-bounded-method-type-parameters.rs:12:22 - | -LL | fn some_method(self) { } - | ^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.rs b/src/test/ui/regions/regions-bounded-method-type-parameters.rs index 06bc1544a38..56e750003da 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters.rs +++ b/src/test/ui/regions/regions-bounded-method-type-parameters.rs @@ -2,10 +2,6 @@ // nominal types (but not on other types) and that they are type // checked. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Foo; impl Foo { @@ -14,8 +10,7 @@ impl Foo { fn caller<'a>(x: &isize) { Foo.some_method::<&'a isize>(); - //[base]~^ ERROR does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters.stderr similarity index 82% rename from src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr rename to src/test/ui/regions/regions-bounded-method-type-parameters.stderr index 05c3fa58ea3..b6d7b8aac5f 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr +++ b/src/test/ui/regions/regions-bounded-method-type-parameters.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-bounded-method-type-parameters.rs:16:9 + --> $DIR/regions-bounded-method-type-parameters.rs:12:9 | LL | fn caller<'a>(x: &isize) { | -- lifetime `'a` defined here diff --git a/src/test/ui/regions/regions-bounds.base.stderr b/src/test/ui/regions/regions-bounds.base.stderr deleted file mode 100644 index d853cdde336..00000000000 --- a/src/test/ui/regions/regions-bounds.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-bounds.rs:13:12 - | -LL | return e; - | ^ lifetime mismatch - | - = note: expected struct `TupleStruct<'b>` - found struct `TupleStruct<'a>` -note: the lifetime `'a` as defined here... - --> $DIR/regions-bounds.rs:12:10 - | -LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> { - | ^^ -note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/regions-bounds.rs:12:13 - | -LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> { - | ^^ - -error[E0308]: mismatched types - --> $DIR/regions-bounds.rs:19:12 - | -LL | return e; - | ^ lifetime mismatch - | - = note: expected struct `Struct<'b>` - found struct `Struct<'a>` -note: the lifetime `'a` as defined here... - --> $DIR/regions-bounds.rs:18:10 - | -LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> { - | ^^ -note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/regions-bounds.rs:18:13 - | -LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> { - | ^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-bounds.rs b/src/test/ui/regions/regions-bounds.rs index b13dac49f8c..fd4d75ab6b8 100644 --- a/src/test/ui/regions/regions-bounds.rs +++ b/src/test/ui/regions/regions-bounds.rs @@ -2,23 +2,17 @@ // nominal types (but not on other types) and that they are type // checked. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct TupleStruct<'a>(&'a isize); struct Struct<'a> { x:&'a isize } fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> { return e; - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> { return e; - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/regions/regions-bounds.nll.stderr b/src/test/ui/regions/regions-bounds.stderr similarity index 92% rename from src/test/ui/regions/regions-bounds.nll.stderr rename to src/test/ui/regions/regions-bounds.stderr index 7109220165f..430909e54a6 100644 --- a/src/test/ui/regions/regions-bounds.nll.stderr +++ b/src/test/ui/regions/regions-bounds.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-bounds.rs:13:12 + --> $DIR/regions-bounds.rs:9:12 | LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> { | -- -- lifetime `'b` defined here @@ -11,7 +11,7 @@ LL | return e; = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/regions-bounds.rs:19:12 + --> $DIR/regions-bounds.rs:14:12 | LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-close-associated-type-into-object.base.stderr b/src/test/ui/regions/regions-close-associated-type-into-object.base.stderr deleted file mode 100644 index fbbb5980401..00000000000 --- a/src/test/ui/regions/regions-close-associated-type-into-object.base.stderr +++ /dev/null @@ -1,40 +0,0 @@ -error[E0310]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:19:5 - | -LL | Box::new(item) - | ^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `::Item: 'static`... - = note: ...so that the type `::Item` will meet its required lifetime bounds - -error[E0310]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:26:5 - | -LL | Box::new(item) - | ^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `::Item: 'static`... - = note: ...so that the type `Box<::Item>` will meet its required lifetime bounds - -error[E0309]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:32:5 - | -LL | Box::new(item) - | ^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `::Item: 'a`... - = note: ...so that the type `::Item` will meet its required lifetime bounds - -error[E0309]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:39:5 - | -LL | Box::new(item) - | ^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `::Item: 'a`... - = note: ...so that the type `Box<::Item>` will meet its required lifetime bounds - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0309, E0310. -For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/regions/regions-close-associated-type-into-object.rs b/src/test/ui/regions/regions-close-associated-type-into-object.rs index 94199f56212..428477e2489 100644 --- a/src/test/ui/regions/regions-close-associated-type-into-object.rs +++ b/src/test/ui/regions/regions-close-associated-type-into-object.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait X {} diff --git a/src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr b/src/test/ui/regions/regions-close-associated-type-into-object.stderr similarity index 85% rename from src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr rename to src/test/ui/regions/regions-close-associated-type-into-object.stderr index dd4b97aa562..f7dcaa9d97e 100644 --- a/src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr +++ b/src/test/ui/regions/regions-close-associated-type-into-object.stderr @@ -1,5 +1,5 @@ error[E0310]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:19:5 + --> $DIR/regions-close-associated-type-into-object.rs:15:5 | LL | Box::new(item) | ^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | Box::new(item) = note: ...so that the type `::Item` will meet its required lifetime bounds error[E0310]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:26:5 + --> $DIR/regions-close-associated-type-into-object.rs:22:5 | LL | Box::new(item) | ^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | Box::new(item) = note: ...so that the type `::Item` will meet its required lifetime bounds error[E0309]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:32:5 + --> $DIR/regions-close-associated-type-into-object.rs:28:5 | LL | Box::new(item) | ^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | Box::new(item) = note: ...so that the type `::Item` will meet its required lifetime bounds error[E0309]: the associated type `::Item` may not live long enough - --> $DIR/regions-close-associated-type-into-object.rs:39:5 + --> $DIR/regions-close-associated-type-into-object.rs:35:5 | LL | Box::new(item) | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/regions/regions-close-object-into-object-2.base.stderr b/src/test/ui/regions/regions-close-object-into-object-2.base.stderr deleted file mode 100644 index ddf168ffd10..00000000000 --- a/src/test/ui/regions/regions-close-object-into-object-2.base.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-close-object-into-object-2.rs:13:16 - | -LL | fn g<'a, T: 'static>(v: Box + 'a>) -> Box { - | ------------------ this data with lifetime `'a`... -LL | Box::new(B(&*v)) as Box - | ^^^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/regions-close-object-into-object-2.rs:12:60 - | -LL | fn g<'a, T: 'static>(v: Box + 'a>) -> Box { - | ^^^^^^^ `'static` requirement introduced here -LL | Box::new(B(&*v)) as Box - | ------------------------------ because of this returned expression -help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` - | -LL | fn g<'a, T: 'static>(v: Box + 'a>) -> Box { - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn g<'a, T: 'static>(v: Box<(dyn A + 'static)>) -> Box { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/regions/regions-close-object-into-object-2.rs b/src/test/ui/regions/regions-close-object-into-object-2.rs index 33ea03f061e..6960af72c76 100644 --- a/src/test/ui/regions/regions-close-object-into-object-2.rs +++ b/src/test/ui/regions/regions-close-object-into-object-2.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait A { } struct B<'a, T:'a>(&'a (dyn A + 'a)); @@ -11,9 +7,8 @@ impl<'a, T> X for B<'a, T> {} fn g<'a, T: 'static>(v: Box + 'a>) -> Box { Box::new(B(&*v)) as Box - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough - //[nll]~| ERROR cannot return value referencing local data `*v` [E0515] + //~^ ERROR lifetime may not live long enough + //~| ERROR cannot return value referencing local data `*v` [E0515] } fn main() { } diff --git a/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr similarity index 91% rename from src/test/ui/regions/regions-close-object-into-object-2.nll.stderr rename to src/test/ui/regions/regions-close-object-into-object-2.stderr index 473c99b672f..aacb5ea4e87 100644 --- a/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-close-object-into-object-2.rs:13:5 + --> $DIR/regions-close-object-into-object-2.rs:9:5 | LL | fn g<'a, T: 'static>(v: Box + 'a>) -> Box { | -- lifetime `'a` defined here @@ -16,7 +16,7 @@ LL | fn g<'a, T: 'static>(v: Box<(dyn A + 'static)>) -> Box | ~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0515]: cannot return value referencing local data `*v` - --> $DIR/regions-close-object-into-object-2.rs:13:5 + --> $DIR/regions-close-object-into-object-2.rs:9:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^---^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/regions/regions-close-object-into-object-4.base.stderr b/src/test/ui/regions/regions-close-object-into-object-4.base.stderr deleted file mode 100644 index 33d4df3d194..00000000000 --- a/src/test/ui/regions/regions-close-object-into-object-4.base.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-close-object-into-object-4.rs:13:16 - | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | ---------------- this data with lifetime `'a`... -LL | Box::new(B(&*v)) as Box - | ^^^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/regions-close-object-into-object-4.rs:12:52 - | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | ^^^^^^^ `'static` requirement introduced here -LL | Box::new(B(&*v)) as Box - | ------------------------------ because of this returned expression -help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` - | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn i<'a, T, U>(v: Box<(dyn A + 'static)>) -> Box { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/regions/regions-close-object-into-object-4.rs b/src/test/ui/regions/regions-close-object-into-object-4.rs index 5a852b7329a..3bbad9cbffe 100644 --- a/src/test/ui/regions/regions-close-object-into-object-4.rs +++ b/src/test/ui/regions/regions-close-object-into-object-4.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait A { } struct B<'a, T:'a>(&'a (dyn A + 'a)); @@ -11,13 +7,12 @@ impl<'a, T> X for B<'a, T> {} fn i<'a, T, U>(v: Box+'a>) -> Box { Box::new(B(&*v)) as Box - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR the parameter type `U` may not live long enough [E0310] - //[nll]~| ERROR the parameter type `U` may not live long enough [E0310] - //[nll]~| ERROR the parameter type `U` may not live long enough [E0310] - //[nll]~| ERROR lifetime may not live long enough - //[nll]~| ERROR cannot return value referencing local data `*v` [E0515] - //[nll]~| ERROR the parameter type `U` may not live long enough [E0310] + //~^ ERROR the parameter type `U` may not live long enough [E0310] + //~| ERROR the parameter type `U` may not live long enough [E0310] + //~| ERROR the parameter type `U` may not live long enough [E0310] + //~| ERROR lifetime may not live long enough + //~| ERROR cannot return value referencing local data `*v` [E0515] + //~| ERROR the parameter type `U` may not live long enough [E0310] } diff --git a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr similarity index 88% rename from src/test/ui/regions/regions-close-object-into-object-4.nll.stderr rename to src/test/ui/regions/regions-close-object-into-object-4.stderr index 66d3102225e..7a9f1ab0001 100644 --- a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-4.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `U` may not live long enough - --> $DIR/regions-close-object-into-object-4.rs:13:5 + --> $DIR/regions-close-object-into-object-4.rs:9:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds @@ -10,7 +10,7 @@ LL | fn i<'a, T, U: 'static>(v: Box+'a>) -> Box { | +++++++++ error[E0310]: the parameter type `U` may not live long enough - --> $DIR/regions-close-object-into-object-4.rs:13:5 + --> $DIR/regions-close-object-into-object-4.rs:9:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds @@ -21,7 +21,7 @@ LL | fn i<'a, T, U: 'static>(v: Box+'a>) -> Box { | +++++++++ error[E0310]: the parameter type `U` may not live long enough - --> $DIR/regions-close-object-into-object-4.rs:13:5 + --> $DIR/regions-close-object-into-object-4.rs:9:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds @@ -32,7 +32,7 @@ LL | fn i<'a, T, U: 'static>(v: Box+'a>) -> Box { | +++++++++ error: lifetime may not live long enough - --> $DIR/regions-close-object-into-object-4.rs:13:5 + --> $DIR/regions-close-object-into-object-4.rs:9:5 | LL | fn i<'a, T, U>(v: Box+'a>) -> Box { | -- lifetime `'a` defined here @@ -49,7 +49,7 @@ LL | fn i<'a, T, U>(v: Box<(dyn A + 'static)>) -> Box { | ~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0515]: cannot return value referencing local data `*v` - --> $DIR/regions-close-object-into-object-4.rs:13:5 + --> $DIR/regions-close-object-into-object-4.rs:9:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^---^^^^^^^^^^^^^^^^ @@ -58,7 +58,7 @@ LL | Box::new(B(&*v)) as Box | returns a value referencing data owned by the current function error[E0310]: the parameter type `U` may not live long enough - --> $DIR/regions-close-object-into-object-4.rs:13:14 + --> $DIR/regions-close-object-into-object-4.rs:9:14 | LL | Box::new(B(&*v)) as Box | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds diff --git a/src/test/ui/regions/regions-close-object-into-object-5.base.stderr b/src/test/ui/regions/regions-close-object-into-object-5.base.stderr deleted file mode 100644 index 1a78079b638..00000000000 --- a/src/test/ui/regions/regions-close-object-into-object-5.base.stderr +++ /dev/null @@ -1,95 +0,0 @@ -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-object-into-object-5.rs:21:5 - | -LL | Box::new(B(&*v)) as Box - | ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds... - | -note: ...that is required by this bound - --> $DIR/regions-close-object-into-object-5.rs:13:17 - | -LL | struct B<'a, T: 'a>(&'a (A + 'a)); - | ^^ -help: consider adding an explicit lifetime bound... - | -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:21:5 - | -LL | Box::new(B(&*v)) as Box - | ^^^^^^^^^^^^^^^^ ...so that the type `B<'_, T>` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -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:21:14 - | -LL | Box::new(B(&*v)) as Box - | ^ ...so that the type `T` will meet its required lifetime bounds... - | -note: ...that is required by this bound - --> $DIR/regions-close-object-into-object-5.rs:13:17 - | -LL | struct B<'a, T: 'a>(&'a (A + 'a)); - | ^^ -help: consider adding an explicit lifetime bound... - | -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:21:14 - | -LL | Box::new(B(&*v)) as Box - | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds... - | -note: ...that is required by this bound - --> $DIR/regions-close-object-into-object-5.rs:13:17 - | -LL | struct B<'a, T: 'a>(&'a (A + 'a)); - | ^^ -help: consider adding an explicit lifetime bound... - | -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:21:16 - | -LL | Box::new(B(&*v)) as Box - | ^^^ ...so that the reference type `&dyn A` does not outlive the data it points at - | -help: consider adding an explicit lifetime bound... - | -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:21:16 - | -LL | Box::new(B(&*v)) as Box - | ^^^ ...so that the type `(dyn A + 'static)` is not borrowed for too long - | -help: consider adding an explicit lifetime bound... - | -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:21:16 - | -LL | Box::new(B(&*v)) as Box - | ^^^ ...so that the type `(dyn A + 'static)` is not borrowed for too long - | -help: consider adding an explicit lifetime bound... - | -LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { - | +++++++++ - -error: aborting due to 7 previous errors - -For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/regions/regions-close-object-into-object-5.rs b/src/test/ui/regions/regions-close-object-into-object-5.rs index 0e5fec28d19..d534c37496d 100644 --- a/src/test/ui/regions/regions-close-object-into-object-5.rs +++ b/src/test/ui/regions/regions-close-object-into-object-5.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(warnings)] @@ -23,10 +19,7 @@ fn f<'a, T, U>(v: Box + 'static>) -> Box { //~| ERROR the parameter type `T` may not live long enough //~| ERROR the parameter type `T` may not live long enough //~| ERROR the parameter type `T` may not live long enough - //[base]~| ERROR the parameter type `T` may not live long enough - //[base]~| ERROR the parameter type `T` may not live long enough - //[base]~| ERROR the parameter type `T` may not live long enough - //[nll]~| ERROR cannot return value referencing local data `*v` [E0515] + //~| ERROR cannot return value referencing local data `*v` [E0515] } fn main() {} diff --git a/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-5.stderr similarity index 87% rename from src/test/ui/regions/regions-close-object-into-object-5.nll.stderr rename to src/test/ui/regions/regions-close-object-into-object-5.stderr index cb06326130e..311e8868c09 100644 --- a/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr +++ b/src/test/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:21:5 + --> $DIR/regions-close-object-into-object-5.rs:17:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -10,7 +10,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:21:5 + --> $DIR/regions-close-object-into-object-5.rs:17:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -21,7 +21,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:21:5 + --> $DIR/regions-close-object-into-object-5.rs:17:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -32,7 +32,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:21:5 + --> $DIR/regions-close-object-into-object-5.rs:17:5 | LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^---^^^^^^^^^^^^^^^^ @@ -41,7 +41,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:21:14 + --> $DIR/regions-close-object-into-object-5.rs:17:14 | LL | Box::new(B(&*v)) as Box | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr deleted file mode 100644 index d8f77ad85c9..00000000000 --- a/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0310]: the parameter type `A` may not live long enough - --> $DIR/regions-close-over-type-parameter-1.rs:15:5 - | -LL | Box::new(v) as Box - | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn make_object1(v: A) -> Box { - | +++++++++ - -error[E0309]: the parameter type `A` may not live long enough - --> $DIR/regions-close-over-type-parameter-1.rs:24:5 - | -LL | Box::new(v) as Box - | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn make_object3<'a, 'b, A: SomeTrait + 'a + 'b>(v: A) -> Box { - | ++++ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0309, E0310. -For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.rs b/src/test/ui/regions/regions-close-over-type-parameter-1.rs index cf425bcd4f3..610f757453b 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-1.rs +++ b/src/test/ui/regions/regions-close-over-type-parameter-1.rs @@ -2,10 +2,6 @@ // an object. This should yield errors unless `A` (and the object) // both have suitable bounds. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait SomeTrait { fn get(&self) -> isize; } diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.stderr similarity index 89% rename from src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr rename to src/test/ui/regions/regions-close-over-type-parameter-1.stderr index d8f77ad85c9..b7b557d7a60 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr +++ b/src/test/ui/regions/regions-close-over-type-parameter-1.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `A` may not live long enough - --> $DIR/regions-close-over-type-parameter-1.rs:15:5 + --> $DIR/regions-close-over-type-parameter-1.rs:11:5 | LL | Box::new(v) as Box | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds @@ -10,7 +10,7 @@ LL | fn make_object1(v: A) -> Box $DIR/regions-close-over-type-parameter-1.rs:24:5 + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 | LL | Box::new(v) as Box | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr deleted file mode 100644 index 171203897d7..00000000000 --- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.base.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5 - | -LL | Box::new(v) as Box - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/regions-close-over-type-parameter-multiple.rs:21:20 - | -LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box { - | ^^ -note: ...so that the declared lifetime parameter bounds are satisfied - --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5 - | -LL | Box::new(v) as Box - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: but, the lifetime must be valid for the lifetime `'c` as defined here... - --> $DIR/regions-close-over-type-parameter-multiple.rs:21:26 - | -LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box { - | ^^ -note: ...so that the types are compatible - --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5 - | -LL | Box::new(v) as Box - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: expected `Box<(dyn SomeTrait + 'c)>` - found `Box` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs b/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs index 3d5f4e12665..e032a94c32f 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs +++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.rs @@ -1,10 +1,6 @@ // Various tests where we over type parameters with multiple lifetime // bounds. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait SomeTrait { fn get(&self) -> isize; } @@ -21,8 +17,7 @@ fn make_object_good2<'a,'b,A:SomeTrait+'a+'b>(v: A) -> Box { fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box { // A outlives 'a AND 'b...but not 'c. Box::new(v) as Box - //[base]~^ ERROR cannot infer an appropriate lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr similarity index 90% rename from src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr rename to src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr index 66459957ed4..baa0506d04c 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr +++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-close-over-type-parameter-multiple.rs:23:5 + --> $DIR/regions-close-over-type-parameter-multiple.rs:19:5 | LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box { | -- -- lifetime `'c` defined here diff --git a/src/test/ui/regions/regions-close-param-into-object.base.stderr b/src/test/ui/regions/regions-close-param-into-object.base.stderr deleted file mode 100644 index 79a5d34dea8..00000000000 --- a/src/test/ui/regions/regions-close-param-into-object.base.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:10:5 - | -LL | Box::new(v) - | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | where T : X + 'static - | +++++++++ - -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:16:5 - | -LL | Box::new(v) - | ^^^^^^^^^^^ ...so that the type `Box` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn p2(v: Box) -> Box - | +++++++++ - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:22:5 - | -LL | Box::new(v) - | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | where T : X + 'a - | ++++ - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:28:5 - | -LL | Box::new(v) - | ^^^^^^^^^^^ ...so that the type `Box` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn p4<'a,T: 'a>(v: Box) -> Box - | ++++ - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0309, E0310. -For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/regions/regions-close-param-into-object.rs b/src/test/ui/regions/regions-close-param-into-object.rs index aab3ad202e6..2760e5eed95 100644 --- a/src/test/ui/regions/regions-close-param-into-object.rs +++ b/src/test/ui/regions/regions-close-param-into-object.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait X { fn foo(&self) {} } fn p1(v: T) -> Box diff --git a/src/test/ui/regions/regions-close-param-into-object.nll.stderr b/src/test/ui/regions/regions-close-param-into-object.stderr similarity index 87% rename from src/test/ui/regions/regions-close-param-into-object.nll.stderr rename to src/test/ui/regions/regions-close-param-into-object.stderr index 6ee12d5b82c..9162be5b93c 100644 --- a/src/test/ui/regions/regions-close-param-into-object.nll.stderr +++ b/src/test/ui/regions/regions-close-param-into-object.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:10:5 + --> $DIR/regions-close-param-into-object.rs:6:5 | LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -10,7 +10,7 @@ LL | where T : X + 'static | +++++++++ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:16:5 + --> $DIR/regions-close-param-into-object.rs:12:5 | LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -21,7 +21,7 @@ LL | fn p2(v: Box) -> Box | +++++++++ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:22:5 + --> $DIR/regions-close-param-into-object.rs:18:5 | LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -32,7 +32,7 @@ LL | where T : X + 'a | ++++ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-close-param-into-object.rs:28:5 + --> $DIR/regions-close-param-into-object.rs:24:5 | LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/regions/regions-creating-enums3.base.stderr b/src/test/ui/regions/regions-creating-enums3.base.stderr deleted file mode 100644 index 68a7b473695..00000000000 --- a/src/test/ui/regions/regions-creating-enums3.base.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-creating-enums3.rs:11:5 - | -LL | fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> { - | ----------- ------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | Ast::Add(x, y) - | ^^^^^^^^^^^^^^ ...but data from `y` is returned here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-creating-enums3.rs b/src/test/ui/regions/regions-creating-enums3.rs index dcea761d33f..39dbb3d8a7d 100644 --- a/src/test/ui/regions/regions-creating-enums3.rs +++ b/src/test/ui/regions/regions-creating-enums3.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - enum Ast<'a> { Num(usize), Add(&'a Ast<'a>, &'a Ast<'a>) @@ -9,8 +5,7 @@ enum Ast<'a> { fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> { Ast::Add(x, y) - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-creating-enums3.nll.stderr b/src/test/ui/regions/regions-creating-enums3.stderr similarity index 91% rename from src/test/ui/regions/regions-creating-enums3.nll.stderr rename to src/test/ui/regions/regions-creating-enums3.stderr index 8334dc77687..41d609b56d2 100644 --- a/src/test/ui/regions/regions-creating-enums3.nll.stderr +++ b/src/test/ui/regions/regions-creating-enums3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-creating-enums3.rs:11:5 + --> $DIR/regions-creating-enums3.rs:7:5 | LL | fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-creating-enums4.base.stderr b/src/test/ui/regions/regions-creating-enums4.base.stderr deleted file mode 100644 index 445a4291f27..00000000000 --- a/src/test/ui/regions/regions-creating-enums4.base.stderr +++ /dev/null @@ -1,34 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements - --> $DIR/regions-creating-enums4.rs:11:5 - | -LL | Ast::Add(x, y) - | ^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/regions-creating-enums4.rs:10:16 - | -LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { - | ^^ -note: ...so that the expression is assignable - --> $DIR/regions-creating-enums4.rs:11:14 - | -LL | Ast::Add(x, y) - | ^ - = note: expected `&Ast<'_>` - found `&Ast<'a>` -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/regions-creating-enums4.rs:10:19 - | -LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { - | ^^ -note: ...so that the types are compatible - --> $DIR/regions-creating-enums4.rs:11:5 - | -LL | Ast::Add(x, y) - | ^^^^^^^^^^^^^^ - = note: expected `Ast<'b>` - found `Ast<'_>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-creating-enums4.rs b/src/test/ui/regions/regions-creating-enums4.rs index 18bd592b1c3..c9eab08cbe9 100644 --- a/src/test/ui/regions/regions-creating-enums4.rs +++ b/src/test/ui/regions/regions-creating-enums4.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - enum Ast<'a> { Num(usize), Add(&'a Ast<'a>, &'a Ast<'a>) @@ -9,8 +5,7 @@ enum Ast<'a> { fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { Ast::Add(x, y) - //[base]~^ ERROR cannot infer - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-creating-enums4.nll.stderr b/src/test/ui/regions/regions-creating-enums4.stderr similarity index 92% rename from src/test/ui/regions/regions-creating-enums4.nll.stderr rename to src/test/ui/regions/regions-creating-enums4.stderr index e215c63d39d..91cf57e099d 100644 --- a/src/test/ui/regions/regions-creating-enums4.nll.stderr +++ b/src/test/ui/regions/regions-creating-enums4.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-creating-enums4.rs:11:5 + --> $DIR/regions-creating-enums4.rs:7:5 | LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-early-bound-error-method.base.stderr b/src/test/ui/regions/regions-early-bound-error-method.base.stderr deleted file mode 100644 index 9e1f2b0e5bd..00000000000 --- a/src/test/ui/regions/regions-early-bound-error-method.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/regions-early-bound-error-method.rs:24:9 - | -LL | g2.get() - | ^^^^^^^^ - | -note: ...the reference is valid for the lifetime `'a` as defined here... - --> $DIR/regions-early-bound-error-method.rs:22:6 - | -LL | impl<'a> Box<'a> { - | ^^ -note: ...but the borrowed content is only valid for the lifetime `'b` as defined here - --> $DIR/regions-early-bound-error-method.rs:23:11 - | -LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/regions/regions-early-bound-error-method.rs b/src/test/ui/regions/regions-early-bound-error-method.rs index 44ee19fa898..7edcc677d73 100644 --- a/src/test/ui/regions/regions-early-bound-error-method.rs +++ b/src/test/ui/regions/regions-early-bound-error-method.rs @@ -1,10 +1,6 @@ // Tests that you can use a fn lifetime parameter as part of // the value for a type parameter in a bound. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait GetRef<'a> { fn get(&self) -> &'a isize; } @@ -22,8 +18,7 @@ impl<'a> GetRef<'a> for Box<'a> { impl<'a> Box<'a> { fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize { g2.get() - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/regions/regions-early-bound-error-method.nll.stderr b/src/test/ui/regions/regions-early-bound-error-method.stderr similarity index 90% rename from src/test/ui/regions/regions-early-bound-error-method.nll.stderr rename to src/test/ui/regions/regions-early-bound-error-method.stderr index 98389ed0ca5..7f10c051f29 100644 --- a/src/test/ui/regions/regions-early-bound-error-method.nll.stderr +++ b/src/test/ui/regions/regions-early-bound-error-method.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-early-bound-error-method.rs:24:9 + --> $DIR/regions-early-bound-error-method.rs:20:9 | LL | impl<'a> Box<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/regions/regions-early-bound-error.base.stderr b/src/test/ui/regions/regions-early-bound-error.base.stderr deleted file mode 100644 index e1b60536d29..00000000000 --- a/src/test/ui/regions/regions-early-bound-error.base.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/regions-early-bound-error.rs:23:5 - | -LL | g1.get() - | ^^^^^^^^ - | -note: ...the reference is valid for the lifetime `'b` as defined here... - --> $DIR/regions-early-bound-error.rs:22:11 - | -LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { - | ^^ -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/regions-early-bound-error.rs:22:8 - | -LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/regions/regions-early-bound-error.rs b/src/test/ui/regions/regions-early-bound-error.rs index 372596cd5f4..98a69c24f43 100644 --- a/src/test/ui/regions/regions-early-bound-error.rs +++ b/src/test/ui/regions/regions-early-bound-error.rs @@ -1,10 +1,6 @@ // Tests that you can use a fn lifetime parameter as part of // the value for a type parameter in a bound. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait GetRef<'a, T> { fn get(&self) -> &'a T; } @@ -21,8 +17,7 @@ impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> { fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { g1.get() - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-early-bound-error.nll.stderr b/src/test/ui/regions/regions-early-bound-error.stderr similarity index 91% rename from src/test/ui/regions/regions-early-bound-error.nll.stderr rename to src/test/ui/regions/regions-early-bound-error.stderr index f57249e4e8f..eb4cd5ca72e 100644 --- a/src/test/ui/regions/regions-early-bound-error.nll.stderr +++ b/src/test/ui/regions/regions-early-bound-error.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-early-bound-error.rs:23:5 + --> $DIR/regions-early-bound-error.rs:19:5 | LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr deleted file mode 100644 index 4616035870a..00000000000 --- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-fn-subtyping-return-static-fail.rs:52:12 - | -LL | want_G(baz); - | ------ ^^^ one type is more general than the other - | | - | arguments to this function are incorrect - | - = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S` - found fn item `for<'r> fn(&'r S) -> &'r S {baz}` -note: function defined here - --> $DIR/regions-fn-subtyping-return-static-fail.rs:24:4 - | -LL | fn want_G(f: G) {} - | ^^^^^^ ---- - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs index 05c6ac0cb1a..539221b5a04 100644 --- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs +++ b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.rs @@ -6,10 +6,6 @@ // This can safely be considered to be an instance of `F` because all // lifetimes are sublifetimes of 'static. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(dead_code)] #![allow(unused_variables)] diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.base.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr similarity index 80% rename from src/test/ui/regions/regions-fn-subtyping-return-static-fail.base.stderr rename to src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr index 4616035870a..d87d0d2f6f9 100644 --- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.base.stderr +++ b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/regions-fn-subtyping-return-static-fail.rs:52:12 + --> $DIR/regions-fn-subtyping-return-static-fail.rs:48:12 | LL | want_G(baz); | ------ ^^^ one type is more general than the other @@ -9,7 +9,7 @@ LL | want_G(baz); = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S` found fn item `for<'r> fn(&'r S) -> &'r S {baz}` note: function defined here - --> $DIR/regions-fn-subtyping-return-static-fail.rs:24:4 + --> $DIR/regions-fn-subtyping-return-static-fail.rs:20:4 | LL | fn want_G(f: G) {} | ^^^^^^ ---- diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.base.stderr b/src/test/ui/regions/regions-free-region-ordering-callee.base.stderr deleted file mode 100644 index ae6d95dd469..00000000000 --- a/src/test/ui/regions/regions-free-region-ordering-callee.base.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-free-region-ordering-callee.rs:17:5 - | -LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { - | ------------- --------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | // However, it is not safe to assume that 'b <= 'a -LL | &*y - | ^^^ ...but data from `x` is returned here - -error[E0623]: lifetime mismatch - --> $DIR/regions-free-region-ordering-callee.rs:24:24 - | -LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize { - | --------- ------------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | // Do not infer an ordering from the return value. -LL | let z: &'b usize = &*x; - | ^^^ ...but data from `x` is returned here - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.rs b/src/test/ui/regions/regions-free-region-ordering-callee.rs index eca863f2e79..8158e81e1dd 100644 --- a/src/test/ui/regions/regions-free-region-ordering-callee.rs +++ b/src/test/ui/regions/regions-free-region-ordering-callee.rs @@ -2,10 +2,6 @@ // that appear in their parameter list. See also // regions-free-region-ordering-caller.rs -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn ordering1<'a, 'b>(x: &'a &'b usize) -> &'a usize { // It is safe to assume that 'a <= 'b due to the type of x let y: &'b usize = &**x; @@ -15,15 +11,13 @@ fn ordering1<'a, 'b>(x: &'a &'b usize) -> &'a usize { fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { // However, it is not safe to assume that 'b <= 'a &*y - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize { // Do not infer an ordering from the return value. let z: &'b usize = &*x; - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough panic!(); } diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-callee.stderr similarity index 89% rename from src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr rename to src/test/ui/regions/regions-free-region-ordering-callee.stderr index 7dfff2bb060..a1b46a692f9 100644 --- a/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-callee.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-free-region-ordering-callee.rs:17:5 + --> $DIR/regions-free-region-ordering-callee.rs:13:5 | LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | &*y = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/regions-free-region-ordering-callee.rs:24:12 + --> $DIR/regions-free-region-ordering-callee.rs:19:12 | LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr deleted file mode 100644 index a27a010d7f3..00000000000 --- a/src/test/ui/regions/regions-free-region-ordering-caller.migrate.stderr +++ /dev/null @@ -1,54 +0,0 @@ -error[E0491]: in type `&'b &'a usize`, reference has a longer lifetime than the data it references - --> $DIR/regions-free-region-ordering-caller.rs:16:12 - | -LL | let z: Option<&'b &'a usize> = None; - | ^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'b` as defined here - --> $DIR/regions-free-region-ordering-caller.rs:15:14 - | -LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { - | ^^ -note: but the referenced data is only valid for the lifetime `'a` as defined here - --> $DIR/regions-free-region-ordering-caller.rs:15:10 - | -LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { - | ^^ - -error[E0491]: in type `&'b Paramd<'a>`, reference has a longer lifetime than the data it references - --> $DIR/regions-free-region-ordering-caller.rs:22:12 - | -LL | let z: Option<&'b Paramd<'a>> = None; - | ^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'b` as defined here - --> $DIR/regions-free-region-ordering-caller.rs:20:14 - | -LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { - | ^^ -note: but the referenced data is only valid for the lifetime `'a` as defined here - --> $DIR/regions-free-region-ordering-caller.rs:20:10 - | -LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { - | ^^ - -error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references - --> $DIR/regions-free-region-ordering-caller.rs:27:12 - | -LL | let z: Option<&'a &'b usize> = None; - | ^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-free-region-ordering-caller.rs:26:10 - | -LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-free-region-ordering-caller.rs:26:14 - | -LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { - | ^^ - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.rs b/src/test/ui/regions/regions-free-region-ordering-caller.rs index 11997a5fb56..2e83c3258be 100644 --- a/src/test/ui/regions/regions-free-region-ordering-caller.rs +++ b/src/test/ui/regions/regions-free-region-ordering-caller.rs @@ -2,30 +2,22 @@ // than the thing it points at and ensure that they result in // errors. See also regions-free-region-ordering-callee.rs -// revisions: migrate nll -//[nll]compile-flags: -Z borrowck=mir - -// Since we are testing nll (and migration) explicitly as a separate -// revisions, don't worry about the --compare-mode=nll on this test. - -// ignore-compare-mode-nll - struct Paramd<'a> { x: &'a usize } fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { - let z: Option<&'b &'a usize> = None;//[migrate]~ ERROR E0491 - //[nll]~^ ERROR lifetime may not live long enough + let z: Option<&'b &'a usize> = None; + //~^ ERROR lifetime may not live long enough } fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { let y: Paramd<'a> = Paramd { x: a }; - let z: Option<&'b Paramd<'a>> = None;//[migrate]~ ERROR E0491 - //[nll]~^ ERROR lifetime may not live long enough + let z: Option<&'b Paramd<'a>> = None; + //~^ ERROR lifetime may not live long enough } fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { - let z: Option<&'a &'b usize> = None;//[migrate]~ ERROR E0491 - //[nll]~^ ERROR lifetime may not live long enough + let z: Option<&'a &'b usize> = None; + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.stderr similarity index 88% rename from src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr rename to src/test/ui/regions/regions-free-region-ordering-caller.stderr index 546eb93d8ec..c79ed50c6a4 100644 --- a/src/test/ui/regions/regions-free-region-ordering-caller.nll.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-caller.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-free-region-ordering-caller.rs:16:12 + --> $DIR/regions-free-region-ordering-caller.rs:8:12 | LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { | -- -- lifetime `'b` defined here @@ -11,7 +11,7 @@ LL | let z: Option<&'b &'a usize> = None; = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/regions-free-region-ordering-caller.rs:22:12 + --> $DIR/regions-free-region-ordering-caller.rs:14:12 | LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { | -- -- lifetime `'b` defined here @@ -24,7 +24,7 @@ LL | let z: Option<&'b Paramd<'a>> = None; = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/regions-free-region-ordering-caller.rs:27:12 + --> $DIR/regions-free-region-ordering-caller.rs:19:12 | LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr b/src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr deleted file mode 100644 index eb4ffce89a3..00000000000 --- a/src/test/ui/regions/regions-free-region-ordering-incorrect.base.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements - --> $DIR/regions-free-region-ordering-incorrect.rs:21:21 - | -LL | None => &self.val - | ^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/regions-free-region-ordering-incorrect.rs:18:12 - | -LL | fn get<'a>(&'a self) -> &'b T { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/regions-free-region-ordering-incorrect.rs:21:21 - | -LL | None => &self.val - | ^^^^^^^^^ -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/regions-free-region-ordering-incorrect.rs:17:6 - | -LL | impl<'b, T> Node<'b, T> { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/regions-free-region-ordering-incorrect.rs:19:9 - | -LL | / match self.next { -LL | | Some(ref next) => next.get(), -LL | | None => &self.val -LL | | } - | |_________^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.rs b/src/test/ui/regions/regions-free-region-ordering-incorrect.rs index 43427d13ffa..1aee6e87644 100644 --- a/src/test/ui/regions/regions-free-region-ordering-incorrect.rs +++ b/src/test/ui/regions/regions-free-region-ordering-incorrect.rs @@ -5,10 +5,6 @@ // // This test began its life as a test for issue #4325. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Node<'b, T: 'b> { val: T, next: Option<&'b Node<'b, T>> @@ -16,9 +12,9 @@ struct Node<'b, T: 'b> { impl<'b, T> Node<'b, T> { fn get<'a>(&'a self) -> &'b T { - match self.next { //[nll]~ ERROR lifetime may not live long enough + match self.next { //~ ERROR lifetime may not live long enough Some(ref next) => next.get(), - None => &self.val //[base]~ ERROR cannot infer + None => &self.val } } } diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-incorrect.stderr similarity index 90% rename from src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr rename to src/test/ui/regions/regions-free-region-ordering-incorrect.stderr index 336cfd3e6c5..f7c75033c04 100644 --- a/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-incorrect.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-free-region-ordering-incorrect.rs:19:9 + --> $DIR/regions-free-region-ordering-incorrect.rs:15:9 | LL | impl<'b, T> Node<'b, T> { | -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr deleted file mode 100644 index 85ced4b5241..00000000000 --- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-implied-bounds-projection-gap-1.rs:20:10 - | -LL | wf::<&'x T>(); - | ^^^^^ ...so that the reference type `&'x T` does not outlive the data it points at - | -help: consider adding an explicit lifetime bound... - | -LL | fn func<'x, T:Trait1<'x> + 'x>(t: &'x T::Foo) - | ++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs index f11fc207b91..38fc9c462da 100644 --- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs @@ -3,10 +3,6 @@ // there might be other ways for the caller of `func` to show that // `T::Foo: 'x` holds (e.g., where-clause). -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Trait1<'x> { type Foo; } diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr similarity index 87% rename from src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr rename to src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr index 1a428eb25d7..7c9f405563c 100644 --- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr @@ -1,5 +1,5 @@ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-implied-bounds-projection-gap-1.rs:20:5 + --> $DIR/regions-implied-bounds-projection-gap-1.rs:16:5 | LL | wf::<&'x T>(); | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr b/src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr deleted file mode 100644 index faa638aa281..00000000000 --- a/src/test/ui/regions/regions-infer-bound-from-trait-self.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0309]: the parameter type `Self` may not live long enough - --> $DIR/regions-infer-bound-from-trait-self.rs:50:9 - | -LL | check_bound(x, self) - | ^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `Self: 'a`... - = note: ...so that the type `Self` will meet its required lifetime bounds... -note: ...that is required by this bound - --> $DIR/regions-infer-bound-from-trait-self.rs:16:21 - | -LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { } - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.rs b/src/test/ui/regions/regions-infer-bound-from-trait-self.rs index ef8be05b2d2..d15bfffe9d9 100644 --- a/src/test/ui/regions/regions-infer-bound-from-trait-self.rs +++ b/src/test/ui/regions/regions-infer-bound-from-trait-self.rs @@ -1,10 +1,6 @@ // Test that we can derive lifetime bounds on `Self` from trait // inheritance. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Static : 'static { } trait Is<'a> : 'a { } diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr b/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr similarity index 87% rename from src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr rename to src/test/ui/regions/regions-infer-bound-from-trait-self.stderr index 9c886c42c72..e88f79a3a8c 100644 --- a/src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr +++ b/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr @@ -1,5 +1,5 @@ error[E0309]: the parameter type `Self` may not live long enough - --> $DIR/regions-infer-bound-from-trait-self.rs:50:9 + --> $DIR/regions-infer-bound-from-trait-self.rs:46:9 | LL | check_bound(x, self) | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr deleted file mode 100644 index 658740f3f87..00000000000 --- a/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0309]: the parameter type `A` may not live long enough - --> $DIR/regions-infer-bound-from-trait.rs:37:5 - | -LL | check_bound(x, a) - | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds... - | -note: ...that is required by this bound - --> $DIR/regions-infer-bound-from-trait.rs:16:21 - | -LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { } - | ^^ -help: consider adding an explicit lifetime bound... - | -LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) { - | ++++ - -error[E0309]: the parameter type `A` may not live long enough - --> $DIR/regions-infer-bound-from-trait.rs:41:5 - | -LL | check_bound(x, a) - | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds... - | -note: ...that is required by this bound - --> $DIR/regions-infer-bound-from-trait.rs:16:21 - | -LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { } - | ^^ -help: consider adding an explicit lifetime bound... - | -LL | fn bar2<'a,'b,A:Is<'b> + 'a>(x: Inv<'a>, y: Inv<'b>, a: A) { - | ++++ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.rs b/src/test/ui/regions/regions-infer-bound-from-trait.rs index 96f9125313b..610452182f8 100644 --- a/src/test/ui/regions/regions-infer-bound-from-trait.rs +++ b/src/test/ui/regions/regions-infer-bound-from-trait.rs @@ -1,10 +1,6 @@ // Test that we can derive lifetime bounds on type parameters // from trait inheritance. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Static : 'static { } trait Is<'a> : 'a { } diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.stderr similarity index 94% rename from src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr rename to src/test/ui/regions/regions-infer-bound-from-trait.stderr index 5cc2d20c2e0..3ee71543d15 100644 --- a/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr +++ b/src/test/ui/regions/regions-infer-bound-from-trait.stderr @@ -1,5 +1,5 @@ error[E0309]: the parameter type `A` may not live long enough - --> $DIR/regions-infer-bound-from-trait.rs:37:5 + --> $DIR/regions-infer-bound-from-trait.rs:33:5 | LL | check_bound(x, a) | ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds @@ -10,7 +10,7 @@ LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) { | ++++ error[E0309]: the parameter type `A` may not live long enough - --> $DIR/regions-infer-bound-from-trait.rs:41:5 + --> $DIR/regions-infer-bound-from-trait.rs:37:5 | LL | check_bound(x, a) | ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr deleted file mode 100644 index fbe2c0da6e2..00000000000 --- a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-infer-contravariance-due-to-decl.rs:29:35 - | -LL | fn use_<'short,'long>(c: Contravariant<'short>, - | --------------------- these two types are declared with different lifetimes... -LL | s: &'short isize, -LL | l: &'long isize, - | ------------ -... -LL | let _: Contravariant<'long> = c; - | ^ ...but data from `c` flows into `l` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs index 233f72fd296..fbc0cec562f 100644 --- a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs +++ b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs @@ -4,10 +4,6 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::marker; // This is contravariant with respect to 'a, meaning that @@ -27,8 +23,7 @@ fn use_<'short,'long>(c: Contravariant<'short>, // covariant with respect to its parameter 'a. let _: Contravariant<'long> = c; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr similarity index 88% rename from src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr rename to src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr index 0b1bf5271a7..94b80852d01 100644 --- a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr +++ b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-infer-contravariance-due-to-decl.rs:29:12 + --> $DIR/regions-infer-contravariance-due-to-decl.rs:25:12 | LL | fn use_<'short,'long>(c: Contravariant<'short>, | ------ ----- lifetime `'long` defined here diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr b/src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr deleted file mode 100644 index bb22e15af69..00000000000 --- a/src/test/ui/regions/regions-infer-covariance-due-to-decl.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-infer-covariance-due-to-decl.rs:26:32 - | -LL | fn use_<'short,'long>(c: Covariant<'long>, - | ---------------- -LL | s: &'short isize, - | ------------- these two types are declared with different lifetimes... -... -LL | let _: Covariant<'short> = c; - | ^ ...but data from `s` flows into `c` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs b/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs index c4225e76967..03c0e436e31 100644 --- a/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs +++ b/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs @@ -4,10 +4,6 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::marker; struct Covariant<'a> { @@ -24,8 +20,7 @@ fn use_<'short,'long>(c: Covariant<'long>, // contravariant with respect to its parameter 'a. let _: Covariant<'short> = c; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr similarity index 88% rename from src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr rename to src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr index 4d72b8471dc..f44a0fad59b 100644 --- a/src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr +++ b/src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-infer-covariance-due-to-decl.rs:26:12 + --> $DIR/regions-infer-covariance-due-to-decl.rs:22:12 | LL | fn use_<'short,'long>(c: Covariant<'long>, | ------ ----- lifetime `'long` defined here diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr deleted file mode 100644 index dc7d0005ca2..00000000000 --- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-infer-invariance-due-to-decl.rs:16:5 - | -LL | b_isize - | ^^^^^^^ lifetime mismatch - | - = note: expected struct `Invariant<'static>` - found struct `Invariant<'r>` -note: the lifetime `'r` as defined here... - --> $DIR/regions-infer-invariance-due-to-decl.rs:15:23 - | -LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs b/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs index 6433773b2d1..102abc0e0d8 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs +++ b/src/test/ui/regions/regions-infer-invariance-due-to-decl.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::marker; struct Invariant<'a> { @@ -14,8 +10,7 @@ fn to_same_lifetime<'r>(b_isize: Invariant<'r>) { fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { b_isize - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr similarity index 91% rename from src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr rename to src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr index d7b7f9883a7..c8c7808e06c 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-infer-invariance-due-to-decl.rs:16:5 + --> $DIR/regions-infer-invariance-due-to-decl.rs:12:5 | LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { | -- lifetime `'r` defined here diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr deleted file mode 100644 index b2530d7b6cd..00000000000 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:14:5 - | -LL | b_isize - | ^^^^^^^ lifetime mismatch - | - = note: expected struct `Invariant<'static>` - found struct `Invariant<'r>` -note: the lifetime `'r` as defined here... - --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:13:23 - | -LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs index 4690f9d8b08..c1fb41bd917 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Invariant<'a> { f: Box, } @@ -12,8 +8,7 @@ fn to_same_lifetime<'r>(b_isize: Invariant<'r>) { fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { b_isize - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr similarity index 90% rename from src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr rename to src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr index 37fa5e3bf44..1165011c1f4 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:14:5 + --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:10:5 | LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { | -- lifetime `'r` defined here diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr deleted file mode 100644 index 12774ca92e2..00000000000 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:14:5 - | -LL | b_isize - | ^^^^^^^ lifetime mismatch - | - = note: expected struct `Invariant<'static>` - found struct `Invariant<'r>` -note: the lifetime `'r` as defined here... - --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:13:23 - | -LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs index 8e257c4fd0e..1078f77a04e 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Invariant<'a> { f: Box *mut &'a isize + 'static>, } @@ -12,8 +8,7 @@ fn to_same_lifetime<'r>(b_isize: Invariant<'r>) { fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { b_isize - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr similarity index 90% rename from src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr rename to src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr index 1b3ef7bc028..f3973a93bad 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:14:5 + --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:10:5 | LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { | -- lifetime `'r` defined here diff --git a/src/test/ui/regions/regions-infer-not-param.base.stderr b/src/test/ui/regions/regions-infer-not-param.base.stderr deleted file mode 100644 index f43274163d0..00000000000 --- a/src/test/ui/regions/regions-infer-not-param.base.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-infer-not-param.rs:19:54 - | -LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } - | ^ lifetime mismatch - | - = note: expected struct `Direct<'b>` - found struct `Direct<'a>` -note: the lifetime `'a` as defined here... - --> $DIR/regions-infer-not-param.rs:19:16 - | -LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } - | ^^ -note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/regions-infer-not-param.rs:19:19 - | -LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } - | ^^ - -error[E0308]: mismatched types - --> $DIR/regions-infer-not-param.rs:25:63 - | -LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } - | ^ lifetime mismatch - | - = note: expected struct `Indirect2<'b>` - found struct `Indirect2<'a>` -note: the lifetime `'a` as defined here... - --> $DIR/regions-infer-not-param.rs:25:19 - | -LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } - | ^^ -note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/regions-infer-not-param.rs:25:22 - | -LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } - | ^^ - -error[E0308]: mismatched types - --> $DIR/regions-infer-not-param.rs:25:63 - | -LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } - | ^ lifetime mismatch - | - = note: expected struct `Indirect2<'b>` - found struct `Indirect2<'a>` -note: the lifetime `'b` as defined here... - --> $DIR/regions-infer-not-param.rs:25:22 - | -LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } - | ^^ -note: ...does not necessarily outlive the lifetime `'a` as defined here - --> $DIR/regions-infer-not-param.rs:25:19 - | -LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } - | ^^ - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-infer-not-param.rs b/src/test/ui/regions/regions-infer-not-param.rs index 0b8af5bc152..c3766bce18a 100644 --- a/src/test/ui/regions/regions-infer-not-param.rs +++ b/src/test/ui/regions/regions-infer-not-param.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Direct<'a> { f: &'a isize } @@ -17,19 +13,12 @@ struct Indirect2<'a> { } fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } -//[base]~^ ERROR mismatched types -//[nll]~^^ ERROR lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn take_indirect1(p: Indirect1) -> Indirect1 { p } fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } -//[base]~^ ERROR mismatched types -//[base]~| expected struct `Indirect2<'b>` -//[base]~| found struct `Indirect2<'a>` -//[base]~| ERROR mismatched types -//[base]~| expected struct `Indirect2<'b>` -//[base]~| found struct `Indirect2<'a>` -//[nll]~^^^^^^^ ERROR lifetime may not live long enough -//[nll]~| ERROR lifetime may not live long enough +//~^ ERROR lifetime may not live long enough +//~| ERROR lifetime may not live long enough fn main() {} diff --git a/src/test/ui/regions/regions-infer-not-param.nll.stderr b/src/test/ui/regions/regions-infer-not-param.stderr similarity index 93% rename from src/test/ui/regions/regions-infer-not-param.nll.stderr rename to src/test/ui/regions/regions-infer-not-param.stderr index 95e6b03c350..d12f07a7728 100644 --- a/src/test/ui/regions/regions-infer-not-param.nll.stderr +++ b/src/test/ui/regions/regions-infer-not-param.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-infer-not-param.rs:19:54 + --> $DIR/regions-infer-not-param.rs:15:54 | LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` @@ -9,7 +9,7 @@ LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/regions-infer-not-param.rs:25:63 + --> $DIR/regions-infer-not-param.rs:20:63 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` @@ -22,7 +22,7 @@ LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/regions-infer-not-param.rs:25:63 + --> $DIR/regions-infer-not-param.rs:20:63 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.base.stderr b/src/test/ui/regions/regions-infer-paramd-indirect.base.stderr deleted file mode 100644 index 1d4471f910d..00000000000 --- a/src/test/ui/regions/regions-infer-paramd-indirect.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-infer-paramd-indirect.rs:26:18 - | -LL | self.f = b; - | ^ lifetime mismatch - | - = note: expected struct `Box>` - found struct `Box>` -note: the anonymous lifetime defined here... - --> $DIR/regions-infer-paramd-indirect.rs:25:36 - | -LL | fn set_f_bad(&mut self, b: Box) { - | ^ -note: ...does not necessarily outlive the lifetime `'a` as defined here - --> $DIR/regions-infer-paramd-indirect.rs:20:6 - | -LL | impl<'a> SetF<'a> for C<'a> { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.rs b/src/test/ui/regions/regions-infer-paramd-indirect.rs index 060306f611e..978c84e5374 100644 --- a/src/test/ui/regions/regions-infer-paramd-indirect.rs +++ b/src/test/ui/regions/regions-infer-paramd-indirect.rs @@ -1,10 +1,6 @@ // Check that we correctly infer that b and c must be region // parameterized because they reference a which requires a region. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - type A<'a> = &'a isize; type B<'a> = Box>; @@ -24,11 +20,7 @@ impl<'a> SetF<'a> for C<'a> { fn set_f_bad(&mut self, b: Box) { self.f = b; - //[base]~^ ERROR mismatched types - //[base]~| expected struct `Box>` - //[base]~| found struct `Box>` - //[base]~| lifetime mismatch - //[nll]~^^^^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.nll.stderr b/src/test/ui/regions/regions-infer-paramd-indirect.stderr similarity index 88% rename from src/test/ui/regions/regions-infer-paramd-indirect.nll.stderr rename to src/test/ui/regions/regions-infer-paramd-indirect.stderr index 96377cbdab4..afabdc1de1c 100644 --- a/src/test/ui/regions/regions-infer-paramd-indirect.nll.stderr +++ b/src/test/ui/regions/regions-infer-paramd-indirect.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-infer-paramd-indirect.rs:26:9 + --> $DIR/regions-infer-paramd-indirect.rs:22:9 | LL | impl<'a> SetF<'a> for C<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr deleted file mode 100644 index 613e9af90a4..00000000000 --- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.base.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-lifetime-bounds-on-fns.rs:12:10 - | -LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { - | --------- --------- these two types are declared with different lifetimes... -LL | // Illegal now because there is no `'b:'a` declaration. -LL | *x = *y; - | ^^ ...but data from `y` flows into `x` here - -error[E0623]: lifetime mismatch - --> $DIR/regions-lifetime-bounds-on-fns.rs:19:7 - | -LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { - | --------- --------- these two types are declared with different lifetimes... -... -LL | a(x, y); - | ^ ...but data from `y` flows into `x` here - -error[E0308]: mismatched types - --> $DIR/regions-lifetime-bounds-on-fns.rs:26:43 - | -LL | let _: fn(&mut &isize, &mut &isize) = a; - | ^ one type is more general than the other - | - = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` - found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0308, E0623. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs b/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs index ef5e5cb12ef..177f52fa72d 100644 --- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs +++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn a<'a, 'b:'a>(x: &mut &'a isize, y: &mut &'b isize) { // Note: this is legal because of the `'b:'a` declaration. *x = *y; @@ -10,14 +6,12 @@ fn a<'a, 'b:'a>(x: &mut &'a isize, y: &mut &'b isize) { fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { // Illegal now because there is no `'b:'a` declaration. *x = *y; - //[base]~^ ERROR lifetime mismatch [E0623] } fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { // Here we try to call `foo` but do not know that `'a` and `'b` are // related as required. a(x, y); - //[base]~^ ERROR lifetime mismatch [E0623] } fn d() { diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr similarity index 90% rename from src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr rename to src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr index 268a60968b7..a0daf58c6b5 100644 --- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr +++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/regions-lifetime-bounds-on-fns.rs:26:43 + --> $DIR/regions-lifetime-bounds-on-fns.rs:20:43 | LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ one type is more general than the other diff --git a/src/test/ui/regions/regions-nested-fns.base.stderr b/src/test/ui/regions/regions-nested-fns.base.stderr deleted file mode 100644 index 37ce569e761..00000000000 --- a/src/test/ui/regions/regions-nested-fns.base.stderr +++ /dev/null @@ -1,78 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/regions-nested-fns.rs:9:18 - | -LL | let mut ay = &y; - | ^^ - | -note: first, the lifetime cannot outlive the anonymous lifetime #1 defined here... - --> $DIR/regions-nested-fns.rs:13:58 - | -LL | ignore:: FnMut(&'z isize)>>(Box::new(|z| { - | __________________________________________________________^ -LL | | ay = x; -LL | | ay = &y; -LL | | -LL | | ay = z; -LL | | -LL | | })); - | |_____^ -note: ...so that reference does not outlive borrowed content - --> $DIR/regions-nested-fns.rs:17:14 - | -LL | ay = z; - | ^ -note: but, the lifetime must be valid for the anonymous lifetime #1 defined here... - --> $DIR/regions-nested-fns.rs:21:72 - | -LL | ignore::< Box FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { - | ________________________________________________________________________^ -LL | | if false { return x; } -LL | | -LL | | -LL | | if false { return ay; } -LL | | return z; -LL | | })); - | |_____^ -note: ...so that the types are compatible - --> $DIR/regions-nested-fns.rs:21:76 - | -LL | ignore::< Box FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { - | ____________________________________________________________________________^ -LL | | if false { return x; } -LL | | -LL | | -LL | | if false { return ay; } -LL | | return z; -LL | | })); - | |_____^ - = note: expected `&isize` - found `&isize` - -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/regions-nested-fns.rs:22:27 - | -LL | if false { return x; } - | ^ - | -note: ...the reference is valid for the anonymous lifetime #1 defined here... - --> $DIR/regions-nested-fns.rs:21:72 - | -LL | ignore::< Box FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { - | ________________________________________________________________________^ -LL | | if false { return x; } -LL | | -LL | | -LL | | if false { return ay; } -LL | | return z; -LL | | })); - | |_____^ -note: ...but the borrowed content is only valid for the lifetime `'x` as defined here - --> $DIR/regions-nested-fns.rs:7:11 - | -LL | fn nested<'x>(x: &'x isize) { - | ^^ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0312, E0495. -For more information about an error, try `rustc --explain E0312`. diff --git a/src/test/ui/regions/regions-nested-fns.rs b/src/test/ui/regions/regions-nested-fns.rs index 8cc39792bd9..d9698ced3de 100644 --- a/src/test/ui/regions/regions-nested-fns.rs +++ b/src/test/ui/regions/regions-nested-fns.rs @@ -1,27 +1,21 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn ignore(t: T) {} fn nested<'x>(x: &'x isize) { let y = 3; let mut ay = &y; - //[base]~^ ERROR E0495 - //[nll]~^^ ERROR `y` does not live long enough [E0597] + //~^ ERROR `y` does not live long enough [E0597] ignore:: FnMut(&'z isize)>>(Box::new(|z| { ay = x; ay = &y; - //[nll]~^ ERROR `y` does not live long enough + //~^ ERROR `y` does not live long enough ay = z; - //[nll]~^ ERROR borrowed data escapes outside of closure [E0521] + //~^ ERROR borrowed data escapes outside of closure [E0521] })); ignore::< Box FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { if false { return x; } - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough if false { return ay; } return z; })); diff --git a/src/test/ui/regions/regions-nested-fns.nll.stderr b/src/test/ui/regions/regions-nested-fns.stderr similarity index 91% rename from src/test/ui/regions/regions-nested-fns.nll.stderr rename to src/test/ui/regions/regions-nested-fns.stderr index 6f2a89994b0..bb2740310f6 100644 --- a/src/test/ui/regions/regions-nested-fns.nll.stderr +++ b/src/test/ui/regions/regions-nested-fns.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of closure - --> $DIR/regions-nested-fns.rs:17:9 + --> $DIR/regions-nested-fns.rs:12:9 | LL | let mut ay = &y; | ------ `ay` declared here, outside of the closure body @@ -11,7 +11,7 @@ LL | ay = z; | ^^^^^^ `z` escapes the closure body here error[E0597]: `y` does not live long enough - --> $DIR/regions-nested-fns.rs:9:18 + --> $DIR/regions-nested-fns.rs:5:18 | LL | let mut ay = &y; | ^^ borrowed value does not live long enough @@ -23,7 +23,7 @@ LL | } | - `y` dropped here while still borrowed error[E0597]: `y` does not live long enough - --> $DIR/regions-nested-fns.rs:15:15 + --> $DIR/regions-nested-fns.rs:10:15 | LL | ignore:: FnMut(&'z isize)>>(Box::new(|z| { | --- value captured here @@ -38,7 +38,7 @@ LL | } | - `y` dropped here while still borrowed error: lifetime may not live long enough - --> $DIR/regions-nested-fns.rs:22:27 + --> $DIR/regions-nested-fns.rs:17:27 | LL | fn nested<'x>(x: &'x isize) { | -- lifetime `'x` defined here diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr deleted file mode 100644 index f2308bb7c78..00000000000 --- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0491]: in type `&'a WithHrAssoc>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-projection-container-hrtb.rs:35:12 - | -LL | let _: &'a WithHrAssoc> = loop { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-projection-container-hrtb.rs:32:15 - | -LL | fn with_assoc<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-projection-container-hrtb.rs:32:18 - | -LL | fn with_assoc<'a,'b>() { - | ^^ - -error[E0491]: in type `&'a WithHrAssocSub>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-projection-container-hrtb.rs:55:12 - | -LL | let _: &'a WithHrAssocSub> = loop { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-projection-container-hrtb.rs:51:19 - | -LL | fn with_assoc_sub<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-projection-container-hrtb.rs:51:22 - | -LL | fn with_assoc_sub<'a,'b>() { - | ^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs b/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs index 695a81dca27..152eed5ac1d 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs +++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs @@ -1,14 +1,6 @@ // Test that structs with higher-ranked where clauses don't generate // "outlives" requirements. Issue #22246. -// revisions: migrate nll -//[nll]compile-flags: -Z borrowck=mir - -// Since we are testing nll (and migration) explicitly as a separate -// revisions, don't worry about the --compare-mode=nll on this test. - -// ignore-compare-mode-nll - #![allow(dead_code)] pub trait TheTrait<'b> { @@ -33,8 +25,7 @@ fn with_assoc<'a,'b>() { // We get an error because 'b:'a does not hold: let _: &'a WithHrAssoc> = loop { }; - //[migrate]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } pub trait TheSubTrait : for<'a> TheTrait<'a> { @@ -53,8 +44,7 @@ fn with_assoc_sub<'a,'b>() { // below to be well-formed, it is not related to the HR relation. let _: &'a WithHrAssocSub> = loop { }; - //[migrate]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr similarity index 87% rename from src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr rename to src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr index 472323772c1..187e9056e11 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-outlives-projection-container-hrtb.rs:35:12 + --> $DIR/regions-outlives-projection-container-hrtb.rs:27:12 | LL | fn with_assoc<'a,'b>() { | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | let _: &'a WithHrAssoc> = loop { }; = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/regions-outlives-projection-container-hrtb.rs:55:12 + --> $DIR/regions-outlives-projection-container-hrtb.rs:46:12 | LL | fn with_assoc_sub<'a,'b>() { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr deleted file mode 100644 index bda2896fca4..00000000000 --- a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-projection-container-wc.rs:38:12 - | -LL | let _: &'a WithAssoc> = loop { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-projection-container-wc.rs:32:15 - | -LL | fn with_assoc<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-projection-container-wc.rs:32:18 - | -LL | fn with_assoc<'a,'b>() { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.rs b/src/test/ui/regions/regions-outlives-projection-container-wc.rs index c9b714cffb6..4fda7774b5b 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-wc.rs +++ b/src/test/ui/regions/regions-outlives-projection-container-wc.rs @@ -3,14 +3,6 @@ // outlive the location in which the type appears, even when the // constraint is in a where clause not a bound. Issue #22246. -// revisions: migrate nll -//[nll]compile-flags: -Z borrowck=mir - -// Since we are testing nll (and migration) explicitly as a separate -// revisions, don't worry about the --compare-mode=nll on this test. - -// ignore-compare-mode-nll - #![allow(dead_code)] pub trait TheTrait { @@ -36,8 +28,7 @@ fn with_assoc<'a,'b>() { // which is &'b (), must outlive 'a. let _: &'a WithAssoc> = loop { }; - //[migrate]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.stderr similarity index 88% rename from src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr rename to src/test/ui/regions/regions-outlives-projection-container-wc.stderr index fc32a72d508..4178e951c86 100644 --- a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container-wc.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-outlives-projection-container-wc.rs:38:12 + --> $DIR/regions-outlives-projection-container-wc.rs:30:12 | LL | fn with_assoc<'a,'b>() { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-outlives-projection-container.base.stderr b/src/test/ui/regions/regions-outlives-projection-container.base.stderr deleted file mode 100644 index 9a66f67ea6e..00000000000 --- a/src/test/ui/regions/regions-outlives-projection-container.base.stderr +++ /dev/null @@ -1,71 +0,0 @@ -error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-projection-container.rs:40:13 - | -LL | let _x: &'a WithAssoc> = loop { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-projection-container.rs:32:15 - | -LL | fn with_assoc<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-projection-container.rs:32:18 - | -LL | fn with_assoc<'a,'b>() { - | ^^ - -error[E0491]: in type `&'a WithoutAssoc>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-projection-container.rs:59:13 - | -LL | let _x: &'a WithoutAssoc> = loop { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-projection-container.rs:55:18 - | -LL | fn without_assoc<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-projection-container.rs:55:21 - | -LL | fn without_assoc<'a,'b>() { - | ^^ - -error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-projection-container.rs:69:12 - | -LL | call::<&'a WithAssoc>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-projection-container.rs:64:20 - | -LL | fn call_with_assoc<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-projection-container.rs:64:23 - | -LL | fn call_with_assoc<'a,'b>() { - | ^^ - -error[E0491]: in type `&'a WithoutAssoc>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-projection-container.rs:77:12 - | -LL | call::<&'a WithoutAssoc>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-projection-container.rs:74:23 - | -LL | fn call_without_assoc<'a,'b>() { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-projection-container.rs:74:26 - | -LL | fn call_without_assoc<'a,'b>() { - | ^^ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/regions/regions-outlives-projection-container.rs b/src/test/ui/regions/regions-outlives-projection-container.rs index ccfd2213b6f..7b9829cf8ef 100644 --- a/src/test/ui/regions/regions-outlives-projection-container.rs +++ b/src/test/ui/regions/regions-outlives-projection-container.rs @@ -2,10 +2,6 @@ // type of a bound that appears in the where clause on a struct must // outlive the location in which the type appears. Issue #22246. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(dead_code)] #![feature(rustc_attrs)] @@ -38,8 +34,7 @@ fn with_assoc<'a,'b>() { // FIXME (#54943) NLL doesn't enforce WF condition in unreachable code if // `_x` is changed to `_` let _x: &'a WithAssoc> = loop { }; - //[base]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn with_assoc1<'a,'b>() where 'b : 'a { @@ -57,8 +52,7 @@ fn without_assoc<'a,'b>() { // that `'b:'a` holds because the `'b` appears in `TheType<'b>`. let _x: &'a WithoutAssoc> = loop { }; - //[base]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn call_with_assoc<'a,'b>() { @@ -67,16 +61,14 @@ fn call_with_assoc<'a,'b>() { // no data. call::<&'a WithAssoc>>(); - //[base]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn call_without_assoc<'a,'b>() { // As `without_assoc`, but in a distinct scenario. call::<&'a WithoutAssoc>>(); - //[base]~^ ERROR reference has a longer lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn call() { } diff --git a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container.stderr similarity index 88% rename from src/test/ui/regions/regions-outlives-projection-container.nll.stderr rename to src/test/ui/regions/regions-outlives-projection-container.stderr index d93eef9ce0b..073a3190022 100644 --- a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr +++ b/src/test/ui/regions/regions-outlives-projection-container.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-outlives-projection-container.rs:40:13 + --> $DIR/regions-outlives-projection-container.rs:36:13 | LL | fn with_assoc<'a,'b>() { | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | let _x: &'a WithAssoc> = loop { }; = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/regions-outlives-projection-container.rs:59:13 + --> $DIR/regions-outlives-projection-container.rs:54:13 | LL | fn without_assoc<'a,'b>() { | -- -- lifetime `'b` defined here @@ -25,7 +25,7 @@ LL | let _x: &'a WithoutAssoc> = loop { }; = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/regions-outlives-projection-container.rs:69:5 + --> $DIR/regions-outlives-projection-container.rs:63:5 | LL | fn call_with_assoc<'a,'b>() { | -- -- lifetime `'b` defined here @@ -38,7 +38,7 @@ LL | call::<&'a WithAssoc>>(); = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/regions-outlives-projection-container.rs:77:5 + --> $DIR/regions-outlives-projection-container.rs:70:5 | LL | fn call_without_assoc<'a,'b>() { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-proc-bound-capture.base.stderr b/src/test/ui/regions/regions-proc-bound-capture.base.stderr deleted file mode 100644 index 427c6f4ec8c..00000000000 --- a/src/test/ui/regions/regions-proc-bound-capture.base.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-proc-bound-capture.rs:13:14 - | -LL | fn static_proc(x: &isize) -> Box (isize) + 'static> { - | ------ this data with an anonymous lifetime `'_`... -LL | // This is illegal, because the region bound on `proc` is 'static. -LL | Box::new(move || { *x }) - | ^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/regions-proc-bound-capture.rs:11:59 - | -LL | fn static_proc(x: &isize) -> Box (isize) + 'static> { - | ^^^^^^^ `'static` requirement introduced here -LL | // This is illegal, because the region bound on `proc` is 'static. -LL | Box::new(move || { *x }) - | ------------------------ because of this returned expression -help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` - | -LL | fn static_proc(x: &isize) -> Box (isize) + '_> { - | ~~ -help: alternatively, add an explicit `'static` bound to this reference - | -LL | fn static_proc(x: &'static isize) -> Box (isize) + 'static> { - | ~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/regions/regions-proc-bound-capture.rs b/src/test/ui/regions/regions-proc-bound-capture.rs index 1033163c8dd..f79d9dc909f 100644 --- a/src/test/ui/regions/regions-proc-bound-capture.rs +++ b/src/test/ui/regions/regions-proc-bound-capture.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn borrowed_proc<'a>(x: &'a isize) -> Box(isize) + 'a> { // This is legal, because the region bound on `proc` // states that it captures `x`. @@ -11,8 +7,7 @@ fn borrowed_proc<'a>(x: &'a isize) -> Box(isize) + 'a> { fn static_proc(x: &isize) -> Box (isize) + 'static> { // This is illegal, because the region bound on `proc` is 'static. Box::new(move || { *x }) - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/regions/regions-proc-bound-capture.nll.stderr b/src/test/ui/regions/regions-proc-bound-capture.stderr similarity index 95% rename from src/test/ui/regions/regions-proc-bound-capture.nll.stderr rename to src/test/ui/regions/regions-proc-bound-capture.stderr index ce4d2d4d111..60c5246e240 100644 --- a/src/test/ui/regions/regions-proc-bound-capture.nll.stderr +++ b/src/test/ui/regions/regions-proc-bound-capture.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-proc-bound-capture.rs:13:5 + --> $DIR/regions-proc-bound-capture.rs:9:5 | LL | fn static_proc(x: &isize) -> Box (isize) + 'static> { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr deleted file mode 100644 index 7ecdb0cd15e..00000000000 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.base.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:8:5 - | -LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize { - | ----------------------------- ------------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | &mut ***p - | ^^^^^^^^^ ...but data from `p` is returned here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs index c4ad05010fb..57871b09837 100644 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs +++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs @@ -1,13 +1,8 @@ // Issue #8624. Test for reborrowing with 3 levels, not just two. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize { &mut ***p - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr similarity index 89% rename from src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr rename to src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr index 519ada7bdfc..dc905d076bb 100644 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr +++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:8:5 + --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:4:5 | LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr deleted file mode 100644 index 3cb7de15850..00000000000 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.base.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:10:5 - | -LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize { - | --------------------- ------------- - | | - | this parameter and the return type are declared with different lifetimes... -LL | &mut **p - | ^^^^^^^^ ...but data from `p` is returned here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs index c41e76e4d2a..88cc5465003 100644 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs +++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs @@ -2,14 +2,9 @@ // pointer which is backed by another `&'a mut` can only be done // for `'a` (which must be a sublifetime of `'b`). -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize { &mut **p - //[base]~^ ERROR lifetime mismatch [E0623] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr similarity index 89% rename from src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr rename to src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr index 4dd2a83739c..c98ec477417 100644 --- a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr +++ b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:10:5 + --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:6:5 | LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-ret-borrowed-1.base.stderr b/src/test/ui/regions/regions-ret-borrowed-1.base.stderr deleted file mode 100644 index d102f93a647..00000000000 --- a/src/test/ui/regions/regions-ret-borrowed-1.base.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/regions-ret-borrowed-1.rs:14:14 - | -LL | with(|o| o) - | ^ - | -note: first, the lifetime cannot outlive the anonymous lifetime #1 defined here... - --> $DIR/regions-ret-borrowed-1.rs:14:10 - | -LL | with(|o| o) - | ^^^^^ -note: ...so that the types are compatible - --> $DIR/regions-ret-borrowed-1.rs:14:14 - | -LL | with(|o| o) - | ^ - = note: expected `&isize` - found `&isize` -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/regions-ret-borrowed-1.rs:13:14 - | -LL | fn return_it<'a>() -> &'a isize { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/regions-ret-borrowed-1.rs:14:5 - | -LL | with(|o| o) - | ^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-ret-borrowed-1.rs b/src/test/ui/regions/regions-ret-borrowed-1.rs index fed631320b4..54630caffb4 100644 --- a/src/test/ui/regions/regions-ret-borrowed-1.rs +++ b/src/test/ui/regions/regions-ret-borrowed-1.rs @@ -2,18 +2,13 @@ // some point regions-ret-borrowed reported an error but this file did // not, due to special hardcoding around the anonymous region. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn with(f: F) -> R where F: for<'a> FnOnce(&'a isize) -> R { f(&3) } fn return_it<'a>() -> &'a isize { with(|o| o) - //[base]~^ ERROR cannot infer an appropriate lifetime due to conflicting requirements [E0495] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr b/src/test/ui/regions/regions-ret-borrowed-1.stderr similarity index 87% rename from src/test/ui/regions/regions-ret-borrowed-1.nll.stderr rename to src/test/ui/regions/regions-ret-borrowed-1.stderr index 4fdadccab15..0784e894ea9 100644 --- a/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr +++ b/src/test/ui/regions/regions-ret-borrowed-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-ret-borrowed-1.rs:14:14 + --> $DIR/regions-ret-borrowed-1.rs:10:14 | LL | with(|o| o) | -- ^ returning this value requires that `'1` must outlive `'2` diff --git a/src/test/ui/regions/regions-ret-borrowed.base.stderr b/src/test/ui/regions/regions-ret-borrowed.base.stderr deleted file mode 100644 index 62b42b5dd11..00000000000 --- a/src/test/ui/regions/regions-ret-borrowed.base.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/regions-ret-borrowed.rs:17:14 - | -LL | with(|o| o) - | ^ - | -note: first, the lifetime cannot outlive the anonymous lifetime #1 defined here... - --> $DIR/regions-ret-borrowed.rs:17:10 - | -LL | with(|o| o) - | ^^^^^ -note: ...so that the types are compatible - --> $DIR/regions-ret-borrowed.rs:17:14 - | -LL | with(|o| o) - | ^ - = note: expected `&isize` - found `&isize` -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/regions-ret-borrowed.rs:16:14 - | -LL | fn return_it<'a>() -> &'a isize { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/regions-ret-borrowed.rs:17:5 - | -LL | with(|o| o) - | ^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-ret-borrowed.rs b/src/test/ui/regions/regions-ret-borrowed.rs index 2b6855d1c71..bdb0341c97c 100644 --- a/src/test/ui/regions/regions-ret-borrowed.rs +++ b/src/test/ui/regions/regions-ret-borrowed.rs @@ -5,18 +5,13 @@ // used to successfully compile because we failed to account for the // fact that fn(x: &isize) rebound the region &. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn with(f: F) -> R where F: FnOnce(&isize) -> R { f(&3) } fn return_it<'a>() -> &'a isize { with(|o| o) - //[base]~^ ERROR cannot infer an appropriate lifetime due to conflicting requirements [E0495] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/regions/regions-ret-borrowed.nll.stderr b/src/test/ui/regions/regions-ret-borrowed.stderr similarity index 87% rename from src/test/ui/regions/regions-ret-borrowed.nll.stderr rename to src/test/ui/regions/regions-ret-borrowed.stderr index d3ea5bd875f..d9be5ef89cc 100644 --- a/src/test/ui/regions/regions-ret-borrowed.nll.stderr +++ b/src/test/ui/regions/regions-ret-borrowed.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-ret-borrowed.rs:17:14 + --> $DIR/regions-ret-borrowed.rs:13:14 | LL | with(|o| o) | -- ^ returning this value requires that `'1` must outlive `'2` diff --git a/src/test/ui/regions/regions-static-bound.base.stderr b/src/test/ui/regions/regions-static-bound.base.stderr deleted file mode 100644 index 6b8120444d0..00000000000 --- a/src/test/ui/regions/regions-static-bound.base.stderr +++ /dev/null @@ -1,62 +0,0 @@ -warning: unnecessary lifetime parameter `'a` - --> $DIR/regions-static-bound.rs:6:11 - | -LL | where 'a: 'static { t } - | ^^ - | - = help: you can use the `'static` lifetime directly, in place of `'a` - -warning: unnecessary lifetime parameter `'b` - --> $DIR/regions-static-bound.rs:10:19 - | -LL | where 'a: 'b, 'b: 'static { t } - | ^^ - | - = help: you can use the `'static` lifetime directly, in place of `'b` - -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/regions-static-bound.rs:14:5 - | -LL | t - | ^ - | - = note: ...the reference is valid for the static lifetime... -note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/regions-static-bound.rs:13:24 - | -LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { - | ^^ - -error[E0759]: `u` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-static-bound.rs:20:5 - | -LL | fn error(u: &(), v: &()) { - | --- this data with an anonymous lifetime `'_`... -LL | static_id(&u); - | ^^^^^^^^^ -- ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/regions-static-bound.rs:20:5 - | -LL | static_id(&u); - | ^^^^^^^^^ - -error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-static-bound.rs:23:5 - | -LL | fn error(u: &(), v: &()) { - | --- this data with an anonymous lifetime `'_`... -... -LL | static_id_indirect(&v); - | ^^^^^^^^^^^^^^^^^^ -- ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/regions-static-bound.rs:23:5 - | -LL | static_id_indirect(&v); - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to 3 previous errors; 2 warnings emitted - -Some errors have detailed explanations: E0312, E0759. -For more information about an error, try `rustc --explain E0312`. diff --git a/src/test/ui/regions/regions-static-bound.rs b/src/test/ui/regions/regions-static-bound.rs index 1eed7e71745..4d2455470e2 100644 --- a/src/test/ui/regions/regions-static-bound.rs +++ b/src/test/ui/regions/regions-static-bound.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn static_id<'a,'b>(t: &'a ()) -> &'static () where 'a: 'static { t } //~^ WARN unnecessary lifetime parameter `'a` @@ -12,17 +8,14 @@ fn static_id_indirect<'a,'b>(t: &'a ()) -> &'static () fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { t - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn error(u: &(), v: &()) { static_id(&u); - //[base]~^ ERROR `u` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR borrowed data escapes outside of function [E0521] + //~^ ERROR borrowed data escapes outside of function [E0521] static_id_indirect(&v); - //[base]~^ ERROR `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] - //[nll]~^^ ERROR borrowed data escapes outside of function [E0521] + //~^ ERROR borrowed data escapes outside of function [E0521] } fn main() {} diff --git a/src/test/ui/regions/regions-static-bound.nll.stderr b/src/test/ui/regions/regions-static-bound.stderr similarity index 89% rename from src/test/ui/regions/regions-static-bound.nll.stderr rename to src/test/ui/regions/regions-static-bound.stderr index 68e36f3aeea..2886ec3ead5 100644 --- a/src/test/ui/regions/regions-static-bound.nll.stderr +++ b/src/test/ui/regions/regions-static-bound.stderr @@ -1,5 +1,5 @@ warning: unnecessary lifetime parameter `'a` - --> $DIR/regions-static-bound.rs:6:11 + --> $DIR/regions-static-bound.rs:2:11 | LL | where 'a: 'static { t } | ^^ @@ -7,7 +7,7 @@ LL | where 'a: 'static { t } = help: you can use the `'static` lifetime directly, in place of `'a` warning: unnecessary lifetime parameter `'b` - --> $DIR/regions-static-bound.rs:10:19 + --> $DIR/regions-static-bound.rs:6:19 | LL | where 'a: 'b, 'b: 'static { t } | ^^ @@ -15,7 +15,7 @@ LL | where 'a: 'b, 'b: 'static { t } = help: you can use the `'static` lifetime directly, in place of `'b` error: lifetime may not live long enough - --> $DIR/regions-static-bound.rs:14:5 + --> $DIR/regions-static-bound.rs:10:5 | LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | -- lifetime `'a` defined here @@ -23,7 +23,7 @@ LL | t | ^ returning this value requires that `'a` must outlive `'static` error[E0521]: borrowed data escapes outside of function - --> $DIR/regions-static-bound.rs:20:5 + --> $DIR/regions-static-bound.rs:15:5 | LL | fn error(u: &(), v: &()) { | - - let's call the lifetime of this reference `'1` @@ -36,7 +36,7 @@ LL | static_id(&u); | argument requires that `'1` must outlive `'static` error[E0521]: borrowed data escapes outside of function - --> $DIR/regions-static-bound.rs:23:5 + --> $DIR/regions-static-bound.rs:17:5 | LL | fn error(u: &(), v: &()) { | - - let's call the lifetime of this reference `'2` diff --git a/src/test/ui/regions/regions-trait-object-subtyping.base.stderr b/src/test/ui/regions/regions-trait-object-subtyping.base.stderr deleted file mode 100644 index 9f52136f0c0..00000000000 --- a/src/test/ui/regions/regions-trait-object-subtyping.base.stderr +++ /dev/null @@ -1,69 +0,0 @@ -error[E0478]: lifetime bound not satisfied - --> $DIR/regions-trait-object-subtyping.rs:19:5 - | -LL | x - | ^ - | -note: lifetime parameter instantiated with the lifetime `'a` as defined here - --> $DIR/regions-trait-object-subtyping.rs:17:9 - | -LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { - | ^^ -note: but lifetime parameter must outlive the lifetime `'b` as defined here - --> $DIR/regions-trait-object-subtyping.rs:17:12 - | -LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { - | ^^ - -error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements - --> $DIR/regions-trait-object-subtyping.rs:19:5 - | -LL | x - | ^ - | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/regions-trait-object-subtyping.rs:17:9 - | -LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/regions-trait-object-subtyping.rs:19:5 - | -LL | x - | ^ -note: but, the lifetime must be valid for the lifetime `'b` as defined here... - --> $DIR/regions-trait-object-subtyping.rs:17:12 - | -LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { - | ^^ -note: ...so that the types are compatible - --> $DIR/regions-trait-object-subtyping.rs:19:5 - | -LL | x - | ^ - = note: expected `&'b mut (dyn Dummy + 'b)` - found `&mut (dyn Dummy + 'b)` - -error[E0308]: mismatched types - --> $DIR/regions-trait-object-subtyping.rs:28:5 - | -LL | x - | ^ lifetime mismatch - | - = note: expected struct `Wrapper<&'b mut (dyn Dummy + 'b)>` - found struct `Wrapper<&'a mut (dyn Dummy + 'a)>` -note: the lifetime `'b` as defined here... - --> $DIR/regions-trait-object-subtyping.rs:26:15 - | -LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> { - | ^^ -note: ...does not necessarily outlive the lifetime `'a` as defined here - --> $DIR/regions-trait-object-subtyping.rs:26:9 - | -LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> { - | ^^ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0308, E0478, E0495. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-trait-object-subtyping.rs b/src/test/ui/regions/regions-trait-object-subtyping.rs index f108fc81cea..1d7a766de30 100644 --- a/src/test/ui/regions/regions-trait-object-subtyping.rs +++ b/src/test/ui/regions/regions-trait-object-subtyping.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Dummy { fn dummy(&self); } fn foo1<'a:'b,'b>(x: &'a mut (dyn Dummy+'a)) -> &'b mut (dyn Dummy+'b) { @@ -17,17 +13,14 @@ fn foo2<'a:'b,'b>(x: &'b mut (dyn Dummy+'a)) -> &'b mut (dyn Dummy+'b) { fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { // Without knowing 'a:'b, we can't coerce x - //[base]~^ ERROR lifetime bound not satisfied - //[base]~| ERROR cannot infer an appropriate lifetime - //[nll]~^^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } struct Wrapper(T); fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> { // We can't coerce because it is packed in `Wrapper` x - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr similarity index 93% rename from src/test/ui/regions/regions-trait-object-subtyping.nll.stderr rename to src/test/ui/regions/regions-trait-object-subtyping.stderr index c8cec3bd377..1b3a116d508 100644 --- a/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr +++ b/src/test/ui/regions/regions-trait-object-subtyping.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-trait-object-subtyping.rs:19:5 + --> $DIR/regions-trait-object-subtyping.rs:15:5 | LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { | -- -- lifetime `'b` defined here @@ -15,7 +15,7 @@ LL | x = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/regions-trait-object-subtyping.rs:28:5 + --> $DIR/regions-trait-object-subtyping.rs:22:5 | LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr deleted file mode 100644 index 23b3dea885d..00000000000 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-variance-contravariant-use-covariant-in-second-position.rs:29:30 - | -LL | fn use_<'short,'long>(c: S<'long, 'short>, - | ---------------- this type is declared with multiple lifetimes... -... -LL | let _: S<'long, 'long> = c; - | ^ ...but data with one lifetime flows into the other here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs index 4bf32ec3082..f23ca537fa8 100644 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs @@ -4,10 +4,6 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // `S` is contravariant with respect to both parameters. struct S<'a, 'b> { f: &'a isize, @@ -27,8 +23,7 @@ fn use_<'short,'long>(c: S<'long, 'short>, // covariant with respect to its parameter 'a. let _: S<'long, 'long> = c; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr similarity index 96% rename from src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr rename to src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr index f364f423f4e..5352be430fb 100644 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.nll.stderr +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-variance-contravariant-use-covariant-in-second-position.rs:29:12 + --> $DIR/regions-variance-contravariant-use-covariant-in-second-position.rs:25:12 | LL | fn use_<'short,'long>(c: S<'long, 'short>, | ------ ----- lifetime `'long` defined here diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr deleted file mode 100644 index 8eca0d4d121..00000000000 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-variance-contravariant-use-covariant.rs:27:35 - | -LL | fn use_<'short,'long>(c: Contravariant<'short>, - | --------------------- these two types are declared with different lifetimes... -LL | s: &'short isize, -LL | l: &'long isize, - | ------------ -... -LL | let _: Contravariant<'long> = c; - | ^ ...but data from `c` flows into `l` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs b/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs index ea08a709230..c73577cb350 100644 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs @@ -4,10 +4,6 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // This is contravariant with respect to 'a, meaning that // Contravariant<'long> <: Contravariant<'short> iff // 'short <= 'long @@ -25,8 +21,7 @@ fn use_<'short,'long>(c: Contravariant<'short>, // covariant with respect to its parameter 'a. let _: Contravariant<'long> = c; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr similarity index 87% rename from src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr rename to src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr index bc6dd6e69ed..22c9b915bb9 100644 --- a/src/test/ui/regions/regions-variance-contravariant-use-covariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-variance-contravariant-use-covariant.rs:27:12 + --> $DIR/regions-variance-contravariant-use-covariant.rs:23:12 | LL | fn use_<'short,'long>(c: Contravariant<'short>, | ------ ----- lifetime `'long` defined here diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr b/src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr deleted file mode 100644 index 565de38ee11..00000000000 --- a/src/test/ui/regions/regions-variance-covariant-use-contravariant.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-variance-covariant-use-contravariant.rs:27:32 - | -LL | fn use_<'short,'long>(c: Covariant<'long>, - | ---------------- -LL | s: &'short isize, - | ------------- these two types are declared with different lifetimes... -... -LL | let _: Covariant<'short> = c; - | ^ ...but data from `s` flows into `c` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs b/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs index 748ad84840a..a2183b491ed 100644 --- a/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs +++ b/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs @@ -4,10 +4,6 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // This is covariant with respect to 'a, meaning that // Covariant<'foo> <: Covariant<'static> because // 'foo <= 'static @@ -25,8 +21,7 @@ fn use_<'short,'long>(c: Covariant<'long>, // contravariant with respect to its parameter 'a. let _: Covariant<'short> = c; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr b/src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr similarity index 87% rename from src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr rename to src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr index 9d3cebc9a4d..a07181ad553 100644 --- a/src/test/ui/regions/regions-variance-covariant-use-contravariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-variance-covariant-use-contravariant.rs:27:12 + --> $DIR/regions-variance-covariant-use-contravariant.rs:23:12 | LL | fn use_<'short,'long>(c: Covariant<'long>, | ------ ----- lifetime `'long` defined here diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr b/src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr deleted file mode 100644 index e2e8958f53e..00000000000 --- a/src/test/ui/regions/regions-variance-invariant-use-contravariant.base.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/regions-variance-invariant-use-contravariant.rs:24:32 - | -LL | fn use_<'short,'long>(c: Invariant<'long>, - | ---------------- -LL | s: &'short isize, - | ------------- these two types are declared with different lifetimes... -... -LL | let _: Invariant<'short> = c; - | ^ ...but data from `s` flows into `c` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs b/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs index 788f9b1b4d0..a81aaa9c776 100644 --- a/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs +++ b/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs @@ -4,10 +4,6 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Invariant<'a> { f: &'a mut &'a isize } @@ -22,8 +18,7 @@ fn use_<'short,'long>(c: Invariant<'long>, // contravariant with respect to its parameter 'a. let _: Invariant<'short> = c; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr b/src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr similarity index 92% rename from src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr rename to src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr index b4ccb1693a7..b35a2cb905d 100644 --- a/src/test/ui/regions/regions-variance-invariant-use-contravariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-variance-invariant-use-contravariant.rs:24:12 + --> $DIR/regions-variance-invariant-use-contravariant.rs:20:12 | LL | fn use_<'short,'long>(c: Invariant<'long>, | ------ ----- lifetime `'long` defined here diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr b/src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr deleted file mode 100644 index da91db1b918..00000000000 --- a/src/test/ui/regions/regions-variance-invariant-use-covariant.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/regions-variance-invariant-use-covariant.rs:21:33 - | -LL | let _: Invariant<'static> = c; - | ^ lifetime mismatch - | - = note: expected struct `Invariant<'static>` - found struct `Invariant<'b>` -note: the lifetime `'b` as defined here... - --> $DIR/regions-variance-invariant-use-covariant.rs:15:9 - | -LL | fn use_<'b>(c: Invariant<'b>) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.rs b/src/test/ui/regions/regions-variance-invariant-use-covariant.rs index 4b7da4493ac..ab6a82ee7c7 100644 --- a/src/test/ui/regions/regions-variance-invariant-use-covariant.rs +++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.rs @@ -4,10 +4,6 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct Invariant<'a> { f: &'a mut &'a isize } @@ -19,8 +15,7 @@ fn use_<'b>(c: Invariant<'b>) { // with respect to its parameter 'a. let _: Invariant<'static> = c; - //[base]~^ ERROR mismatched types [E0308] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr similarity index 90% rename from src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr rename to src/test/ui/regions/regions-variance-invariant-use-covariant.stderr index 7b05c357589..761e78d179e 100644 --- a/src/test/ui/regions/regions-variance-invariant-use-covariant.nll.stderr +++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/regions-variance-invariant-use-covariant.rs:21:12 + --> $DIR/regions-variance-invariant-use-covariant.rs:17:12 | LL | fn use_<'b>(c: Invariant<'b>) { | -- lifetime `'b` defined here diff --git a/src/test/ui/rfc1623.base.stderr b/src/test/ui/rfc1623.base.stderr deleted file mode 100644 index 364c8c8f706..00000000000 --- a/src/test/ui/rfc1623.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `FnOnce` is not general enough - --> $DIR/rfc1623.rs:32:8 - | -LL | f: &id, - | ^^^ implementation of `FnOnce` is not general enough - | - = note: `fn(&'2 Foo<'_>) -> &'2 Foo<'_> {id::<&'2 Foo<'_>>}` must implement `FnOnce<(&'1 Foo<'b>,)>`, for any lifetime `'1`... - = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2` - -error: aborting due to previous error - diff --git a/src/test/ui/rfc1623.rs b/src/test/ui/rfc1623.rs index 443da0aa955..c0e13a5f5f0 100644 --- a/src/test/ui/rfc1623.rs +++ b/src/test/ui/rfc1623.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(dead_code)] fn non_elidable<'a, 'b>(a: &'a u8, b: &'b u8) -> &'a u8 { @@ -30,11 +26,10 @@ static SOME_STRUCT: &SomeStruct = &SomeStruct { foo: &Foo { bools: &[false, true] }, bar: &Bar { bools: &[true, true] }, f: &id, - //[base]~^ ERROR implementation of `FnOnce` is not general enough - //[nll]~^^ ERROR mismatched types - //[nll]~| ERROR mismatched types - //[nll]~| ERROR implementation of `FnOnce` is not general enough - //[nll]~| ERROR implementation of `FnOnce` is not general enough + //~^ ERROR mismatched types + //~| ERROR mismatched types + //~| ERROR implementation of `FnOnce` is not general enough + //~| ERROR implementation of `FnOnce` is not general enough }; // very simple test for a 'static static with default lifetime diff --git a/src/test/ui/rfc1623.nll.stderr b/src/test/ui/rfc1623.stderr similarity index 92% rename from src/test/ui/rfc1623.nll.stderr rename to src/test/ui/rfc1623.stderr index 2eff4708547..2ca56afbc57 100644 --- a/src/test/ui/rfc1623.nll.stderr +++ b/src/test/ui/rfc1623.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/rfc1623.rs:32:8 + --> $DIR/rfc1623.rs:28:8 | LL | f: &id, | ^^^ one type is more general than the other @@ -8,7 +8,7 @@ LL | f: &id, found type `Fn<(&Foo<'_>,)>` error[E0308]: mismatched types - --> $DIR/rfc1623.rs:32:8 + --> $DIR/rfc1623.rs:28:8 | LL | f: &id, | ^^^ one type is more general than the other @@ -17,7 +17,7 @@ LL | f: &id, found type `Fn<(&Foo<'_>,)>` error: implementation of `FnOnce` is not general enough - --> $DIR/rfc1623.rs:32:8 + --> $DIR/rfc1623.rs:28:8 | LL | f: &id, | ^^^ implementation of `FnOnce` is not general enough @@ -26,7 +26,7 @@ LL | f: &id, = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2` error: implementation of `FnOnce` is not general enough - --> $DIR/rfc1623.rs:32:8 + --> $DIR/rfc1623.rs:28:8 | LL | f: &id, | ^^^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr deleted file mode 100644 index d2106630dfe..00000000000 --- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:52 - | -LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } - | ---- ---- ^ ...but data from `f` is returned here - | | - | this parameter and the return type are declared with different lifetimes... - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f } - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:82 - | -LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - | ---- ----------------- ^ ...but data from `f` is returned here - | | - | this parameter and the return type are declared with different lifetimes... - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:22:64 - | -LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } - | ------ --- ^^^ ...but data from `arg` is returned here - | | - | this parameter and the return type are declared with different lifetimes... - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs index c54f7963c23..a2b7f080568 100644 --- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs +++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir use std::pin::Pin; @@ -9,19 +6,16 @@ struct Foo; impl Foo { async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } type Alias = Pin; impl Foo { async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } - //[base]~^ ERROR E0623 - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr similarity index 96% rename from src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr rename to src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr index 3fd58725d02..6180e1e0f2d 100644 --- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr +++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:52 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52 | LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } | - - ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` @@ -13,7 +13,7 @@ LL | async fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f } | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:75 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75 | LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } | - - ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` @@ -27,7 +27,7 @@ LL | async fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:22:64 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64 | LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } | -- - ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr deleted file mode 100644 index c0e2f0bd3e9..00000000000 --- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:10:46 - | -LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } - | ---- ---- ^ ...but data from `f` is returned here - | | - | this parameter and the return type are declared with different lifetimes... - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f } - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:76 - | -LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - | ---- ----------------- ^ ...but data from `f` is returned here - | | - | this parameter and the return type are declared with different lifetimes... - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:58 - | -LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } - | ------ --- ^^^ ...but data from `arg` is returned here - | | - | this parameter and the return type are declared with different lifetimes... - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs index 34b08b364fb..f1a3fb0185d 100644 --- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs +++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs @@ -1,26 +1,19 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::pin::Pin; struct Foo; impl Foo { fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } - //[base]~^ ERROR E0623 - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - //[base]~^ ERROR E0623 - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } type Alias = Pin; impl Foo { fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } - //[base]~^ ERROR E0623 - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr similarity index 90% rename from src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr rename to src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr index 057146e7cb0..fccee5d4363 100644 --- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr +++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:10:46 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46 | LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } | - - ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` @@ -13,7 +13,7 @@ LL | fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f } | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:69 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:9:69 | LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } | - - ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` @@ -27,7 +27,7 @@ LL | fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:58 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:15:58 | LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } | -- ---- has type `Pin<&'1 Foo>` ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` diff --git a/src/test/ui/self/elision/lt-ref-self-async.base.stderr b/src/test/ui/self/elision/lt-ref-self-async.base.stderr deleted file mode 100644 index 0e2bbcc3c04..00000000000 --- a/src/test/ui/self/elision/lt-ref-self-async.base.stderr +++ /dev/null @@ -1,99 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:16:9 - | -LL | async fn ref_self(&self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:24:9 - | -LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:30:9 - | -LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:36:9 - | -LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:42:9 - | -LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self-async.rs:48:9 - | -LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_pin_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/lt-ref-self-async.rs b/src/test/ui/self/elision/lt-ref-self-async.rs index 24482b3a278..a2325ba7fa6 100644 --- a/src/test/ui/self/elision/lt-ref-self-async.rs +++ b/src/test/ui/self/elision/lt-ref-self-async.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir #![allow(non_snake_case)] @@ -14,40 +11,34 @@ impl<'a> Struct<'a> { async fn ref_self(&self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // Test using `&Self` explicitly: async fn ref_Self(self: &Self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr b/src/test/ui/self/elision/lt-ref-self-async.stderr similarity index 95% rename from src/test/ui/self/elision/lt-ref-self-async.nll.stderr rename to src/test/ui/self/elision/lt-ref-self-async.stderr index 1c889838e70..787afd4dc9d 100644 --- a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr +++ b/src/test/ui/self/elision/lt-ref-self-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:16:9 + --> $DIR/lt-ref-self-async.rs:13:9 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:24:9 + --> $DIR/lt-ref-self-async.rs:20:9 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:30:9 + --> $DIR/lt-ref-self-async.rs:25:9 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:36:9 + --> $DIR/lt-ref-self-async.rs:30:9 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:42:9 + --> $DIR/lt-ref-self-async.rs:35:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | async fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:48:9 + --> $DIR/lt-ref-self-async.rs:40:9 | LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/lt-ref-self.base.stderr b/src/test/ui/self/elision/lt-ref-self.base.stderr deleted file mode 100644 index 0f5cd6fb853..00000000000 --- a/src/test/ui/self/elision/lt-ref-self.base.stderr +++ /dev/null @@ -1,99 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:15:9 - | -LL | fn ref_self(&self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:23:9 - | -LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:29:9 - | -LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:35:9 - | -LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:41:9 - | -LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/lt-ref-self.rs:47:9 - | -LL | fn box_pin_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_pin_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/lt-ref-self.rs b/src/test/ui/self/elision/lt-ref-self.rs index 62bdb13dc0f..d37ed5acbcb 100644 --- a/src/test/ui/self/elision/lt-ref-self.rs +++ b/src/test/ui/self/elision/lt-ref-self.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(non_snake_case)] use std::pin::Pin; @@ -13,40 +9,34 @@ impl<'a> Struct<'a> { fn ref_self(&self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // Test using `&Self` explicitly: fn ref_Self(self: &Self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_pin_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/lt-ref-self.nll.stderr b/src/test/ui/self/elision/lt-ref-self.stderr similarity index 96% rename from src/test/ui/self/elision/lt-ref-self.nll.stderr rename to src/test/ui/self/elision/lt-ref-self.stderr index 2e26c703b65..49af638e4c6 100644 --- a/src/test/ui/self/elision/lt-ref-self.nll.stderr +++ b/src/test/ui/self/elision/lt-ref-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:15:9 + --> $DIR/lt-ref-self.rs:11:9 | LL | fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:23:9 + --> $DIR/lt-ref-self.rs:18:9 | LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:29:9 + --> $DIR/lt-ref-self.rs:23:9 | LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:35:9 + --> $DIR/lt-ref-self.rs:28:9 | LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:41:9 + --> $DIR/lt-ref-self.rs:33:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:47:9 + --> $DIR/lt-ref-self.rs:38:9 | LL | fn box_pin_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-mut-self-async.base.stderr b/src/test/ui/self/elision/ref-mut-self-async.base.stderr deleted file mode 100644 index 8ffc0d62242..00000000000 --- a/src/test/ui/self/elision/ref-mut-self-async.base.stderr +++ /dev/null @@ -1,99 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:16:9 - | -LL | async fn ref_self(&mut self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:24:9 - | -LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:30:9 - | -LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:36:9 - | -LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:42:9 - | -LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self-async.rs:48:9 - | -LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-mut-self-async.rs b/src/test/ui/self/elision/ref-mut-self-async.rs index 59b41f364f9..e07bc85643c 100644 --- a/src/test/ui/self/elision/ref-mut-self-async.rs +++ b/src/test/ui/self/elision/ref-mut-self-async.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir #![allow(non_snake_case)] @@ -14,40 +11,34 @@ impl Struct { async fn ref_self(&mut self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // Test using `&mut Self` explicitly: async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr b/src/test/ui/self/elision/ref-mut-self-async.stderr similarity index 95% rename from src/test/ui/self/elision/ref-mut-self-async.nll.stderr rename to src/test/ui/self/elision/ref-mut-self-async.stderr index 9beafcd4ff9..dff50aee918 100644 --- a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-self-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:16:9 + --> $DIR/ref-mut-self-async.rs:13:9 | LL | async fn ref_self(&mut self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | async fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:24:9 + --> $DIR/ref-mut-self-async.rs:20:9 | LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | async fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:30:9 + --> $DIR/ref-mut-self-async.rs:25:9 | LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | async fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:36:9 + --> $DIR/ref-mut-self-async.rs:30:9 | LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | async fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:42:9 + --> $DIR/ref-mut-self-async.rs:35:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | async fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self-async.rs:48:9 + --> $DIR/ref-mut-self-async.rs:40:9 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-mut-self.base.stderr b/src/test/ui/self/elision/ref-mut-self.base.stderr deleted file mode 100644 index fceddddf20e..00000000000 --- a/src/test/ui/self/elision/ref-mut-self.base.stderr +++ /dev/null @@ -1,99 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:15:9 - | -LL | fn ref_self(&mut self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:23:9 - | -LL | fn ref_Self(self: &mut Self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:29:9 - | -LL | fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:35:9 - | -LL | fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:41:9 - | -LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:47:9 - | -LL | fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-mut-self.rs b/src/test/ui/self/elision/ref-mut-self.rs index 81bd279129d..bb82e6be748 100644 --- a/src/test/ui/self/elision/ref-mut-self.rs +++ b/src/test/ui/self/elision/ref-mut-self.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(non_snake_case)] use std::pin::Pin; @@ -13,40 +9,34 @@ impl Struct { fn ref_self(&mut self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // Test using `&mut Self` explicitly: fn ref_Self(self: &mut Self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-mut-self.nll.stderr b/src/test/ui/self/elision/ref-mut-self.stderr similarity index 96% rename from src/test/ui/self/elision/ref-mut-self.nll.stderr rename to src/test/ui/self/elision/ref-mut-self.stderr index fd4ecae3cfe..ccf1830167c 100644 --- a/src/test/ui/self/elision/ref-mut-self.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:15:9 + --> $DIR/ref-mut-self.rs:11:9 | LL | fn ref_self(&mut self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_self<'a>(&'a mut self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:23:9 + --> $DIR/ref-mut-self.rs:18:9 | LL | fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn ref_Self<'a>(self: &'a mut Self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:29:9 + --> $DIR/ref-mut-self.rs:23:9 | LL | fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn box_ref_Self<'a>(self: Box<&'a mut Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:35:9 + --> $DIR/ref-mut-self.rs:28:9 | LL | fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn pin_ref_Self<'a>(self: Pin<&'a mut Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:41:9 + --> $DIR/ref-mut-self.rs:33:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-self.rs:47:9 + --> $DIR/ref-mut-self.rs:38:9 | LL | fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-mut-struct-async.base.stderr b/src/test/ui/self/elision/ref-mut-struct-async.base.stderr deleted file mode 100644 index fefb3fc1944..00000000000 --- a/src/test/ui/self/elision/ref-mut-struct-async.base.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:16:9 - | -LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:22:9 - | -LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:28:9 - | -LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:34:9 - | -LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_box_ref_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct-async.rs:40:9 - | -LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_pin_ref_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-mut-struct-async.rs b/src/test/ui/self/elision/ref-mut-struct-async.rs index 7448988355c..392bf1d6be3 100644 --- a/src/test/ui/self/elision/ref-mut-struct-async.rs +++ b/src/test/ui/self/elision/ref-mut-struct-async.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir #![allow(non_snake_case)] @@ -14,32 +11,27 @@ impl Struct { async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr b/src/test/ui/self/elision/ref-mut-struct-async.stderr similarity index 96% rename from src/test/ui/self/elision/ref-mut-struct-async.nll.stderr rename to src/test/ui/self/elision/ref-mut-struct-async.stderr index 7fbecbe76a5..5b7ad026f9d 100644 --- a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-struct-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:16:9 + --> $DIR/ref-mut-struct-async.rs:13:9 | LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | async fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:22:9 + --> $DIR/ref-mut-struct-async.rs:18:9 | LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | async fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> & | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:28:9 + --> $DIR/ref-mut-struct-async.rs:23:9 | LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | async fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> & | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:34:9 + --> $DIR/ref-mut-struct-async.rs:28:9 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | async fn box_box_ref_Struct<'a>(self: Box>, f: &'a | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct-async.rs:40:9 + --> $DIR/ref-mut-struct-async.rs:33:9 | LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-mut-struct.base.stderr b/src/test/ui/self/elision/ref-mut-struct.base.stderr deleted file mode 100644 index a01492f6cd3..00000000000 --- a/src/test/ui/self/elision/ref-mut-struct.base.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:15:9 - | -LL | fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:21:9 - | -LL | fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:27:9 - | -LL | fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:33:9 - | -LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_box_ref_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:39:9 - | -LL | fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_pin_ref_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-mut-struct.rs b/src/test/ui/self/elision/ref-mut-struct.rs index 72674bd65b6..ca8bd8da133 100644 --- a/src/test/ui/self/elision/ref-mut-struct.rs +++ b/src/test/ui/self/elision/ref-mut-struct.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(non_snake_case)] use std::pin::Pin; @@ -13,32 +9,27 @@ impl Struct { fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-mut-struct.nll.stderr b/src/test/ui/self/elision/ref-mut-struct.stderr similarity index 96% rename from src/test/ui/self/elision/ref-mut-struct.nll.stderr rename to src/test/ui/self/elision/ref-mut-struct.stderr index ede790c0611..b9c71e8433c 100644 --- a/src/test/ui/self/elision/ref-mut-struct.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-struct.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:15:9 + --> $DIR/ref-mut-struct.rs:11:9 | LL | fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_Struct<'a>(self: &'a mut Struct, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:21:9 + --> $DIR/ref-mut-struct.rs:16:9 | LL | fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn box_ref_Struct<'a>(self: Box<&'a mut Struct>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:27:9 + --> $DIR/ref-mut-struct.rs:21:9 | LL | fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn pin_ref_Struct<'a>(self: Pin<&'a mut Struct>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:33:9 + --> $DIR/ref-mut-struct.rs:26:9 | LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn box_box_ref_Struct<'a>(self: Box>, f: &'a u32) - | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-mut-struct.rs:39:9 + --> $DIR/ref-mut-struct.rs:31:9 | LL | fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-self-async.base.stderr b/src/test/ui/self/elision/ref-self-async.base.stderr deleted file mode 100644 index 2b142b089d5..00000000000 --- a/src/test/ui/self/elision/ref-self-async.base.stderr +++ /dev/null @@ -1,115 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:26:9 - | -LL | async fn ref_self(&self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:34:9 - | -LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:40:9 - | -LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:46:9 - | -LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:52:9 - | -LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:58:9 - | -LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self-async.rs:64:9 - | -LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { - | --- --- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn wrap_ref_Self_Self<'a>(self: Wrap<&'a Self, Self>, f: &'a u8) -> &u8 { - | ++++ ++ ++ - -error: aborting due to 7 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-self-async.rs b/src/test/ui/self/elision/ref-self-async.rs index afe5fe100e3..b0133ec1b61 100644 --- a/src/test/ui/self/elision/ref-self-async.rs +++ b/src/test/ui/self/elision/ref-self-async.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir #![allow(non_snake_case)] #![feature(arbitrary_self_types)] @@ -24,46 +21,39 @@ impl Struct { async fn ref_self(&self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // Test using `&Self` explicitly: async fn ref_Self(self: &Self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-self-async.nll.stderr b/src/test/ui/self/elision/ref-self-async.stderr similarity index 96% rename from src/test/ui/self/elision/ref-self-async.nll.stderr rename to src/test/ui/self/elision/ref-self-async.stderr index f4e531a817c..26ef9779be2 100644 --- a/src/test/ui/self/elision/ref-self-async.nll.stderr +++ b/src/test/ui/self/elision/ref-self-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:26:9 + --> $DIR/ref-self-async.rs:23:9 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | async fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:34:9 + --> $DIR/ref-self-async.rs:30:9 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | async fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:40:9 + --> $DIR/ref-self-async.rs:35:9 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | async fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:46:9 + --> $DIR/ref-self-async.rs:40:9 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | async fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:52:9 + --> $DIR/ref-self-async.rs:45:9 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | async fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:58:9 + --> $DIR/ref-self-async.rs:50:9 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -89,7 +89,7 @@ LL | async fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self-async.rs:64:9 + --> $DIR/ref-self-async.rs:55:9 | LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-self.base.stderr b/src/test/ui/self/elision/ref-self.base.stderr deleted file mode 100644 index 8bd194d701f..00000000000 --- a/src/test/ui/self/elision/ref-self.base.stderr +++ /dev/null @@ -1,115 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-self.rs:25:9 - | -LL | fn ref_self(&self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self.rs:33:9 - | -LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self.rs:39:9 - | -LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self.rs:45:9 - | -LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self.rs:51:9 - | -LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self.rs:57:9 - | -LL | fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-self.rs:63:9 - | -LL | fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { - | --- --- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn wrap_ref_Self_Self<'a>(self: Wrap<&'a Self, Self>, f: &'a u8) -> &u8 { - | ++++ ++ ++ - -error: aborting due to 7 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-self.rs b/src/test/ui/self/elision/ref-self.rs index 34df3da4505..dd07fe1b00b 100644 --- a/src/test/ui/self/elision/ref-self.rs +++ b/src/test/ui/self/elision/ref-self.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![feature(arbitrary_self_types)] #![allow(non_snake_case)] @@ -23,46 +19,39 @@ impl Struct { fn ref_self(&self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // Test using `&Self` explicitly: fn ref_Self(self: &Self, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-self.nll.stderr b/src/test/ui/self/elision/ref-self.stderr similarity index 96% rename from src/test/ui/self/elision/ref-self.nll.stderr rename to src/test/ui/self/elision/ref-self.stderr index c0efc35fa6c..32448f3a677 100644 --- a/src/test/ui/self/elision/ref-self.nll.stderr +++ b/src/test/ui/self/elision/ref-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-self.rs:25:9 + --> $DIR/ref-self.rs:21:9 | LL | fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:33:9 + --> $DIR/ref-self.rs:28:9 | LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:39:9 + --> $DIR/ref-self.rs:33:9 | LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:45:9 + --> $DIR/ref-self.rs:38:9 | LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:51:9 + --> $DIR/ref-self.rs:43:9 | LL | fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | fn box_box_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:57:9 + --> $DIR/ref-self.rs:48:9 | LL | fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -89,7 +89,7 @@ LL | fn box_pin_ref_Self<'a>(self: Box>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:63:9 + --> $DIR/ref-self.rs:53:9 | LL | fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-struct-async.base.stderr b/src/test/ui/self/elision/ref-struct-async.base.stderr deleted file mode 100644 index 88ddca89804..00000000000 --- a/src/test/ui/self/elision/ref-struct-async.base.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:16:9 - | -LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:22:9 - | -LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:28:9 - | -LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:34:9 - | -LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_box_ref_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct-async.rs:40:9 - | -LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | async fn box_pin_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-struct-async.rs b/src/test/ui/self/elision/ref-struct-async.rs index 12f8f6faf1b..0be74874515 100644 --- a/src/test/ui/self/elision/ref-struct-async.rs +++ b/src/test/ui/self/elision/ref-struct-async.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir #![allow(non_snake_case)] @@ -14,32 +11,27 @@ impl Struct { async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-struct-async.nll.stderr b/src/test/ui/self/elision/ref-struct-async.stderr similarity index 96% rename from src/test/ui/self/elision/ref-struct-async.nll.stderr rename to src/test/ui/self/elision/ref-struct-async.stderr index 83c20329c3d..edb5c54ab00 100644 --- a/src/test/ui/self/elision/ref-struct-async.nll.stderr +++ b/src/test/ui/self/elision/ref-struct-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:16:9 + --> $DIR/ref-struct-async.rs:13:9 | LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | async fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:22:9 + --> $DIR/ref-struct-async.rs:18:9 | LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | async fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:28:9 + --> $DIR/ref-struct-async.rs:23:9 | LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | async fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:34:9 + --> $DIR/ref-struct-async.rs:28:9 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | async fn box_box_ref_Struct<'a>(self: Box>, f: &'a u32) | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct-async.rs:40:9 + --> $DIR/ref-struct-async.rs:33:9 | LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/self/elision/ref-struct.base.stderr b/src/test/ui/self/elision/ref-struct.base.stderr deleted file mode 100644 index 5650b3788e7..00000000000 --- a/src/test/ui/self/elision/ref-struct.base.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:15:9 - | -LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:21:9 - | -LL | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:27:9 - | -LL | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:33:9 - | -LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_box_ref_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:39:9 - | -LL | fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { - | ---- ---- - | | - | this parameter and the return type are declared with different lifetimes... -LL | f - | ^ ...but data from `f` is returned here - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter and update trait if needed - | -LL | fn box_pin_Struct<'a>(self: Box>, f: &'a u32) -> &u32 { - | ++++ ++ ++ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/self/elision/ref-struct.rs b/src/test/ui/self/elision/ref-struct.rs index 0ffe72793d7..13a42cd1aed 100644 --- a/src/test/ui/self/elision/ref-struct.rs +++ b/src/test/ui/self/elision/ref-struct.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![allow(non_snake_case)] use std::pin::Pin; @@ -13,32 +9,27 @@ impl Struct { fn ref_Struct(self: &Struct, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { f - //[base]~^ ERROR lifetime mismatch - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/self/elision/ref-struct.nll.stderr b/src/test/ui/self/elision/ref-struct.stderr similarity index 96% rename from src/test/ui/self/elision/ref-struct.nll.stderr rename to src/test/ui/self/elision/ref-struct.stderr index 226923f59ff..4492ed4aafc 100644 --- a/src/test/ui/self/elision/ref-struct.nll.stderr +++ b/src/test/ui/self/elision/ref-struct.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-struct.rs:15:9 + --> $DIR/ref-struct.rs:11:9 | LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct.rs:21:9 + --> $DIR/ref-struct.rs:16:9 | LL | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct.rs:27:9 + --> $DIR/ref-struct.rs:21:9 | LL | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct.rs:33:9 + --> $DIR/ref-struct.rs:26:9 | LL | fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn box_box_ref_Struct<'a>(self: Box>, f: &'a u32) -> &u | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-struct.rs:39:9 + --> $DIR/ref-struct.rs:31:9 | LL | fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr deleted file mode 100644 index 12c7c8f9b7e..00000000000 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.base.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0515]: cannot return reference to function parameter `val` - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:25:9 - | -LL | val.use_self() - | ^^^^^^^^^^^^^^ returns a reference to data owned by the current function - -error[E0515]: cannot return reference to function parameter `val` - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:47:9 - | -LL | val.use_self() - | ^^^^^^^^^^^^^^ returns a reference to data owned by the current function - -error[E0515]: cannot return reference to function parameter `val` - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:113:9 - | -LL | val.use_self() - | ^^^^^^^^^^^^^^ returns a reference to data owned by the current function - -error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:70:13 - | -LL | fn use_it<'a>(val: Box + 'a>) -> &'a () { - | -------------------------------------- this data with lifetime `'a`... -LL | val.use_self() - | ^^^^^^^^ ...is used and required to live as long as `'static` here - | -note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:64:30 - | -LL | impl MyTrait for Box> { - | ^^^^^^^^^^^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement -LL | fn use_self(&self) -> &() { panic!() } - | -------- calling this method introduces the `impl`'s 'static` requirement -help: consider relaxing the implicit `'static` requirement - | -LL | impl MyTrait for Box + '_> { - | ++++ - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0515, E0772. -For more information about an error, try `rustc --explain E0515`. diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs index ec90a0987f0..711cbbd381a 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs +++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // FIXME: the following cases need to suggest more things to make users reach a working end state. mod bav { @@ -67,7 +63,7 @@ mod bay { impl Bar for i32 {} fn use_it<'a>(val: Box + 'a>) -> &'a () { - val.use_self() //[base]~ ERROR E0772 + val.use_self() } } diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr similarity index 91% rename from src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr rename to src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr index db790049c6f..2dc300ac76f 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr +++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr @@ -1,17 +1,17 @@ error[E0515]: cannot return reference to function parameter `val` - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:25:9 + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:21:9 | LL | val.use_self() | ^^^^^^^^^^^^^^ returns a reference to data owned by the current function error[E0515]: cannot return reference to function parameter `val` - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:47:9 + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9 | LL | val.use_self() | ^^^^^^^^^^^^^^ returns a reference to data owned by the current function error[E0515]: cannot return reference to function parameter `val` - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:113:9 + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:109:9 | LL | val.use_self() | ^^^^^^^^^^^^^^ returns a reference to data owned by the current function diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs deleted file mode 100644 index 37be629e77c..00000000000 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.rs +++ /dev/null @@ -1,118 +0,0 @@ -// FIXME(nll): On NLL stabilization, this should replace -// `impl-on-dyn-trait-with-implicit-static-bound.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll -// compile-flags: -Zborrowck=mir - -#![allow(dead_code)] - -mod foo { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &(); - } - trait Irrelevant {} - - impl MyTrait for dyn ObjectTrait { - fn use_self(&self) -> &() { panic!() } - } - impl Irrelevant for dyn ObjectTrait {} - - fn use_it<'a, T>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - val.use_self::() //~ ERROR borrowed data escapes - } -} - -mod bar { - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &(); - } - trait Irrelevant {} - - impl MyTrait for dyn ObjectTrait { - fn use_self(&self) -> &() { panic!() } - } - impl Irrelevant for dyn ObjectTrait {} - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () { - val.use_self() - } -} - -mod baz { - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &(); - } - trait Irrelevant {} - - impl MyTrait for Box { - fn use_self(&self) -> &() { panic!() } - } - impl Irrelevant for Box {} - - fn use_it<'a>(val: &'a Box) -> &'a () { - val.use_self() - } -} - -mod bat { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - - impl dyn ObjectTrait { - fn use_self(&self) -> &() { panic!() } - } - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - val.use_self() - //~^ ERROR borrowed data escapes - } -} - -mod ban { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &() { panic!() } - } - trait Irrelevant { - fn use_self(&self) -> &() { panic!() } - } - - impl MyTrait for dyn ObjectTrait {} - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> { - val.use_self() //~ ERROR borrowed data escapes - } -} - -mod bal { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &() { panic!() } - } - trait Irrelevant { - fn use_self(&self) -> &() { panic!() } - } - - impl MyTrait for dyn ObjectTrait {} - impl Irrelevant for dyn ObjectTrait {} - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - MyTrait::use_self(val) //~ ERROR borrowed data escapes - } -} - -fn main() {} diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr deleted file mode 100644 index 5d9c7077fa1..00000000000 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr +++ /dev/null @@ -1,105 +0,0 @@ -error[E0521]: borrowed data escapes outside of function - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:25:9 - | -LL | fn use_it<'a, T>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - | -- --- `val` is a reference that is only valid in the function body - | | - | lifetime `'a` defined here -LL | val.use_self::() - | ^^^^^^^^^^^^^^^^^^^ - | | - | `val` escapes the function body here - | argument requires that `'a` must outlive `'static` - | -note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:19:32 - | -LL | impl MyTrait for dyn ObjectTrait { - | ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement -LL | fn use_self(&self) -> &() { panic!() } - | -------- calling this method introduces the `impl`'s 'static` requirement -help: consider relaxing the implicit `'static` requirement - | -LL | impl MyTrait for dyn ObjectTrait + '_ { - | ++++ - -error[E0521]: borrowed data escapes outside of function - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:74:9 - | -LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - | -- --- `val` is a reference that is only valid in the function body - | | - | lifetime `'a` defined here -LL | val.use_self() - | ^^^^^^^^^^^^^^ - | | - | `val` escapes the function body here - | argument requires that `'a` must outlive `'static` - | -note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:69:14 - | -LL | impl dyn ObjectTrait { - | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement -LL | fn use_self(&self) -> &() { panic!() } - | -------- calling this method introduces the `impl`'s 'static` requirement -help: consider relaxing the implicit `'static` requirement - | -LL | impl dyn ObjectTrait + '_ { - | ++++ - -error[E0521]: borrowed data escapes outside of function - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:94:9 - | -LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> { - | -- --- `val` is a reference that is only valid in the function body - | | - | lifetime `'a` defined here -LL | val.use_self() - | ^^^^^^^^^^^^^^ - | | - | `val` escapes the function body here - | argument requires that `'a` must outlive `'static` - | -note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:91:26 - | -LL | fn use_self(&self) -> &() { panic!() } - | -------- calling this method introduces the `impl`'s 'static` requirement -... -LL | impl MyTrait for dyn ObjectTrait {} - | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement -help: consider relaxing the implicit `'static` requirement - | -LL | impl MyTrait for dyn ObjectTrait + '_ {} - | ++++ - -error[E0521]: borrowed data escapes outside of function - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:114:9 - | -LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - | -- --- `val` is a reference that is only valid in the function body - | | - | lifetime `'a` defined here -LL | MyTrait::use_self(val) - | ^^^^^^^^^^^^^^^^^^^^^^ - | | - | `val` escapes the function body here - | argument requires that `'a` must outlive `'static` - | -note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:110:26 - | -LL | fn use_self(&self) -> &() { panic!() } - | -------- calling this method introduces the `impl`'s 'static` requirement -... -LL | impl MyTrait for dyn ObjectTrait {} - | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement -help: consider relaxing the implicit `'static` requirement - | -LL | impl MyTrait for dyn ObjectTrait + '_ {} - | ++++ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0521`. diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed deleted file mode 100644 index 74da1cbfea5..00000000000 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed +++ /dev/null @@ -1,117 +0,0 @@ -// FIXME(nll): On NLL stabilization, this should be replaced by -// `impl-on-dyn-trait-with-implicit-static-bound-nll.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll - -// run-rustfix -#![allow(dead_code)] - -mod foo { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &(); - } - trait Irrelevant {} - - impl MyTrait for dyn ObjectTrait + '_ { - fn use_self(&self) -> &() { panic!() } - } - impl Irrelevant for dyn ObjectTrait {} - - fn use_it<'a, T>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - val.use_self::() //~ ERROR E0759 - } -} - -mod bar { - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &(); - } - trait Irrelevant {} - - impl MyTrait for dyn ObjectTrait + '_ { - fn use_self(&self) -> &() { panic!() } - } - impl Irrelevant for dyn ObjectTrait {} - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () { - val.use_self() //~ ERROR E0772 - } -} - -mod baz { - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &(); - } - trait Irrelevant {} - - impl MyTrait for Box { - fn use_self(&self) -> &() { panic!() } - } - impl Irrelevant for Box {} - - fn use_it<'a>(val: &'a Box) -> &'a () { - val.use_self() //~ ERROR E0772 - } -} - -mod bat { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - - impl dyn ObjectTrait + '_ { - fn use_self(&self) -> &() { panic!() } - } - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - val.use_self() //~ ERROR E0772 - } -} - -mod ban { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &() { panic!() } - } - trait Irrelevant { - fn use_self(&self) -> &() { panic!() } - } - - impl MyTrait for dyn ObjectTrait + '_ {} - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - val.use_self() //~ ERROR E0759 - } -} - -mod bal { - trait OtherTrait<'a> {} - impl<'a> OtherTrait<'a> for &'a () {} - - trait ObjectTrait {} - trait MyTrait { - fn use_self(&self) -> &() { panic!() } - } - trait Irrelevant { - fn use_self(&self) -> &() { panic!() } - } - - impl MyTrait for dyn ObjectTrait + '_ {} - impl Irrelevant for dyn ObjectTrait {} - - fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - MyTrait::use_self(val) //~ ERROR E0759 - } -} - -fn main() {} diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs index e0058b181b4..ae3cd315c83 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs +++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs @@ -1,9 +1,5 @@ -// FIXME(nll): On NLL stabilization, this should be replaced by -// `impl-on-dyn-trait-with-implicit-static-bound-nll.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll +// FIXME(#96332): We should be able to suggest a fix and automatically fix. -// run-rustfix #![allow(dead_code)] mod foo { @@ -22,7 +18,7 @@ mod foo { impl Irrelevant for dyn ObjectTrait {} fn use_it<'a, T>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - val.use_self::() //~ ERROR E0759 + val.use_self::() //~ ERROR borrowed data escapes } } @@ -39,7 +35,7 @@ mod bar { impl Irrelevant for dyn ObjectTrait {} fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () { - val.use_self() //~ ERROR E0772 + val.use_self() } } @@ -56,7 +52,7 @@ mod baz { impl Irrelevant for Box {} fn use_it<'a>(val: &'a Box) -> &'a () { - val.use_self() //~ ERROR E0772 + val.use_self() } } @@ -71,7 +67,8 @@ mod bat { } fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - val.use_self() //~ ERROR E0772 + val.use_self() + //~^ ERROR borrowed data escapes } } @@ -90,7 +87,7 @@ mod ban { impl MyTrait for dyn ObjectTrait {} fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> { - val.use_self() //~ ERROR E0759 + val.use_self() //~ ERROR borrowed data escapes } } @@ -110,7 +107,7 @@ mod bal { impl Irrelevant for dyn ObjectTrait {} fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - MyTrait::use_self(val) //~ ERROR E0759 + MyTrait::use_self(val) //~ ERROR borrowed data escapes } } diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr index fbe7ac94a0a..679ebd61ead 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr +++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr @@ -1,13 +1,18 @@ -error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:25:13 +error[E0521]: borrowed data escapes outside of function + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:21:9 | LL | fn use_it<'a, T>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - | ---------------------- this data with lifetime `'a`... + | -- --- `val` is a reference that is only valid in the function body + | | + | lifetime `'a` defined here LL | val.use_self::() - | ^^^^^^^^ ...is used and required to live as long as `'static` here + | ^^^^^^^^^^^^^^^^^^^ + | | + | `val` escapes the function body here + | argument requires that `'a` must outlive `'static` | note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:19:32 + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:15:32 | LL | impl MyTrait for dyn ObjectTrait { | ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement @@ -18,16 +23,21 @@ help: consider relaxing the implicit `'static` requirement LL | impl MyTrait for dyn ObjectTrait + '_ { | ++++ -error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:74:13 +error[E0521]: borrowed data escapes outside of function + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:70:9 | LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - | ------------------- this data with lifetime `'a`... + | -- --- `val` is a reference that is only valid in the function body + | | + | lifetime `'a` defined here LL | val.use_self() - | ^^^^^^^^ ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the inherent `impl` + | ^^^^^^^^^^^^^^ + | | + | `val` escapes the function body here + | argument requires that `'a` must outlive `'static` | note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:14 + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:65:14 | LL | impl dyn ObjectTrait { | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement @@ -38,46 +48,21 @@ help: consider relaxing the implicit `'static` requirement LL | impl dyn ObjectTrait + '_ { | ++++ -error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:93:13 +error[E0521]: borrowed data escapes outside of function + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:90:9 | LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> { - | ------------------- this data with lifetime `'a`... + | -- --- `val` is a reference that is only valid in the function body + | | + | lifetime `'a` defined here LL | val.use_self() - | ^^^^^^^^ ...is used and required to live as long as `'static` here + | ^^^^^^^^^^^^^^ + | | + | `val` escapes the function body here + | argument requires that `'a` must outlive `'static` | note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:90:26 - | -LL | fn use_self(&self) -> &() { panic!() } - | -------- calling this method introduces the `impl`'s 'static` requirement -... -LL | impl MyTrait for dyn ObjectTrait {} - | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement -help: consider relaxing the implicit `'static` requirement - | -LL | impl MyTrait for dyn ObjectTrait + '_ {} - | ++++ -help: to declare that the `impl Trait` captures data from argument `val`, you can add an explicit `'a` lifetime bound - | -LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - | ++++ - -error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:113:27 - | -LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { - | ------------------- this data with lifetime `'a`... -LL | MyTrait::use_self(val) - | ^^^ ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:113:9 - | -LL | MyTrait::use_self(val) - | ^^^^^^^^^^^^^^^^^ -note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:109:26 + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:87:26 | LL | fn use_self(&self) -> &() { panic!() } | -------- calling this method introduces the `impl`'s 'static` requirement @@ -89,47 +74,32 @@ help: consider relaxing the implicit `'static` requirement LL | impl MyTrait for dyn ObjectTrait + '_ {} | ++++ -error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:42:13 +error[E0521]: borrowed data escapes outside of function + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:110:9 | -LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () { - | ------------------- this data with lifetime `'a`... -LL | val.use_self() - | ^^^^^^^^ ...is used and required to live as long as `'static` here +LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { + | -- --- `val` is a reference that is only valid in the function body + | | + | lifetime `'a` defined here +LL | MyTrait::use_self(val) + | ^^^^^^^^^^^^^^^^^^^^^^ + | | + | `val` escapes the function body here + | argument requires that `'a` must outlive `'static` | note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:36:26 + --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:106:26 | -LL | impl MyTrait for dyn ObjectTrait { - | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement LL | fn use_self(&self) -> &() { panic!() } | -------- calling this method introduces the `impl`'s 'static` requirement +... +LL | impl MyTrait for dyn ObjectTrait {} + | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement help: consider relaxing the implicit `'static` requirement | -LL | impl MyTrait for dyn ObjectTrait + '_ { +LL | impl MyTrait for dyn ObjectTrait + '_ {} | ++++ -error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:59:13 - | -LL | fn use_it<'a>(val: &'a Box) -> &'a () { - | ----------------------------- this data with lifetime `'a`... -LL | val.use_self() - | ^^^^^^^^ ...is used and required to live as long as `'static` here - | -note: the used `impl` has a `'static` requirement - --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:53:30 - | -LL | impl MyTrait for Box { - | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement -LL | fn use_self(&self) -> &() { panic!() } - | -------- calling this method introduces the `impl`'s 'static` requirement -help: consider relaxing the implicit `'static` requirement - | -LL | impl MyTrait for Box { - | ++++ +error: aborting due to 4 previous errors -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0759, E0772. -For more information about an error, try `rustc --explain E0759`. +For more information about this error, try `rustc --explain E0521`. diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr deleted file mode 100644 index 4e0e6675e5a..00000000000 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.base.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0311]: the parameter type `T` may not live long enough - --> $DIR/missing-lifetimes-in-signature-2.rs:24:9 - | -LL | foo.bar(move |_| { - | ^^^ - | -note: the parameter type `T` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature-2.rs:23:24 - | -LL | fn func(foo: &Foo, t: T) { - | ^^^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature-2.rs:24:13: 27:6]` will meet its required lifetime bounds... - --> $DIR/missing-lifetimes-in-signature-2.rs:24:9 - | -LL | foo.bar(move |_| { - | ^^^ -note: ...that is required by this bound - --> $DIR/missing-lifetimes-in-signature-2.rs:15:12 - | -LL | F: 'a, - | ^^ -help: consider adding an explicit lifetime bound... - | -LL | fn func(foo: &Foo, t: T) { - | ++++ - -error: aborting due to previous error - diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs index 3e3b4403304..c6802ac6cc7 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Regression test for #81650 struct Foo<'a> { diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr similarity index 80% rename from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr rename to src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr index 9f35175c08d..0212c2d712c 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr @@ -1,5 +1,5 @@ error[E0311]: the parameter type `T` may not live long enough - --> $DIR/missing-lifetimes-in-signature-2.rs:24:5 + --> $DIR/missing-lifetimes-in-signature-2.rs:20:5 | LL | / foo.bar(move |_| { LL | | @@ -8,12 +8,12 @@ LL | | }); | |______^ | note: the parameter type `T` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature-2.rs:23:24 + --> $DIR/missing-lifetimes-in-signature-2.rs:19:24 | LL | fn func(foo: &Foo, t: T) { | ^^^ note: ...so that the type `T` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature-2.rs:24:5 + --> $DIR/missing-lifetimes-in-signature-2.rs:20:5 | LL | / foo.bar(move |_| { LL | | diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr deleted file mode 100644 index d51d12b909d..00000000000 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.base.stderr +++ /dev/null @@ -1,114 +0,0 @@ -error[E0261]: use of undeclared lifetime name `'a` - --> $DIR/missing-lifetimes-in-signature.rs:42:11 - | -LL | fn baz(g: G, dest: &mut T) -> impl FnOnce() + '_ - | - ^^ undeclared lifetime - | | - | help: consider introducing lifetime `'a` here: `'a,` - -error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/missing-lifetimes-in-signature.rs:23:5 - | -LL | fn foo(g: G, dest: &mut T) -> impl FnOnce() - | ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:23:5: 26:6]` captures the anonymous lifetime defined here -... -LL | / move || { -LL | | -LL | | *dest = g.get(); -LL | | } - | |_____^ - | -help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound - | -LL | fn foo(g: G, dest: &mut T) -> impl FnOnce() + '_ - | ++++ - -error[E0311]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:30:37 - | -LL | fn bar(g: G, dest: &mut T) -> impl FnOnce() + '_ - | ^^^^^^^^^^^^^^^^^^ - | -note: the parameter type `G` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature.rs:30:26 - | -LL | fn bar(g: G, dest: &mut T) -> impl FnOnce() + '_ - | ^^^^^^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:35:5: 38:6]` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature.rs:30:37 - | -LL | fn bar(g: G, dest: &mut T) -> impl FnOnce() + '_ - | ^^^^^^^^^^^^^^^^^^ -help: consider introducing an explicit lifetime bound - | -LL ~ fn bar<'a, G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a -LL | -LL | where -LL ~ G: Get + 'a, - | - -error[E0311]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:53:45 - | -LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ - | ^^^^^^^^^^^^^^^^^^ - | -note: the parameter type `G` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature.rs:53:34 - | -LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ - | ^^^^^^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:58:5: 61:6]` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature.rs:53:45 - | -LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ - | ^^^^^^^^^^^^^^^^^^ -help: consider introducing an explicit lifetime bound - | -LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'b - | +++ ++++ ++++ - -error[E0311]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:66:58 - | -LL | fn qux<'b, G: Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { - | ^^^^^^^^^^^^^^^^^^ - | -note: the parameter type `G` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature.rs:66:47 - | -LL | fn qux<'b, G: Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { - | ^^^^^^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:68:9: 71:10]` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature.rs:66:58 - | -LL | fn qux<'b, G: Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { - | ^^^^^^^^^^^^^^^^^^ -help: consider introducing an explicit lifetime bound - | -LL | fn qux<'c, 'b, G: Get + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'c { - | +++ ++++ ++++ - -error[E0621]: explicit lifetime required in the type of `dest` - --> $DIR/missing-lifetimes-in-signature.rs:76:45 - | -LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a - | ------ ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required - | | - | help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T` - -error[E0309]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:89:44 - | -LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a - | ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:94:5: 97:6]` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | G: Get + 'a, - | ++++ - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0261, E0309, E0621, E0700. -For more information about an error, try `rustc --explain E0261`. diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs index 20366201269..19a791a8c43 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - pub trait Get { fn get(self) -> T; } @@ -28,12 +24,11 @@ where // After applying suggestion for `foo`: fn bar(g: G, dest: &mut T) -> impl FnOnce() + '_ -//[base]~^ ERROR the parameter type `G` may not live long enough where G: Get, { move || { - //[nll]~^ ERROR the parameter type `G` may not live long enough + //~^ ERROR the parameter type `G` may not live long enough *dest = g.get(); } } @@ -51,12 +46,11 @@ where // After applying suggestion for `baz`: fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ -//[base]~^ ERROR the parameter type `G` may not live long enough where G: Get, { move || { - //[nll]~^ ERROR the parameter type `G` may not live long enough + //~^ ERROR the parameter type `G` may not live long enough *dest = g.get(); } } @@ -64,9 +58,8 @@ where // Same as above, but show that we pay attention to lifetime names from parent item impl<'a> Foo { fn qux<'b, G: Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { - //[base]~^ ERROR the parameter type `G` may not live long enough move || { - //[nll]~^ ERROR the parameter type `G` may not live long enough + //~^ ERROR the parameter type `G` may not live long enough *dest = g.get(); } } @@ -74,25 +67,23 @@ impl<'a> Foo { // After applying suggestion for `qux`: fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a -//[base]~^ ERROR explicit lifetime required in the type of `dest` where G: Get, { move || { - //[nll]~^ ERROR the parameter type `G` may not live long enough - //[nll]~| ERROR explicit lifetime required + //~^ ERROR the parameter type `G` may not live long enough + //~| ERROR explicit lifetime required *dest = g.get(); } } // Potential incorrect attempt: fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a -//[base]~^ ERROR the parameter type `G` may not live long enough where G: Get, { move || { - //[nll]~^ ERROR the parameter type `G` may not live long enough + //~^ ERROR the parameter type `G` may not live long enough *dest = g.get(); } } diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr similarity index 83% rename from src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr rename to src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr index 63932cb6ba0..85c534364b6 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr @@ -1,5 +1,5 @@ error[E0261]: use of undeclared lifetime name `'a` - --> $DIR/missing-lifetimes-in-signature.rs:42:11 + --> $DIR/missing-lifetimes-in-signature.rs:37:11 | LL | fn baz(g: G, dest: &mut T) -> impl FnOnce() + '_ | - ^^ undeclared lifetime @@ -7,10 +7,10 @@ LL | fn baz(g: G, dest: &mut T) -> impl FnOnce() + '_ | help: consider introducing lifetime `'a` here: `'a,` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/missing-lifetimes-in-signature.rs:23:5 + --> $DIR/missing-lifetimes-in-signature.rs:19:5 | LL | fn foo(g: G, dest: &mut T) -> impl FnOnce() - | ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:23:5: 26:6]` captures the anonymous lifetime defined here + | ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 22:6]` captures the anonymous lifetime defined here ... LL | / move || { LL | | @@ -24,7 +24,7 @@ LL | fn foo(g: G, dest: &mut T) -> impl FnOnce() + '_ | ++++ error[E0311]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:35:5 + --> $DIR/missing-lifetimes-in-signature.rs:30:5 | LL | / move || { LL | | @@ -33,12 +33,12 @@ LL | | } | |_____^ | note: the parameter type `G` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature.rs:30:26 + --> $DIR/missing-lifetimes-in-signature.rs:26:26 | LL | fn bar(g: G, dest: &mut T) -> impl FnOnce() + '_ | ^^^^^^ note: ...so that the type `G` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature.rs:35:5 + --> $DIR/missing-lifetimes-in-signature.rs:30:5 | LL | / move || { LL | | @@ -51,7 +51,7 @@ LL | G: Get + 'a, | ++++ error[E0311]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:58:5 + --> $DIR/missing-lifetimes-in-signature.rs:52:5 | LL | / move || { LL | | @@ -60,12 +60,12 @@ LL | | } | |_____^ | note: the parameter type `G` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature.rs:53:34 + --> $DIR/missing-lifetimes-in-signature.rs:48:34 | LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ^^^^^^ note: ...so that the type `G` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature.rs:58:5 + --> $DIR/missing-lifetimes-in-signature.rs:52:5 | LL | / move || { LL | | @@ -78,7 +78,7 @@ LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ++++ error[E0311]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:68:9 + --> $DIR/missing-lifetimes-in-signature.rs:61:9 | LL | / move || { LL | | @@ -87,12 +87,12 @@ LL | | } | |_________^ | note: the parameter type `G` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature.rs:66:47 + --> $DIR/missing-lifetimes-in-signature.rs:60:47 | LL | fn qux<'b, G: Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { | ^^^^^^ note: ...so that the type `G` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature.rs:68:9 + --> $DIR/missing-lifetimes-in-signature.rs:61:9 | LL | / move || { LL | | @@ -105,7 +105,7 @@ LL | fn qux<'b, G: Get + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() | ++++ error[E0311]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:81:5 + --> $DIR/missing-lifetimes-in-signature.rs:73:5 | LL | / move || { LL | | @@ -115,12 +115,12 @@ LL | | } | |_____^ | note: the parameter type `G` must be valid for the anonymous lifetime defined here... - --> $DIR/missing-lifetimes-in-signature.rs:76:34 + --> $DIR/missing-lifetimes-in-signature.rs:69:34 | LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a | ^^^^^^ note: ...so that the type `G` will meet its required lifetime bounds - --> $DIR/missing-lifetimes-in-signature.rs:81:5 + --> $DIR/missing-lifetimes-in-signature.rs:73:5 | LL | / move || { LL | | @@ -134,7 +134,7 @@ LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a | ++++ error[E0621]: explicit lifetime required in the type of `dest` - --> $DIR/missing-lifetimes-in-signature.rs:81:5 + --> $DIR/missing-lifetimes-in-signature.rs:73:5 | LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a | ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T` @@ -147,7 +147,7 @@ LL | | } | |_____^ lifetime `'a` required error[E0309]: the parameter type `G` may not live long enough - --> $DIR/missing-lifetimes-in-signature.rs:94:5 + --> $DIR/missing-lifetimes-in-signature.rs:85:5 | LL | / move || { LL | | diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr deleted file mode 100644 index 0bd7f289340..00000000000 --- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.base.stderr +++ /dev/null @@ -1,95 +0,0 @@ -error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/trait-object-nested-in-impl-trait.rs:35:31 - | -LL | fn iter(&self) -> impl Iterator> { - | ----- this data with an anonymous lifetime `'_`... -... -LL | remaining: self.0.iter(), - | ------ ^^^^ - | | - | ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/trait-object-nested-in-impl-trait.rs:31:23 - | -LL | fn iter(&self) -> impl Iterator> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound - | -LL | fn iter(&self) -> impl Iterator> + '_ { - | ++++ -help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound - | -LL | fn iter(&self) -> impl Iterator> { - | ++++ - -error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/trait-object-nested-in-impl-trait.rs:48:31 - | -LL | fn iter(&self) -> impl Iterator> + '_ { - | ----- this data with an anonymous lifetime `'_`... -... -LL | remaining: self.0.iter(), - | ------ ^^^^ - | | - | ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/trait-object-nested-in-impl-trait.rs:44:23 - | -LL | fn iter(&self) -> impl Iterator> + '_ { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound - | -LL | fn iter(&self) -> impl Iterator> + '_ { - | ++++ - -error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/trait-object-nested-in-impl-trait.rs:61:31 - | -LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { - | -------- this data with lifetime `'a`... -... -LL | remaining: self.0.iter(), - | ------ ^^^^ - | | - | ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/trait-object-nested-in-impl-trait.rs:57:30 - | -LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound - | -LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { - | ++++ - -error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/trait-object-nested-in-impl-trait.rs:74:31 - | -LL | fn iter<'a>(&'a self) -> impl Iterator> { - | -------- this data with lifetime `'a`... -... -LL | remaining: self.0.iter(), - | ------ ^^^^ - | | - | ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/trait-object-nested-in-impl-trait.rs:70:30 - | -LL | fn iter<'a>(&'a self) -> impl Iterator> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'a` lifetime bound - | -LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { - | ++++ -help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound - | -LL | fn iter<'a>(&'a self) -> impl Iterator> { - | ++++ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs index 5d868a58c0f..ff27011f89e 100644 --- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs +++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo {} impl<'a, T: Foo> Foo for &'a T {} impl Foo for Box {} @@ -30,10 +26,9 @@ struct Bar(Vec>); impl Bar { fn iter(&self) -> impl Iterator> { Iter { - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough current: None, remaining: self.0.iter(), - //[base]~^ ERROR E0759 } } } @@ -43,10 +38,9 @@ struct Baz(Vec>); impl Baz { fn iter(&self) -> impl Iterator> + '_ { Iter { - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough current: None, remaining: self.0.iter(), - //[base]~^ ERROR E0759 } } } @@ -56,10 +50,9 @@ struct Bat(Vec>); impl Bat { fn iter<'a>(&'a self) -> impl Iterator> + 'a { Iter { - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough current: None, remaining: self.0.iter(), - //[base]~^ ERROR E0759 } } } @@ -69,10 +62,9 @@ struct Ban(Vec>); impl Ban { fn iter<'a>(&'a self) -> impl Iterator> { Iter { - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough current: None, remaining: self.0.iter(), - //[base]~^ ERROR E0759 } } } diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr similarity index 93% rename from src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr rename to src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr index 989f18e7182..f49876bcd3f 100644 --- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr +++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/trait-object-nested-in-impl-trait.rs:32:9 + --> $DIR/trait-object-nested-in-impl-trait.rs:28:9 | LL | fn iter(&self) -> impl Iterator> { | - let's call the lifetime of this reference `'1` @@ -7,7 +7,6 @@ LL | / Iter { LL | | LL | | current: None, LL | | remaining: self.0.iter(), -LL | | LL | | } | |_________^ returning this value requires that `'1` must outlive `'static` | @@ -21,7 +20,7 @@ LL | fn iter(&self) -> impl Iterator> { | ++++ error: lifetime may not live long enough - --> $DIR/trait-object-nested-in-impl-trait.rs:45:9 + --> $DIR/trait-object-nested-in-impl-trait.rs:40:9 | LL | fn iter(&self) -> impl Iterator> + '_ { | - let's call the lifetime of this reference `'1` @@ -29,7 +28,6 @@ LL | / Iter { LL | | LL | | current: None, LL | | remaining: self.0.iter(), -LL | | LL | | } | |_________^ returning this value requires that `'1` must outlive `'static` | @@ -39,7 +37,7 @@ LL | fn iter(&self) -> impl Iterator> + '_ { | ++++ error: lifetime may not live long enough - --> $DIR/trait-object-nested-in-impl-trait.rs:58:9 + --> $DIR/trait-object-nested-in-impl-trait.rs:52:9 | LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { | -- lifetime `'a` defined here @@ -47,7 +45,6 @@ LL | / Iter { LL | | LL | | current: None, LL | | remaining: self.0.iter(), -LL | | LL | | } | |_________^ returning this value requires that `'a` must outlive `'static` | @@ -57,7 +54,7 @@ LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { | ++++ error: lifetime may not live long enough - --> $DIR/trait-object-nested-in-impl-trait.rs:71:9 + --> $DIR/trait-object-nested-in-impl-trait.rs:64:9 | LL | fn iter<'a>(&'a self) -> impl Iterator> { | -- lifetime `'a` defined here @@ -65,7 +62,6 @@ LL | / Iter { LL | | LL | | current: None, LL | | remaining: self.0.iter(), -LL | | LL | | } | |_________^ returning this value requires that `'a` must outlive `'static` | diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed b/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed deleted file mode 100644 index c363cc2d0e1..00000000000 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.fixed +++ /dev/null @@ -1,24 +0,0 @@ -// FIXME(nll): On NLL stabilization, this should be replace -// `suggest-impl-trait-lifetime.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll -// compile-flags: -Zborrowck=mir - -// run-rustfix - -use std::fmt::Debug; - -fn foo(d: impl Debug + 'static) { -//~^ HELP consider adding an explicit lifetime bound... - bar(d); -//~^ ERROR the parameter type `impl Debug` may not live long enough -//~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds -} - -fn bar(d: impl Debug + 'static) { - println!("{:?}", d) -} - -fn main() { - foo("hi"); -} diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs b/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs deleted file mode 100644 index dd275f6630b..00000000000 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.rs +++ /dev/null @@ -1,24 +0,0 @@ -// FIXME(nll): On NLL stabilization, this should be replace -// `suggest-impl-trait-lifetime.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll -// compile-flags: -Zborrowck=mir - -// run-rustfix - -use std::fmt::Debug; - -fn foo(d: impl Debug) { -//~^ HELP consider adding an explicit lifetime bound... - bar(d); -//~^ ERROR the parameter type `impl Debug` may not live long enough -//~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds -} - -fn bar(d: impl Debug + 'static) { - println!("{:?}", d) -} - -fn main() { - foo("hi"); -} diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr deleted file mode 100644 index 41226fdf9fe..00000000000 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime-nll.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0310]: the parameter type `impl Debug` may not live long enough - --> $DIR/suggest-impl-trait-lifetime-nll.rs:13:5 - | -LL | bar(d); - | ^^^^^^ ...so that the type `impl Debug` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn foo(d: impl Debug + 'static) { - | +++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed index 75ff26c0435..589ee1a474a 100644 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed +++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed @@ -1,8 +1,3 @@ -// FIXME(nll): On NLL stabilization, this should be replaced by -// `suggest-impl-trait-lifetime-nll.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll - // run-rustfix use std::fmt::Debug; @@ -14,7 +9,7 @@ fn foo(d: impl Debug + 'static) { //~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds } -fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound +fn bar(d: impl Debug + 'static) { println!("{:?}", d) } diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs index b93fe103a4a..9a87129fbf2 100644 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs +++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs @@ -1,8 +1,3 @@ -// FIXME(nll): On NLL stabilization, this should be replaced by -// `suggest-impl-trait-lifetime-nll.rs`. Compiletest has -// problems with rustfix and revisions. -// ignore-compare-mode-nll - // run-rustfix use std::fmt::Debug; @@ -14,7 +9,7 @@ fn foo(d: impl Debug) { //~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds } -fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound +fn bar(d: impl Debug + 'static) { println!("{:?}", d) } diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr index 85f36ea78aa..cf912f4aac2 100644 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr +++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr @@ -1,14 +1,9 @@ error[E0310]: the parameter type `impl Debug` may not live long enough - --> $DIR/suggest-impl-trait-lifetime.rs:12:5 + --> $DIR/suggest-impl-trait-lifetime.rs:7:5 | LL | bar(d); - | ^^^ ...so that the type `impl Debug` will meet its required lifetime bounds... + | ^^^^^^ ...so that the type `impl Debug` will meet its required lifetime bounds | -note: ...that is required by this bound - --> $DIR/suggest-impl-trait-lifetime.rs:17:24 - | -LL | fn bar(d: impl Debug + 'static) { - | ^^^^^^^ help: consider adding an explicit lifetime bound... | LL | fn foo(d: impl Debug + 'static) { diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr b/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr deleted file mode 100644 index 8d1ef324c81..00000000000 --- a/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0477]: the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime - --> $DIR/supertrait-lifetime-bound.rs:14:5 - | -LL | test1::, _>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/supertrait-lifetime-bound.rs:9:22 - | -LL | fn test1, S>() { } - | ^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.rs b/src/test/ui/traits/object/supertrait-lifetime-bound.rs index a57151853e0..f929a9bb660 100644 --- a/src/test/ui/traits/object/supertrait-lifetime-bound.rs +++ b/src/test/ui/traits/object/supertrait-lifetime-bound.rs @@ -1,7 +1,3 @@ -// ignore-compare-mode-nll -// revisions: base nll -// [nll]compile-flags: -Zborrowck=mir - trait Foo: 'static { } trait Bar: Foo { } @@ -12,8 +8,7 @@ fn test2<'a>() { // Here: the type `dyn Bar<&'a u32>` references `'a`, // and so it does not outlive `'static`. test1::, _>(); - //[base]~^ ERROR the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr b/src/test/ui/traits/object/supertrait-lifetime-bound.stderr similarity index 86% rename from src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr rename to src/test/ui/traits/object/supertrait-lifetime-bound.stderr index 271c6a10998..ed2f8624357 100644 --- a/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr +++ b/src/test/ui/traits/object/supertrait-lifetime-bound.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/supertrait-lifetime-bound.rs:14:5 + --> $DIR/supertrait-lifetime-bound.rs:10:5 | LL | fn test2<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/traits/trait-upcasting/lifetime.rs b/src/test/ui/traits/trait-upcasting/lifetime.rs index 052f090102e..f029a6f081f 100644 --- a/src/test/ui/traits/trait-upcasting/lifetime.rs +++ b/src/test/ui/traits/trait-upcasting/lifetime.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-compare-mode-nll #![feature(trait_upcasting)] #![allow(incomplete_features)] diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr deleted file mode 100644 index e1831c5617f..00000000000 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-3.base.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-checking-test-3.rs:16:13 - | -LL | let _ = x as &dyn Bar<'a>; // Error - | ^ lifetime mismatch - | - = note: expected trait object `dyn Bar<'a>` - found trait object `dyn Bar<'static>` -note: the lifetime `'a` as defined here... - --> $DIR/type-checking-test-3.rs:15:16 - | -LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/type-checking-test-3.rs:22:13 - | -LL | let _ = x as &dyn Bar<'static>; // Error - | ^ lifetime mismatch - | - = note: expected trait object `dyn Bar<'static>` - found trait object `dyn Bar<'a>` -note: the lifetime `'a` as defined here... - --> $DIR/type-checking-test-3.rs:21:16 - | -LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs index 89e8821d34e..b3aa2279a30 100644 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs +++ b/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![feature(trait_upcasting)] #![allow(incomplete_features)] @@ -14,14 +10,12 @@ fn test_correct(x: &dyn Foo<'static>) { fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) { let _ = x as &dyn Bar<'a>; // Error - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn test_wrong2<'a>(x: &dyn Foo<'a>) { let _ = x as &dyn Bar<'static>; // Error - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.nll.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr similarity index 88% rename from src/test/ui/traits/trait-upcasting/type-checking-test-3.nll.stderr rename to src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr index 983027d9b16..5ad151b5092 100644 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-3.nll.stderr +++ b/src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/type-checking-test-3.rs:16:13 + --> $DIR/type-checking-test-3.rs:12:13 | LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) { | -- lifetime `'a` defined here @@ -7,7 +7,7 @@ LL | let _ = x as &dyn Bar<'a>; // Error | ^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/type-checking-test-3.rs:22:13 + --> $DIR/type-checking-test-3.rs:17:13 | LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) { | -- lifetime `'a` defined here diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr deleted file mode 100644 index c343698f27f..00000000000 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-4.base.stderr +++ /dev/null @@ -1,123 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-checking-test-4.rs:20:13 - | -LL | let _ = x as &dyn Bar<'static, 'a>; // Error - | ^ lifetime mismatch - | - = note: expected trait object `dyn Bar<'static, 'a>` - found trait object `dyn Bar<'static, 'static>` -note: the lifetime `'a` as defined here... - --> $DIR/type-checking-test-4.rs:19:16 - | -LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/type-checking-test-4.rs:26:13 - | -LL | let _ = x as &dyn Bar<'a, 'static>; // Error - | ^ lifetime mismatch - | - = note: expected trait object `dyn Bar<'a, 'static>` - found trait object `dyn Bar<'static, 'static>` -note: the lifetime `'a` as defined here... - --> $DIR/type-checking-test-4.rs:25:16 - | -LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/type-checking-test-4.rs:32:27 - | -LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ------------ this data with lifetime `'a`... -LL | let y = x as &dyn Bar<'_, '_>; - | - ^^ - | | - | ...is used here... -LL | -LL | y.get_b() // ERROR - | - ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/type-checking-test-4.rs:34:5 - | -LL | y.get_b() // ERROR - | ^^^^^^^^^ -note: `'static` lifetime requirement introduced by the return type - --> $DIR/type-checking-test-4.rs:31:48 - | -LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ^^^^^^^ `'static` requirement introduced here -... -LL | y.get_b() // ERROR - | --------- because of this returned expression - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/type-checking-test-4.rs:39:5 - | -LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ------------ this data with lifetime `'a`... -LL | <_ as Bar>::get_b(x) // ERROR - | ^^^^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/type-checking-test-4.rs:38:48 - | -LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ^^^^^^^ `'static` requirement introduced here -LL | <_ as Bar>::get_b(x) // ERROR - | -------------------- because of this returned expression - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/type-checking-test-4.rs:45:15 - | -LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ------------ this data with lifetime `'a`... -LL | <_ as Bar<'_, '_>>::get_b(x) // ERROR - | ----------^^------------- ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/type-checking-test-4.rs:44:48 - | -LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ^^^^^^^ `'static` requirement introduced here -LL | <_ as Bar<'_, '_>>::get_b(x) // ERROR - | ---------------------------- because of this returned expression - -error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/type-checking-test-4.rs:51:27 - | -LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ------------ this data with lifetime `'a`... -LL | let y = x as &dyn Bar<'_, '_>; - | - ^^ - | | - | ...is used here... -LL | -LL | y.get_b(); // ERROR - | - ...is used here... -LL | let z = y; -LL | z.get_b() // ERROR - | - ...is used here... - | -note: ...and is required to live as long as `'static` here - --> $DIR/type-checking-test-4.rs:55:5 - | -LL | z.get_b() // ERROR - | ^^^^^^^^^ -note: `'static` lifetime requirement introduced by the return type - --> $DIR/type-checking-test-4.rs:50:48 - | -LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { - | ^^^^^^^ `'static` requirement introduced here -... -LL | z.get_b() // ERROR - | --------- because of this returned expression - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0308, E0759. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs index 575d60a5e56..70ccc87fc3e 100644 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs +++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs @@ -1,7 +1,3 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![feature(trait_upcasting)] #![allow(incomplete_features)] @@ -18,42 +14,36 @@ fn test_correct(x: &dyn Foo<'static>) { fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) { let _ = x as &dyn Bar<'static, 'a>; // Error - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) { let _ = x as &dyn Bar<'a, 'static>; // Error - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { let y = x as &dyn Bar<'_, '_>; - //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement y.get_b() // ERROR - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { <_ as Bar>::get_b(x) // ERROR - //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { <_ as Bar<'_, '_>>::get_b(x) // ERROR - //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { let y = x as &dyn Bar<'_, '_>; - //[base]~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement y.get_b(); // ERROR let z = y; z.get_b() // ERROR - //[nll]~^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.nll.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr similarity index 88% rename from src/test/ui/traits/trait-upcasting/type-checking-test-4.nll.stderr rename to src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr index 9b69bab56ae..436129d0bee 100644 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-4.nll.stderr +++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/type-checking-test-4.rs:20:13 + --> $DIR/type-checking-test-4.rs:16:13 | LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) { | -- lifetime `'a` defined here @@ -7,7 +7,7 @@ LL | let _ = x as &dyn Bar<'static, 'a>; // Error | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/type-checking-test-4.rs:26:13 + --> $DIR/type-checking-test-4.rs:21:13 | LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) { | -- lifetime `'a` defined here @@ -15,16 +15,16 @@ LL | let _ = x as &dyn Bar<'a, 'static>; // Error | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/type-checking-test-4.rs:34:5 + --> $DIR/type-checking-test-4.rs:27:5 | LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { | -- lifetime `'a` defined here -... +LL | let y = x as &dyn Bar<'_, '_>; LL | y.get_b() // ERROR | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/type-checking-test-4.rs:39:5 + --> $DIR/type-checking-test-4.rs:32:5 | LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { | -- lifetime `'a` defined here @@ -32,7 +32,7 @@ LL | <_ as Bar>::get_b(x) // ERROR | ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/type-checking-test-4.rs:45:5 + --> $DIR/type-checking-test-4.rs:37:5 | LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { | -- lifetime `'a` defined here @@ -40,7 +40,7 @@ LL | <_ as Bar<'_, '_>>::get_b(x) // ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/type-checking-test-4.rs:55:5 + --> $DIR/type-checking-test-4.rs:45:5 | LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { | -- lifetime `'a` defined here diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr deleted file mode 100644 index 593fb8af32f..00000000000 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error: at least one trait must be specified - --> $DIR/generic_type_does_not_live_long_enough.rs:14:24 - | -LL | type WrongGeneric = impl 'static; - | ^^^^^^^^^^^^ - -error: non-defining opaque type use in defining scope - --> $DIR/generic_type_does_not_live_long_enough.rs:10:18 - | -LL | let z: i32 = x; - | ^ - | -note: used non-generic type `&'static i32` for generic parameter - --> $DIR/generic_type_does_not_live_long_enough.rs:14:19 - | -LL | type WrongGeneric = impl 'static; - | ^ - -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/generic_type_does_not_live_long_enough.rs:18:5 - | -LL | t - | ^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn wrong_generic(t: T) -> WrongGeneric { - | +++++++++ - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs index 2ad7e615e19..cb90776472b 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs @@ -1,9 +1,5 @@ #![feature(type_alias_impl_trait)] -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn main() { let y = 42; let x = wrong_generic(&y); diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr similarity index 77% rename from src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr rename to src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr index 593fb8af32f..ba583241a69 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr @@ -1,23 +1,23 @@ error: at least one trait must be specified - --> $DIR/generic_type_does_not_live_long_enough.rs:14:24 + --> $DIR/generic_type_does_not_live_long_enough.rs:10:24 | LL | type WrongGeneric = impl 'static; | ^^^^^^^^^^^^ error: non-defining opaque type use in defining scope - --> $DIR/generic_type_does_not_live_long_enough.rs:10:18 + --> $DIR/generic_type_does_not_live_long_enough.rs:6:18 | LL | let z: i32 = x; | ^ | note: used non-generic type `&'static i32` for generic parameter - --> $DIR/generic_type_does_not_live_long_enough.rs:14:19 + --> $DIR/generic_type_does_not_live_long_enough.rs:10:19 | LL | type WrongGeneric = impl 'static; | ^ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/generic_type_does_not_live_long_enough.rs:18:5 + --> $DIR/generic_type_does_not_live_long_enough.rs:14:5 | LL | t | ^ ...so that the type `T` will meet its required lifetime bounds diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr deleted file mode 100644 index be77b60ca8f..00000000000 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `FnOnce` is not general enough - --> $DIR/issue-57611-trait-alias.rs:25:9 - | -LL | |x| x - | ^^^^^ implementation of `FnOnce` is not general enough - | - = note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`... - = note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2` - -error: aborting due to previous error - diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs index e95ddab75be..9c4e6c5496f 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs @@ -3,10 +3,6 @@ // FIXME: This should compile, but it currently doesn't // known-bug -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - #![feature(trait_alias)] #![feature(type_alias_impl_trait)] diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr similarity index 85% rename from src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr rename to src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr index f5b91567ff5..559820b1b1a 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-57611-trait-alias.rs:25:9 + --> $DIR/issue-57611-trait-alias.rs:21:9 | LL | |x| x | ^^^^^ one type is more general than the other @@ -7,13 +7,13 @@ LL | |x| x = note: expected type `for<'r> Fn<(&'r X,)>` found type `Fn<(&X,)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-57611-trait-alias.rs:25:9 + --> $DIR/issue-57611-trait-alias.rs:21:9 | LL | |x| x | ^^^^^ error: implementation of `FnOnce` is not general enough - --> $DIR/issue-57611-trait-alias.rs:25:9 + --> $DIR/issue-57611-trait-alias.rs:21:9 | LL | |x| x | ^^^^^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/unboxed-closures/issue-30906.base.stderr b/src/test/ui/unboxed-closures/issue-30906.base.stderr deleted file mode 100644 index 5d555a9c5e4..00000000000 --- a/src/test/ui/unboxed-closures/issue-30906.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `FnOnce` is not general enough - --> $DIR/issue-30906.rs:22:5 - | -LL | test(Compose(f, |_| {})); - | ^^^^ implementation of `FnOnce` is not general enough - | - = note: `fn(&'2 str) -> T` must implement `FnOnce<(&'1 str,)>`, for any lifetime `'1`... - = note: ...but it actually implements `FnOnce<(&'2 str,)>`, for some specific lifetime `'2` - -error: aborting due to previous error - diff --git a/src/test/ui/unboxed-closures/issue-30906.rs b/src/test/ui/unboxed-closures/issue-30906.rs index 1fd3a7f97de..e2d219e4703 100644 --- a/src/test/ui/unboxed-closures/issue-30906.rs +++ b/src/test/ui/unboxed-closures/issue-30906.rs @@ -1,9 +1,5 @@ #![feature(fn_traits, unboxed_closures)] -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn test FnOnce<(&'x str,)>>(_: F) {} struct Compose(F, G); diff --git a/src/test/ui/unboxed-closures/issue-30906.nll.stderr b/src/test/ui/unboxed-closures/issue-30906.stderr similarity index 92% rename from src/test/ui/unboxed-closures/issue-30906.nll.stderr rename to src/test/ui/unboxed-closures/issue-30906.stderr index 333e8e17821..147a2097473 100644 --- a/src/test/ui/unboxed-closures/issue-30906.nll.stderr +++ b/src/test/ui/unboxed-closures/issue-30906.stderr @@ -1,5 +1,5 @@ error: implementation of `FnOnce` is not general enough - --> $DIR/issue-30906.rs:22:5 + --> $DIR/issue-30906.rs:18:5 | LL | test(Compose(f, |_| {})); | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr deleted file mode 100644 index ebd14c64298..00000000000 --- a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.base.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:21:15 - | -LL | x.set(y); - | ^ - | -note: ...the reference is valid for the anonymous lifetime #2 defined here... - --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:20:14 - | -LL | doit(0, &|x, y| { - | ______________^ -LL | | x.set(y); -LL | | -LL | | -LL | | }); - | |_____^ -note: ...but the borrowed content is only valid for the anonymous lifetime #3 defined here - --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:20:14 - | -LL | doit(0, &|x, y| { - | ______________^ -LL | | x.set(y); -LL | | -LL | | -LL | | }); - | |_____^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs index 288349e4456..6765da42132 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs +++ b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs @@ -3,10 +3,6 @@ // That a closure whose expected argument types include two distinct // bound regions. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::cell::Cell; fn doit(val: T, f: &F) @@ -19,7 +15,6 @@ fn doit(val: T, f: &F) pub fn main() { doit(0, &|x, y| { x.set(y); - //[base]~^ ERROR E0312 - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough }); } diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr similarity index 96% rename from src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr rename to src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr index aeeee6e5003..e97157b8398 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:21:9 + --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:17:9 | LL | doit(0, &|x, y| { | - - has type `&'1 i32` diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr deleted file mode 100644 index 07357795010..00000000000 --- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.base.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0759]: `items` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/dyn-trait-underscore.rs:12:20 - | -LL | fn a(items: &[T]) -> Box> { - | ---- this data with an anonymous lifetime `'_`... -LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static` -LL | Box::new(items.iter()) - | ----- ^^^^ - | | - | ...is used and required to live as long as `'static` here - | -note: `'static` lifetime requirement introduced by the return type - --> $DIR/dyn-trait-underscore.rs:10:29 - | -LL | fn a(items: &[T]) -> Box> { - | ^^^^^^^^^^^^^^^^^^^^^ `'static` requirement introduced here -LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static` -LL | Box::new(items.iter()) - | ---------------------- because of this returned expression -help: to declare that the trait object captures data from argument `items`, you can add an explicit `'_` lifetime bound - | -LL | fn a(items: &[T]) -> Box + '_> { - | ++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0759`. diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs b/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs index 7110d432210..fa6e65c7d2e 100644 --- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs +++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs @@ -3,15 +3,10 @@ // // cc #48468 -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn a(items: &[T]) -> Box> { // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static` Box::new(items.iter()) - //[base]~^ ERROR E0759 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn b(items: &[T]) -> Box + '_> { diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr similarity index 94% rename from src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr rename to src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr index 0ffb77cf021..60b0b3ee7ba 100644 --- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr +++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/dyn-trait-underscore.rs:12:5 + --> $DIR/dyn-trait-underscore.rs:8:5 | LL | fn a(items: &[T]) -> Box> { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr deleted file mode 100644 index 2581911f5ce..00000000000 --- a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.base.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/underscore-lifetime-elison-mismatch.rs:5:49 - | -LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } - | ------ ------ ^ ...but data from `y` flows into `x` here - | | - | these two types are declared with different lifetimes... - | - = note: each elided lifetime in input position becomes a distinct lifetime -help: consider introducing a named lifetime parameter - | -LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } - | ++++ ~~ ~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs index 6d495138da9..c611268849a 100644 --- a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs +++ b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs @@ -1,9 +1,4 @@ -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } -//[base]~^ ERROR lifetime mismatch -//[nll]~^^ ERROR lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn main() {} diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr similarity index 91% rename from src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr rename to src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr index a4dece320ec..2b34f0c555a 100644 --- a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr +++ b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/underscore-lifetime-elison-mismatch.rs:5:42 + --> $DIR/underscore-lifetime-elison-mismatch.rs:1:42 | LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` diff --git a/src/test/ui/variance/variance-associated-types2.base.stderr b/src/test/ui/variance/variance-associated-types2.base.stderr deleted file mode 100644 index c8ace084871..00000000000 --- a/src/test/ui/variance/variance-associated-types2.base.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-associated-types2.rs:17:42 - | -LL | let _: Box> = make(); - | ^^^^^^ lifetime mismatch - | - = note: expected trait object `dyn Foo` - found trait object `dyn Foo` -note: the lifetime `'a` as defined here... - --> $DIR/variance-associated-types2.rs:16:9 - | -LL | fn take<'a>(_: &'a u32) { - | ^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-associated-types2.rs b/src/test/ui/variance/variance-associated-types2.rs index e3c8e6d7ca2..e487eefea63 100644 --- a/src/test/ui/variance/variance-associated-types2.rs +++ b/src/test/ui/variance/variance-associated-types2.rs @@ -1,10 +1,6 @@ // Test that dyn Foo is invariant with respect to T. // Failure to enforce invariance here can be weaponized, see #71550 for details. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo { type Bar; } @@ -15,8 +11,7 @@ fn make() -> Box> { fn take<'a>(_: &'a u32) { let _: Box> = make(); - //[base]~^ ERROR mismatched types [E0308] - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/variance/variance-associated-types2.nll.stderr b/src/test/ui/variance/variance-associated-types2.stderr similarity index 87% rename from src/test/ui/variance/variance-associated-types2.nll.stderr rename to src/test/ui/variance/variance-associated-types2.stderr index b74c4009692..35871c1236f 100644 --- a/src/test/ui/variance/variance-associated-types2.nll.stderr +++ b/src/test/ui/variance/variance-associated-types2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-associated-types2.rs:17:12 + --> $DIR/variance-associated-types2.rs:13:12 | LL | fn take<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/variance/variance-btree-invariant-types.base.stderr b/src/test/ui/variance/variance-btree-invariant-types.base.stderr deleted file mode 100644 index 5b78f4252b3..00000000000 --- a/src/test/ui/variance/variance-btree-invariant-types.base.stderr +++ /dev/null @@ -1,243 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:8:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::IterMut<'_, &'new (), _>` - found struct `std::collections::btree_map::IterMut<'_, &'static (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:7:21 - | -LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:13:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::IterMut<'_, _, &'new ()>` - found struct `std::collections::btree_map::IterMut<'_, _, &'static ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:12:21 - | -LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:18:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::IterMut<'_, &'static (), _>` - found struct `std::collections::btree_map::IterMut<'_, &'new (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:17:24 - | -LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:23:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::IterMut<'_, _, &'static ()>` - found struct `std::collections::btree_map::IterMut<'_, _, &'new ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:22:24 - | -LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:29:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `RangeMut<'_, &'new (), _>` - found struct `RangeMut<'_, &'static (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:28:22 - | -LL | fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:34:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `RangeMut<'_, _, &'new ()>` - found struct `RangeMut<'_, _, &'static ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:33:22 - | -LL | fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:39:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `RangeMut<'_, &'static (), _>` - found struct `RangeMut<'_, &'new (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:38:25 - | -LL | fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:44:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `RangeMut<'_, _, &'static ()>` - found struct `RangeMut<'_, _, &'new ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:43:25 - | -LL | fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> { - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:51:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` - found struct `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:49:20 - | -LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:57:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` - found struct `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:55:20 - | -LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:63:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` - found struct `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:61:23 - | -LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:69:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` - found struct `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:67:23 - | -LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:76:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::VacantEntry<'_, &'new (), _>` - found struct `std::collections::btree_map::VacantEntry<'_, &'static (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:74:20 - | -LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:82:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` - found struct `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:80:20 - | -LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:88:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::VacantEntry<'_, &'static (), _>` - found struct `std::collections::btree_map::VacantEntry<'_, &'new (), _>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:86:23 - | -LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error[E0308]: mismatched types - --> $DIR/variance-btree-invariant-types.rs:94:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` - found struct `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` -note: the lifetime `'new` as defined here... - --> $DIR/variance-btree-invariant-types.rs:92:23 - | -LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) - | ^^^^ - = note: ...does not necessarily outlive the static lifetime - -error: aborting due to 16 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-btree-invariant-types.rs b/src/test/ui/variance/variance-btree-invariant-types.rs index 7ddf6b294a5..09c93d0013c 100644 --- a/src/test/ui/variance/variance-btree-invariant-types.rs +++ b/src/test/ui/variance/variance-btree-invariant-types.rs @@ -1,99 +1,79 @@ use std::collections::btree_map::{IterMut, OccupiedEntry, RangeMut, VacantEntry}; -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) -> OccupiedEntry<'a, &'new (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) -> OccupiedEntry<'a, (), &'new ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) -> OccupiedEntry<'a, &'static (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) -> OccupiedEntry<'a, (), &'static ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) -> VacantEntry<'a, &'new (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) -> VacantEntry<'a, (), &'new ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) -> VacantEntry<'a, &'static (), ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) -> VacantEntry<'a, (), &'static ()> { v - //[base]~^ ERROR mismatched types - //[nll]~^^ lifetime may not live long enough + //~^ lifetime may not live long enough } diff --git a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr b/src/test/ui/variance/variance-btree-invariant-types.stderr similarity index 94% rename from src/test/ui/variance/variance-btree-invariant-types.nll.stderr rename to src/test/ui/variance/variance-btree-invariant-types.stderr index 991a7b0cdf0..22d149feb4d 100644 --- a/src/test/ui/variance/variance-btree-invariant-types.nll.stderr +++ b/src/test/ui/variance/variance-btree-invariant-types.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:8:5 + --> $DIR/variance-btree-invariant-types.rs:4:5 | LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> { | ---- lifetime `'new` defined here @@ -11,7 +11,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:13:5 + --> $DIR/variance-btree-invariant-types.rs:8:5 | LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> { | ---- lifetime `'new` defined here @@ -23,7 +23,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:18:5 + --> $DIR/variance-btree-invariant-types.rs:12:5 | LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> { | ---- lifetime `'new` defined here @@ -35,7 +35,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:23:5 + --> $DIR/variance-btree-invariant-types.rs:16:5 | LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> { | ---- lifetime `'new` defined here @@ -47,7 +47,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:29:5 + --> $DIR/variance-btree-invariant-types.rs:21:5 | LL | fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> { | ---- lifetime `'new` defined here @@ -59,7 +59,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:34:5 + --> $DIR/variance-btree-invariant-types.rs:25:5 | LL | fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> { | ---- lifetime `'new` defined here @@ -71,7 +71,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:39:5 + --> $DIR/variance-btree-invariant-types.rs:29:5 | LL | fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> { | ---- lifetime `'new` defined here @@ -83,7 +83,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:44:5 + --> $DIR/variance-btree-invariant-types.rs:33:5 | LL | fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> { | ---- lifetime `'new` defined here @@ -95,7 +95,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:51:5 + --> $DIR/variance-btree-invariant-types.rs:39:5 | LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) | ---- lifetime `'new` defined here @@ -108,7 +108,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:57:5 + --> $DIR/variance-btree-invariant-types.rs:44:5 | LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) | ---- lifetime `'new` defined here @@ -121,7 +121,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:63:5 + --> $DIR/variance-btree-invariant-types.rs:49:5 | LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) | ---- lifetime `'new` defined here @@ -134,7 +134,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:69:5 + --> $DIR/variance-btree-invariant-types.rs:54:5 | LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) | ---- lifetime `'new` defined here @@ -147,7 +147,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:76:5 + --> $DIR/variance-btree-invariant-types.rs:60:5 | LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) | ---- lifetime `'new` defined here @@ -160,7 +160,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:82:5 + --> $DIR/variance-btree-invariant-types.rs:65:5 | LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) | ---- lifetime `'new` defined here @@ -173,7 +173,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:88:5 + --> $DIR/variance-btree-invariant-types.rs:70:5 | LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) | ---- lifetime `'new` defined here @@ -186,7 +186,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-btree-invariant-types.rs:94:5 + --> $DIR/variance-btree-invariant-types.rs:75:5 | LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) | ---- lifetime `'new` defined here diff --git a/src/test/ui/variance/variance-cell-is-invariant.base.stderr b/src/test/ui/variance/variance-cell-is-invariant.base.stderr deleted file mode 100644 index e3180b6d984..00000000000 --- a/src/test/ui/variance/variance-cell-is-invariant.base.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0623]: lifetime mismatch - --> $DIR/variance-cell-is-invariant.rs:18:25 - | -LL | fn use_<'short,'long>(c: Foo<'short>, - | ----------- these two types are declared with different lifetimes... -LL | s: &'short isize, -LL | l: &'long isize, - | ------------ -LL | _where:Option<&'short &'long ()>) { -LL | let _: Foo<'long> = c; - | ^ ...but data from `c` flows into `l` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/variance/variance-cell-is-invariant.rs b/src/test/ui/variance/variance-cell-is-invariant.rs index b8b73147d0e..62ce4f91fe8 100644 --- a/src/test/ui/variance/variance-cell-is-invariant.rs +++ b/src/test/ui/variance/variance-cell-is-invariant.rs @@ -1,10 +1,6 @@ // Test that Cell is considered invariant with respect to its // type. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - use std::cell::Cell; struct Foo<'a> { @@ -16,8 +12,7 @@ fn use_<'short,'long>(c: Foo<'short>, l: &'long isize, _where:Option<&'short &'long ()>) { let _: Foo<'long> = c; - //[base]~^ ERROR E0623 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/variance/variance-cell-is-invariant.nll.stderr b/src/test/ui/variance/variance-cell-is-invariant.stderr similarity index 93% rename from src/test/ui/variance/variance-cell-is-invariant.nll.stderr rename to src/test/ui/variance/variance-cell-is-invariant.stderr index c2e93d99c43..ab5435d1656 100644 --- a/src/test/ui/variance/variance-cell-is-invariant.nll.stderr +++ b/src/test/ui/variance/variance-cell-is-invariant.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-cell-is-invariant.rs:18:12 + --> $DIR/variance-cell-is-invariant.rs:14:12 | LL | fn use_<'short,'long>(c: Foo<'short>, | ------ ----- lifetime `'long` defined here diff --git a/src/test/ui/variance/variance-contravariant-arg-object.base.stderr b/src/test/ui/variance/variance-contravariant-arg-object.base.stderr deleted file mode 100644 index 19b8b9d5aa0..00000000000 --- a/src/test/ui/variance/variance-contravariant-arg-object.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-contravariant-arg-object.rs:18:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected trait object `dyn Get<&'min i32>` - found trait object `dyn Get<&'max i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-contravariant-arg-object.rs:14:21 - | -LL | fn get_min_from_max<'min, 'max>(v: Box>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-contravariant-arg-object.rs:14:27 - | -LL | fn get_min_from_max<'min, 'max>(v: Box>) - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-contravariant-arg-object.rs:28:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected trait object `dyn Get<&'max i32>` - found trait object `dyn Get<&'min i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-contravariant-arg-object.rs:23:21 - | -LL | fn get_max_from_min<'min, 'max, G>(v: Box>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-contravariant-arg-object.rs:23:27 - | -LL | fn get_max_from_min<'min, 'max, G>(v: Box>) - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-contravariant-arg-object.rs b/src/test/ui/variance/variance-contravariant-arg-object.rs index dab42c35218..e7e24e16731 100644 --- a/src/test/ui/variance/variance-contravariant-arg-object.rs +++ b/src/test/ui/variance/variance-contravariant-arg-object.rs @@ -3,10 +3,6 @@ // Test that even when `T` is only used in contravariant position, it // is treated as invariant. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get : 'static { fn get(&self, t: T); } @@ -16,8 +12,7 @@ fn get_min_from_max<'min, 'max>(v: Box>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>(v: Box>) @@ -26,8 +21,7 @@ fn get_max_from_min<'min, 'max, G>(v: Box>) { // Previously OK: v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr b/src/test/ui/variance/variance-contravariant-arg-object.stderr similarity index 89% rename from src/test/ui/variance/variance-contravariant-arg-object.nll.stderr rename to src/test/ui/variance/variance-contravariant-arg-object.stderr index 4071a41703e..162ec3a3f1e 100644 --- a/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr +++ b/src/test/ui/variance/variance-contravariant-arg-object.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-contravariant-arg-object.rs:18:5 + --> $DIR/variance-contravariant-arg-object.rs:14:5 | LL | fn get_min_from_max<'min, 'max>(v: Box>) | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | v = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-contravariant-arg-object.rs:28:5 + --> $DIR/variance-contravariant-arg-object.rs:23:5 | LL | fn get_max_from_min<'min, 'max, G>(v: Box>) | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr b/src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr deleted file mode 100644 index 56cf8459010..00000000000 --- a/src/test/ui/variance/variance-contravariant-arg-trait-match.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-contravariant-arg-trait-match.rs:17:5 - | -LL | impls_get::() - | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `Get<&'min i32>` - found type `Get<&'max i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-contravariant-arg-trait-match.rs:14:21 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-contravariant-arg-trait-match.rs:14:27 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-contravariant-arg-trait-match.rs:27:5 - | -LL | impls_get::() - | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `Get<&'max i32>` - found type `Get<&'min i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-contravariant-arg-trait-match.rs:22:21 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-contravariant-arg-trait-match.rs:22:27 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.rs b/src/test/ui/variance/variance-contravariant-arg-trait-match.rs index 11513d5411c..e0b28010561 100644 --- a/src/test/ui/variance/variance-contravariant-arg-trait-match.rs +++ b/src/test/ui/variance/variance-contravariant-arg-trait-match.rs @@ -3,10 +3,6 @@ // Test that even when `T` is only used in contravariant position, it // is treated as invariant. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get { fn get(&self, t: T); } @@ -15,8 +11,7 @@ fn get_min_from_max<'min, 'max, G>() where 'max : 'min, G : Get<&'max i32> { impls_get::() - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>() @@ -25,8 +20,7 @@ fn get_max_from_min<'min, 'max, G>() // Previously OK, but now an error because traits are invariant: impls_get::() - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn impls_get() where G : Get { } diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr similarity index 88% rename from src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr rename to src/test/ui/variance/variance-contravariant-arg-trait-match.stderr index 6ca8f5ed4cc..df9d93907cf 100644 --- a/src/test/ui/variance/variance-contravariant-arg-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-contravariant-arg-trait-match.rs:17:5 + --> $DIR/variance-contravariant-arg-trait-match.rs:13:5 | LL | fn get_min_from_max<'min, 'max, G>() | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | impls_get::() = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-contravariant-arg-trait-match.rs:27:5 + --> $DIR/variance-contravariant-arg-trait-match.rs:22:5 | LL | fn get_max_from_min<'min, 'max, G>() | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr b/src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr deleted file mode 100644 index 2ccab2ee5f0..00000000000 --- a/src/test/ui/variance/variance-contravariant-self-trait-match.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-contravariant-self-trait-match.rs:17:5 - | -LL | impls_get::<&'min G>(); - | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `<&'min G as Get>` - found type `<&'max G as Get>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-contravariant-self-trait-match.rs:14:21 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-contravariant-self-trait-match.rs:14:27 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-contravariant-self-trait-match.rs:28:5 - | -LL | impls_get::<&'max G>(); - | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `<&'max G as Get>` - found type `<&'min G as Get>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-contravariant-self-trait-match.rs:22:21 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-contravariant-self-trait-match.rs:22:27 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.rs b/src/test/ui/variance/variance-contravariant-self-trait-match.rs index f8d7c68fafe..8a10554f30c 100644 --- a/src/test/ui/variance/variance-contravariant-self-trait-match.rs +++ b/src/test/ui/variance/variance-contravariant-self-trait-match.rs @@ -3,10 +3,6 @@ // Test that even when `Self` is only used in contravariant position, it // is treated as invariant. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get { fn get(&self); } @@ -15,8 +11,7 @@ fn get_min_from_max<'min, 'max, G>() where 'max : 'min, G : 'max, &'max G : Get { impls_get::<&'min G>(); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>() @@ -26,8 +21,7 @@ fn get_max_from_min<'min, 'max, G>() // respect to all inputs. impls_get::<&'max G>(); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn impls_get() where G : Get { } diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-contravariant-self-trait-match.stderr similarity index 87% rename from src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr rename to src/test/ui/variance/variance-contravariant-self-trait-match.stderr index d2c549b1f71..bfea1b1b380 100644 --- a/src/test/ui/variance/variance-contravariant-self-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-contravariant-self-trait-match.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-contravariant-self-trait-match.rs:17:5 + --> $DIR/variance-contravariant-self-trait-match.rs:13:5 | LL | fn get_min_from_max<'min, 'max, G>() | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | impls_get::<&'min G>(); = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-contravariant-self-trait-match.rs:28:5 + --> $DIR/variance-contravariant-self-trait-match.rs:23:5 | LL | fn get_max_from_min<'min, 'max, G>() | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-covariant-arg-object.base.stderr b/src/test/ui/variance/variance-covariant-arg-object.base.stderr deleted file mode 100644 index 3a97875fe0e..00000000000 --- a/src/test/ui/variance/variance-covariant-arg-object.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-covariant-arg-object.rs:19:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected trait object `dyn Get<&'min i32>` - found trait object `dyn Get<&'max i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-covariant-arg-object.rs:14:21 - | -LL | fn get_min_from_max<'min, 'max>(v: Box>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-covariant-arg-object.rs:14:27 - | -LL | fn get_min_from_max<'min, 'max>(v: Box>) - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-covariant-arg-object.rs:28:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected trait object `dyn Get<&'max i32>` - found trait object `dyn Get<&'min i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-covariant-arg-object.rs:24:21 - | -LL | fn get_max_from_min<'min, 'max, G>(v: Box>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-covariant-arg-object.rs:24:27 - | -LL | fn get_max_from_min<'min, 'max, G>(v: Box>) - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-covariant-arg-object.rs b/src/test/ui/variance/variance-covariant-arg-object.rs index 20f74a3987e..129cf054a3c 100644 --- a/src/test/ui/variance/variance-covariant-arg-object.rs +++ b/src/test/ui/variance/variance-covariant-arg-object.rs @@ -3,10 +3,6 @@ // Test that even when `T` is only used in covariant position, it // is treated as invariant. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get : 'static { fn get(&self) -> T; } @@ -17,8 +13,7 @@ fn get_min_from_max<'min, 'max>(v: Box>) { // Previously OK, now an error as traits are invariant. v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>(v: Box>) @@ -26,8 +21,7 @@ fn get_max_from_min<'min, 'max, G>(v: Box>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/variance/variance-covariant-arg-object.nll.stderr b/src/test/ui/variance/variance-covariant-arg-object.stderr similarity index 90% rename from src/test/ui/variance/variance-covariant-arg-object.nll.stderr rename to src/test/ui/variance/variance-covariant-arg-object.stderr index 1b2ec61825f..f73418509ba 100644 --- a/src/test/ui/variance/variance-covariant-arg-object.nll.stderr +++ b/src/test/ui/variance/variance-covariant-arg-object.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-covariant-arg-object.rs:19:5 + --> $DIR/variance-covariant-arg-object.rs:15:5 | LL | fn get_min_from_max<'min, 'max>(v: Box>) | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | v = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-covariant-arg-object.rs:28:5 + --> $DIR/variance-covariant-arg-object.rs:23:5 | LL | fn get_max_from_min<'min, 'max, G>(v: Box>) | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr b/src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr deleted file mode 100644 index 1749a871230..00000000000 --- a/src/test/ui/variance/variance-covariant-arg-trait-match.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-covariant-arg-trait-match.rs:18:5 - | -LL | impls_get::() - | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `Get<&'min i32>` - found type `Get<&'max i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-covariant-arg-trait-match.rs:14:21 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-covariant-arg-trait-match.rs:14:27 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-covariant-arg-trait-match.rs:26:5 - | -LL | impls_get::() - | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `Get<&'max i32>` - found type `Get<&'min i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-covariant-arg-trait-match.rs:23:21 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-covariant-arg-trait-match.rs:23:27 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.rs b/src/test/ui/variance/variance-covariant-arg-trait-match.rs index d3d66d3fc4b..68dd449d567 100644 --- a/src/test/ui/variance/variance-covariant-arg-trait-match.rs +++ b/src/test/ui/variance/variance-covariant-arg-trait-match.rs @@ -3,10 +3,6 @@ // Test that even when `T` is only used in covariant position, it // is treated as invariant. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get { fn get(&self) -> T; } @@ -16,16 +12,14 @@ fn get_min_from_max<'min, 'max, G>() { // Previously OK, now an error as traits are invariant. impls_get::() - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>() where 'max : 'min, G : Get<&'min i32> { impls_get::() - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn impls_get() where G : Get { } diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-covariant-arg-trait-match.stderr similarity index 89% rename from src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr rename to src/test/ui/variance/variance-covariant-arg-trait-match.stderr index 74d2745cbbe..4c7b6cf7ce9 100644 --- a/src/test/ui/variance/variance-invariant-arg-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-covariant-arg-trait-match.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-invariant-arg-trait-match.rs:14:5 + --> $DIR/variance-covariant-arg-trait-match.rs:14:5 | LL | fn get_min_from_max<'min, 'max, G>() | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | impls_get::() = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-invariant-arg-trait-match.rs:22:5 + --> $DIR/variance-covariant-arg-trait-match.rs:21:5 | LL | fn get_max_from_min<'min, 'max, G>() | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.base.stderr b/src/test/ui/variance/variance-covariant-self-trait-match.base.stderr deleted file mode 100644 index 94afc010e21..00000000000 --- a/src/test/ui/variance/variance-covariant-self-trait-match.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-covariant-self-trait-match.rs:18:5 - | -LL | impls_get::<&'min G>(); - | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `<&'min G as Get>` - found type `<&'max G as Get>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-covariant-self-trait-match.rs:14:21 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-covariant-self-trait-match.rs:14:27 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-covariant-self-trait-match.rs:26:5 - | -LL | impls_get::<&'max G>(); - | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `<&'max G as Get>` - found type `<&'min G as Get>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-covariant-self-trait-match.rs:23:21 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-covariant-self-trait-match.rs:23:27 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.rs b/src/test/ui/variance/variance-covariant-self-trait-match.rs index ece450173ca..93c25e9808f 100644 --- a/src/test/ui/variance/variance-covariant-self-trait-match.rs +++ b/src/test/ui/variance/variance-covariant-self-trait-match.rs @@ -3,10 +3,6 @@ // Test that even when `Self` is only used in covariant position, it // is treated as invariant. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get { fn get() -> Self; } @@ -16,16 +12,14 @@ fn get_min_from_max<'min, 'max, G>() { // Previously OK, now an error as traits are invariant. impls_get::<&'min G>(); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>() where 'max : 'min, G : 'max, &'min G : Get { impls_get::<&'max G>(); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn impls_get() where G : Get { } diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-covariant-self-trait-match.stderr similarity index 88% rename from src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr rename to src/test/ui/variance/variance-covariant-self-trait-match.stderr index 14da2d2a552..9b7ba3b66b8 100644 --- a/src/test/ui/variance/variance-covariant-self-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-covariant-self-trait-match.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-covariant-self-trait-match.rs:18:5 + --> $DIR/variance-covariant-self-trait-match.rs:14:5 | LL | fn get_min_from_max<'min, 'max, G>() | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | impls_get::<&'min G>(); = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-covariant-self-trait-match.rs:26:5 + --> $DIR/variance-covariant-self-trait-match.rs:21:5 | LL | fn get_max_from_min<'min, 'max, G>() | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-invariant-arg-object.base.stderr b/src/test/ui/variance/variance-invariant-arg-object.base.stderr deleted file mode 100644 index ec9271e902f..00000000000 --- a/src/test/ui/variance/variance-invariant-arg-object.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-invariant-arg-object.rs:15:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected trait object `dyn Get<&'min i32>` - found trait object `dyn Get<&'max i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-invariant-arg-object.rs:11:21 - | -LL | fn get_min_from_max<'min, 'max>(v: Box>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-invariant-arg-object.rs:11:27 - | -LL | fn get_min_from_max<'min, 'max>(v: Box>) - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-invariant-arg-object.rs:24:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected trait object `dyn Get<&'max i32>` - found trait object `dyn Get<&'min i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-invariant-arg-object.rs:20:21 - | -LL | fn get_max_from_min<'min, 'max, G>(v: Box>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-invariant-arg-object.rs:20:27 - | -LL | fn get_max_from_min<'min, 'max, G>(v: Box>) - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-invariant-arg-object.rs b/src/test/ui/variance/variance-invariant-arg-object.rs index cc8820fbac6..4a470cc646a 100644 --- a/src/test/ui/variance/variance-invariant-arg-object.rs +++ b/src/test/ui/variance/variance-invariant-arg-object.rs @@ -1,9 +1,5 @@ #![allow(dead_code)] -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get : 'static { fn get(&self, t: T) -> T; } @@ -13,8 +9,7 @@ fn get_min_from_max<'min, 'max>(v: Box>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>(v: Box>) @@ -22,8 +17,7 @@ fn get_max_from_min<'min, 'max, G>(v: Box>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/variance/variance-invariant-arg-object.nll.stderr b/src/test/ui/variance/variance-invariant-arg-object.stderr similarity index 90% rename from src/test/ui/variance/variance-invariant-arg-object.nll.stderr rename to src/test/ui/variance/variance-invariant-arg-object.stderr index 47364f42656..8acd5417de7 100644 --- a/src/test/ui/variance/variance-invariant-arg-object.nll.stderr +++ b/src/test/ui/variance/variance-invariant-arg-object.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-invariant-arg-object.rs:15:5 + --> $DIR/variance-invariant-arg-object.rs:11:5 | LL | fn get_min_from_max<'min, 'max>(v: Box>) | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | v = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-invariant-arg-object.rs:24:5 + --> $DIR/variance-invariant-arg-object.rs:19:5 | LL | fn get_max_from_min<'min, 'max, G>(v: Box>) | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr b/src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr deleted file mode 100644 index fe284682153..00000000000 --- a/src/test/ui/variance/variance-invariant-arg-trait-match.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-invariant-arg-trait-match.rs:14:5 - | -LL | impls_get::() - | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `Get<&'min i32>` - found type `Get<&'max i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-invariant-arg-trait-match.rs:11:21 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-invariant-arg-trait-match.rs:11:27 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-invariant-arg-trait-match.rs:22:5 - | -LL | impls_get::() - | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `Get<&'max i32>` - found type `Get<&'min i32>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-invariant-arg-trait-match.rs:19:21 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-invariant-arg-trait-match.rs:19:27 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.rs b/src/test/ui/variance/variance-invariant-arg-trait-match.rs index 498dd574bb3..fbcc2438716 100644 --- a/src/test/ui/variance/variance-invariant-arg-trait-match.rs +++ b/src/test/ui/variance/variance-invariant-arg-trait-match.rs @@ -1,9 +1,5 @@ #![allow(dead_code)] -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get { fn get(&self, t: T) -> T; } @@ -12,16 +8,14 @@ fn get_min_from_max<'min, 'max, G>() where 'max : 'min, G : Get<&'max i32> { impls_get::() - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>() where 'max : 'min, G : Get<&'min i32> { impls_get::() - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn impls_get() where G : Get { } diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr b/src/test/ui/variance/variance-invariant-arg-trait-match.stderr similarity index 89% rename from src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr rename to src/test/ui/variance/variance-invariant-arg-trait-match.stderr index 870af48b3e9..60ffdd02952 100644 --- a/src/test/ui/variance/variance-covariant-arg-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-invariant-arg-trait-match.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-covariant-arg-trait-match.rs:18:5 + --> $DIR/variance-invariant-arg-trait-match.rs:10:5 | LL | fn get_min_from_max<'min, 'max, G>() | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | impls_get::() = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-covariant-arg-trait-match.rs:26:5 + --> $DIR/variance-invariant-arg-trait-match.rs:17:5 | LL | fn get_max_from_min<'min, 'max, G>() | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.base.stderr b/src/test/ui/variance/variance-invariant-self-trait-match.base.stderr deleted file mode 100644 index a2589f0ceee..00000000000 --- a/src/test/ui/variance/variance-invariant-self-trait-match.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-invariant-self-trait-match.rs:14:5 - | -LL | impls_get::<&'min G>(); - | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `<&'min G as Get>` - found type `<&'max G as Get>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-invariant-self-trait-match.rs:11:21 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-invariant-self-trait-match.rs:11:27 - | -LL | fn get_min_from_max<'min, 'max, G>() - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-invariant-self-trait-match.rs:22:5 - | -LL | impls_get::<&'max G>(); - | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch - | - = note: expected type `<&'max G as Get>` - found type `<&'min G as Get>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-invariant-self-trait-match.rs:19:21 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-invariant-self-trait-match.rs:19:27 - | -LL | fn get_max_from_min<'min, 'max, G>() - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.rs b/src/test/ui/variance/variance-invariant-self-trait-match.rs index 0f3176b14b4..95c4c24032c 100644 --- a/src/test/ui/variance/variance-invariant-self-trait-match.rs +++ b/src/test/ui/variance/variance-invariant-self-trait-match.rs @@ -1,9 +1,5 @@ #![allow(dead_code)] -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Get { fn get(&self) -> Self; } @@ -12,16 +8,14 @@ fn get_min_from_max<'min, 'max, G>() where 'max : 'min, &'max G : Get, G : 'max { impls_get::<&'min G>(); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn get_max_from_min<'min, 'max, G>() where 'max : 'min, &'min G : Get, G : 'min { impls_get::<&'max G>(); - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn impls_get() where G : Get { } diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr b/src/test/ui/variance/variance-invariant-self-trait-match.stderr similarity index 88% rename from src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr rename to src/test/ui/variance/variance-invariant-self-trait-match.stderr index 9d16e89450d..5b64bd0913a 100644 --- a/src/test/ui/variance/variance-invariant-self-trait-match.nll.stderr +++ b/src/test/ui/variance/variance-invariant-self-trait-match.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-invariant-self-trait-match.rs:14:5 + --> $DIR/variance-invariant-self-trait-match.rs:10:5 | LL | fn get_min_from_max<'min, 'max, G>() | ---- ---- lifetime `'max` defined here @@ -12,7 +12,7 @@ LL | impls_get::<&'min G>(); = help: consider adding the following bound: `'min: 'max` error: lifetime may not live long enough - --> $DIR/variance-invariant-self-trait-match.rs:22:5 + --> $DIR/variance-invariant-self-trait-match.rs:17:5 | LL | fn get_max_from_min<'min, 'max, G>() | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-trait-matching.base.stderr b/src/test/ui/variance/variance-trait-matching.base.stderr deleted file mode 100644 index 8872620e38a..00000000000 --- a/src/test/ui/variance/variance-trait-matching.base.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `get` - --> $DIR/variance-trait-matching.rs:28:5 - | -LL | fn get<'a, G>(get: &G) -> i32 - | -- help: add explicit lifetime `'a` to the type of `get`: `&'a G` -... -LL | pick(get, &22) - | ^^^^ lifetime `'a` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/variance/variance-trait-matching.rs b/src/test/ui/variance/variance-trait-matching.rs index 993db93533e..b4efee7d604 100644 --- a/src/test/ui/variance/variance-trait-matching.rs +++ b/src/test/ui/variance/variance-trait-matching.rs @@ -1,9 +1,5 @@ #![allow(dead_code)] -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - // Get is covariant in T trait Get { fn get(&self) -> T; diff --git a/src/test/ui/variance/variance-trait-matching.nll.stderr b/src/test/ui/variance/variance-trait-matching.stderr similarity index 89% rename from src/test/ui/variance/variance-trait-matching.nll.stderr rename to src/test/ui/variance/variance-trait-matching.stderr index 52c5eed3167..3308cc6d250 100644 --- a/src/test/ui/variance/variance-trait-matching.nll.stderr +++ b/src/test/ui/variance/variance-trait-matching.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `get` - --> $DIR/variance-trait-matching.rs:28:5 + --> $DIR/variance-trait-matching.rs:24:5 | LL | fn get<'a, G>(get: &G) -> i32 | -- help: add explicit lifetime `'a` to the type of `get`: `&'a G` diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr deleted file mode 100644 index a354aa52b5c..00000000000 --- a/src/test/ui/variance/variance-use-contravariant-struct-1.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-use-contravariant-struct-1.rs:14:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `SomeStruct<&'min ()>` - found struct `SomeStruct<&'max ()>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-use-contravariant-struct-1.rs:10:8 - | -LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-use-contravariant-struct-1.rs:10:13 - | -LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) - | ^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.rs b/src/test/ui/variance/variance-use-contravariant-struct-1.rs index b55f5e76775..7f59067483b 100644 --- a/src/test/ui/variance/variance-use-contravariant-struct-1.rs +++ b/src/test/ui/variance/variance-use-contravariant-struct-1.rs @@ -1,10 +1,6 @@ // Test various uses of structs with distint variances to make sure // they permit lifetimes to be approximated as expected. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct SomeStruct(fn(T)); fn foo<'min,'max>(v: SomeStruct<&'max ()>) @@ -12,8 +8,7 @@ fn foo<'min,'max>(v: SomeStruct<&'max ()>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr similarity index 88% rename from src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr rename to src/test/ui/variance/variance-use-contravariant-struct-1.stderr index 9549a8c08af..50de7c90f13 100644 --- a/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr +++ b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-use-contravariant-struct-1.rs:14:5 + --> $DIR/variance-use-contravariant-struct-1.rs:10:5 | LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.base.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.base.stderr deleted file mode 100644 index 542d44c2709..00000000000 --- a/src/test/ui/variance/variance-use-covariant-struct-1.base.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-use-covariant-struct-1.rs:14:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `SomeStruct<&'max ()>` - found struct `SomeStruct<&'min ()>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-use-covariant-struct-1.rs:10:8 - | -LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-use-covariant-struct-1.rs:10:13 - | -LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) - | ^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.rs b/src/test/ui/variance/variance-use-covariant-struct-1.rs index 3e3e76d9792..f0fd7b26e4e 100644 --- a/src/test/ui/variance/variance-use-covariant-struct-1.rs +++ b/src/test/ui/variance/variance-use-covariant-struct-1.rs @@ -1,10 +1,6 @@ // Test that a covariant struct does not permit the lifetime of a // reference to be enlarged. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct SomeStruct(T); fn foo<'min,'max>(v: SomeStruct<&'min ()>) @@ -12,8 +8,7 @@ fn foo<'min,'max>(v: SomeStruct<&'min ()>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { } diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.stderr similarity index 89% rename from src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr rename to src/test/ui/variance/variance-use-covariant-struct-1.stderr index 2fac827a0fb..bab858c5acb 100644 --- a/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr +++ b/src/test/ui/variance/variance-use-covariant-struct-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-use-covariant-struct-1.rs:14:5 + --> $DIR/variance-use-covariant-struct-1.rs:10:5 | LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.base.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.base.stderr deleted file mode 100644 index 02b4e91f781..00000000000 --- a/src/test/ui/variance/variance-use-invariant-struct-1.base.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/variance-use-invariant-struct-1.rs:14:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `SomeStruct<&'min ()>` - found struct `SomeStruct<&'max ()>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-use-invariant-struct-1.rs:10:8 - | -LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-use-invariant-struct-1.rs:10:13 - | -LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) - | ^^^^ - -error[E0308]: mismatched types - --> $DIR/variance-use-invariant-struct-1.rs:23:5 - | -LL | v - | ^ lifetime mismatch - | - = note: expected struct `SomeStruct<&'max ()>` - found struct `SomeStruct<&'min ()>` -note: the lifetime `'min` as defined here... - --> $DIR/variance-use-invariant-struct-1.rs:19:8 - | -LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) - | ^^^^ -note: ...does not necessarily outlive the lifetime `'max` as defined here - --> $DIR/variance-use-invariant-struct-1.rs:19:13 - | -LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.rs b/src/test/ui/variance/variance-use-invariant-struct-1.rs index 7be03514e01..d40dbceb5f8 100644 --- a/src/test/ui/variance/variance-use-invariant-struct-1.rs +++ b/src/test/ui/variance/variance-use-invariant-struct-1.rs @@ -1,10 +1,6 @@ // Test various uses of structs with distint variances to make sure // they permit lifetimes to be approximated as expected. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - struct SomeStruct(*mut T); fn foo<'min,'max>(v: SomeStruct<&'max ()>) @@ -12,8 +8,7 @@ fn foo<'min,'max>(v: SomeStruct<&'max ()>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn bar<'min,'max>(v: SomeStruct<&'min ()>) @@ -21,8 +16,7 @@ fn bar<'min,'max>(v: SomeStruct<&'min ()>) where 'max : 'min { v - //[base]~^ ERROR mismatched types - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.stderr similarity index 93% rename from src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr rename to src/test/ui/variance/variance-use-invariant-struct-1.stderr index e8460a388fc..b9ca6e7d596 100644 --- a/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr +++ b/src/test/ui/variance/variance-use-invariant-struct-1.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variance-use-invariant-struct-1.rs:14:5 + --> $DIR/variance-use-invariant-struct-1.rs:10:5 | LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) | ---- ---- lifetime `'max` defined here @@ -15,7 +15,7 @@ LL | v = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variance-use-invariant-struct-1.rs:23:5 + --> $DIR/variance-use-invariant-struct-1.rs:18:5 | LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) | ---- ---- lifetime `'max` defined here diff --git a/src/test/ui/wf/wf-static-method.base.stderr b/src/test/ui/wf/wf-static-method.base.stderr deleted file mode 100644 index 186ab2790a3..00000000000 --- a/src/test/ui/wf/wf-static-method.base.stderr +++ /dev/null @@ -1,136 +0,0 @@ -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/wf-static-method.rs:21:9 - | -LL | u - | ^ - | -note: ...the reference is valid for the lifetime `'a` as defined here... - --> $DIR/wf-static-method.rs:18:6 - | -LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { - | ^^ -note: ...but the borrowed content is only valid for the lifetime `'b` as defined here - --> $DIR/wf-static-method.rs:18:10 - | -LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { - | ^^ - -error[E0478]: lifetime bound not satisfied - --> $DIR/wf-static-method.rs:32:18 - | -LL | let me = Self::make_me(); - | ^^^^ - | -note: lifetime parameter instantiated with the lifetime `'b` as defined here - --> $DIR/wf-static-method.rs:29:10 - | -LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { - | ^^ -note: but lifetime parameter must outlive the lifetime `'a` as defined here - --> $DIR/wf-static-method.rs:29:6 - | -LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { - | ^^ - -error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/wf-static-method.rs:41:9 - | -LL | u - | ^ - | -note: ...the reference is valid for the lifetime `'a` as defined here... - --> $DIR/wf-static-method.rs:39:6 - | -LL | impl<'a, 'b> Evil<'a, 'b> { - | ^^ -note: ...but the borrowed content is only valid for the lifetime `'b` as defined here - --> $DIR/wf-static-method.rs:39:10 - | -LL | impl<'a, 'b> Evil<'a, 'b> { - | ^^ - -error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements - --> $DIR/wf-static-method.rs:51:5 - | -LL | <()>::static_evil(b) - | ^^^^^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/wf-static-method.rs:50:13 - | -LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/wf-static-method.rs:51:23 - | -LL | <()>::static_evil(b) - | ^ -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/wf-static-method.rs:50:9 - | -LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/wf-static-method.rs:51:5 - | -LL | <()>::static_evil(b) - | ^^^^^^^^^^^^^^^^^^^^ - -error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements - --> $DIR/wf-static-method.rs:57:5 - | -LL | ::static_evil(b) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/wf-static-method.rs:56:22 - | -LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/wf-static-method.rs:57:33 - | -LL | ::static_evil(b) - | ^ -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/wf-static-method.rs:56:18 - | -LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/wf-static-method.rs:57:5 - | -LL | ::static_evil(b) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements - --> $DIR/wf-static-method.rs:63:5 - | -LL | ::inherent_evil(b) - | ^^^^^^^^^^^^^^^^^^^^^ - | -note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/wf-static-method.rs:62:22 - | -LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/wf-static-method.rs:63:27 - | -LL | ::inherent_evil(b) - | ^ -note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/wf-static-method.rs:62:18 - | -LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 { - | ^^ -note: ...so that reference does not outlive borrowed content - --> $DIR/wf-static-method.rs:63:5 - | -LL | ::inherent_evil(b) - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0312, E0478, E0495. -For more information about an error, try `rustc --explain E0312`. diff --git a/src/test/ui/wf/wf-static-method.rs b/src/test/ui/wf/wf-static-method.rs index 83557ce667b..7ff195230bf 100644 --- a/src/test/ui/wf/wf-static-method.rs +++ b/src/test/ui/wf/wf-static-method.rs @@ -4,10 +4,6 @@ // static inherent methods isn't quite working - need to // fix that before removing the check. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - trait Foo<'a, 'b, T>: Sized { fn make_me() -> Self { loop {} } fn static_evil(u: &'b u32) -> &'a u32; @@ -19,8 +15,7 @@ impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { fn make_me() -> Self { } fn static_evil(u: &'b u32) -> &'a u32 { u - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } @@ -30,8 +25,7 @@ impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { fn make_me() -> Self { IndirectEvil(None) } fn static_evil(u: &'b u32) -> &'a u32 { let me = Self::make_me(); - //[base]~^ ERROR lifetime bound not satisfied - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough loop {} // (`me` could be used for the lifetime transmute). } } @@ -39,8 +33,7 @@ impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { impl<'a, 'b> Evil<'a, 'b> { fn inherent_evil(u: &'b u32) -> &'a u32 { u - //[base]~^ ERROR E0312 - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } @@ -49,20 +42,17 @@ impl<'a, 'b> Evil<'a, 'b> { fn evil<'a, 'b>(b: &'b u32) -> &'a u32 { <()>::static_evil(b) - //[base]~^ ERROR cannot infer an appropriate lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 { ::static_evil(b) - //[base]~^ ERROR cannot infer an appropriate lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 { ::inherent_evil(b) - //[base]~^ ERROR cannot infer an appropriate lifetime - //[nll]~^^ ERROR lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/wf/wf-static-method.nll.stderr b/src/test/ui/wf/wf-static-method.stderr similarity index 92% rename from src/test/ui/wf/wf-static-method.nll.stderr rename to src/test/ui/wf/wf-static-method.stderr index 7556d8e694d..161609a5f86 100644 --- a/src/test/ui/wf/wf-static-method.nll.stderr +++ b/src/test/ui/wf/wf-static-method.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/wf-static-method.rs:21:9 + --> $DIR/wf-static-method.rs:17:9 | LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | u = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/wf-static-method.rs:32:18 + --> $DIR/wf-static-method.rs:27:18 | LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { | -- -- lifetime `'b` defined here @@ -25,7 +25,7 @@ LL | let me = Self::make_me(); = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/wf-static-method.rs:41:9 + --> $DIR/wf-static-method.rs:35:9 | LL | impl<'a, 'b> Evil<'a, 'b> { | -- -- lifetime `'b` defined here @@ -38,7 +38,7 @@ LL | u = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/wf-static-method.rs:51:5 + --> $DIR/wf-static-method.rs:44:5 | LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 { | -- -- lifetime `'b` defined here @@ -50,7 +50,7 @@ LL | <()>::static_evil(b) = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/wf-static-method.rs:57:5 + --> $DIR/wf-static-method.rs:49:5 | LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 { | -- -- lifetime `'b` defined here @@ -62,7 +62,7 @@ LL | ::static_evil(b) = help: consider adding the following bound: `'b: 'a` error: lifetime may not live long enough - --> $DIR/wf-static-method.rs:63:5 + --> $DIR/wf-static-method.rs:54:5 | LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/where-clauses/where-for-self-2.base.stderr b/src/test/ui/where-clauses/where-for-self-2.base.stderr deleted file mode 100644 index c09610cd696..00000000000 --- a/src/test/ui/where-clauses/where-for-self-2.base.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `Bar` is not general enough - --> $DIR/where-for-self-2.rs:27:5 - | -LL | foo(&X); - | ^^^ implementation of `Bar` is not general enough - | - = note: `&'0 u32` must implement `Bar`, for any lifetime `'0`... - = note: ...but `Bar` is actually implemented for the type `&'static u32` - -error: aborting due to previous error - diff --git a/src/test/ui/where-clauses/where-for-self-2.rs b/src/test/ui/where-clauses/where-for-self-2.rs index 4e4e0ec912e..37c6954fd52 100644 --- a/src/test/ui/where-clauses/where-for-self-2.rs +++ b/src/test/ui/where-clauses/where-for-self-2.rs @@ -3,10 +3,6 @@ // specific lifetime is not enough to satisfy the `for<'a> ...` constraint, which // should require *all* lifetimes. -// revisions: base nll -// ignore-compare-mode-nll -//[nll] compile-flags: -Z borrowck=mir - static X: &'static u32 = &42; trait Bar { diff --git a/src/test/ui/where-clauses/where-for-self-2.nll.stderr b/src/test/ui/where-clauses/where-for-self-2.stderr similarity index 90% rename from src/test/ui/where-clauses/where-for-self-2.nll.stderr rename to src/test/ui/where-clauses/where-for-self-2.stderr index 92d1b2121a6..f65db78fc89 100644 --- a/src/test/ui/where-clauses/where-for-self-2.nll.stderr +++ b/src/test/ui/where-clauses/where-for-self-2.stderr @@ -1,5 +1,5 @@ error: implementation of `Bar` is not general enough - --> $DIR/where-for-self-2.rs:27:5 + --> $DIR/where-for-self-2.rs:23:5 | LL | foo(&X); | ^^^^^^^ implementation of `Bar` is not general enough diff --git a/src/tools/clippy/tests/ui/crashes/ice-6256.stderr b/src/tools/clippy/tests/ui/crashes/ice-6256.stderr index ae4e6cad332..9cfcccf1e3c 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-6256.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-6256.stderr @@ -1,18 +1,14 @@ -error[E0308]: mismatched types - --> $DIR/ice-6256.rs:13:28 +error[E0521]: borrowed data escapes outside of closure + --> $DIR/ice-6256.rs:13:26 | LL | let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types - | ^^^^ lifetime mismatch - | - = note: expected reference `&(dyn TT + 'static)` - found reference `&dyn TT` -note: the anonymous lifetime #1 defined here... - --> $DIR/ice-6256.rs:13:13 - | -LL | let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types - | ^^^^^^^^^^^^^^^^^^^^^ - = note: ...does not necessarily outlive the static lifetime + | - - ^^^^^^^^ + | | | | + | | | `x` escapes the closure body here + | | | argument requires that `'1` must outlive `'static` + | | let's call the lifetime of this reference `'1` + | `x` is a reference that is only valid in the closure body error: aborting due to previous error -For more information about this error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0521`. diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index ea13ae13208..bdf26d040ad 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -118,7 +118,6 @@ pub enum FailMode { #[derive(Clone, Debug, PartialEq)] pub enum CompareMode { - Nll, Polonius, Chalk, SplitDwarf, @@ -128,7 +127,6 @@ pub enum CompareMode { impl CompareMode { pub(crate) fn to_str(&self) -> &'static str { match *self { - CompareMode::Nll => "nll", CompareMode::Polonius => "polonius", CompareMode::Chalk => "chalk", CompareMode::SplitDwarf => "split-dwarf", @@ -138,7 +136,6 @@ impl CompareMode { pub fn parse(s: String) -> CompareMode { match s.as_str() { - "nll" => CompareMode::Nll, "polonius" => CompareMode::Polonius, "chalk" => CompareMode::Chalk, "split-dwarf" => CompareMode::SplitDwarf, diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index e6f058569db..5352f7c6fe0 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -627,7 +627,6 @@ impl Config { (name == "endian-big" && util::is_big_endian(&self.target)) || (self.remote_test_client.is_some() && name == "remote") || match self.compare_mode { - Some(CompareMode::Nll) => name == "compare-mode-nll", Some(CompareMode::Polonius) => name == "compare-mode-polonius", Some(CompareMode::Chalk) => name == "compare-mode-chalk", Some(CompareMode::SplitDwarf) => name == "compare-mode-split-dwarf", diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 494c8d771b0..84036795fbd 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1917,9 +1917,6 @@ impl<'test> TestCx<'test> { } match self.config.compare_mode { - Some(CompareMode::Nll) => { - rustc.args(&["-Zborrowck=mir"]); - } Some(CompareMode::Polonius) => { rustc.args(&["-Zpolonius", "-Zborrowck=mir"]); } @@ -3121,8 +3118,7 @@ impl<'test> TestCx<'test> { let expected_fixed = self.load_expected_output(UI_FIXED); - let modes_to_prune = vec![CompareMode::Nll]; - self.check_and_prune_duplicate_outputs(&proc_res, &[], &modes_to_prune); + self.check_and_prune_duplicate_outputs(&proc_res, &[], &[]); let mut errors = self.load_compare_outputs(&proc_res, TestOutput::Compile, explicit); let rustfix_input = json::rustfix_diagnostics_only(&proc_res.stderr); @@ -3638,12 +3634,7 @@ impl<'test> TestCx<'test> { if !path.exists() { if let Some(CompareMode::Polonius) = self.config.compare_mode { - path = expected_output_path( - &self.testpaths, - self.revision, - &Some(CompareMode::Nll), - kind, - ); + path = expected_output_path(&self.testpaths, self.revision, &None, kind); } } diff --git a/src/tools/tidy/src/error_codes_check.rs b/src/tools/tidy/src/error_codes_check.rs index 281773b0569..e56ce3329cc 100644 --- a/src/tools/tidy/src/error_codes_check.rs +++ b/src/tools/tidy/src/error_codes_check.rs @@ -10,8 +10,8 @@ use regex::Regex; // A few of those error codes can't be tested but all the others can and *should* be tested! const EXEMPTED_FROM_TEST: &[&str] = &[ - "E0279", "E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0514", "E0519", "E0523", - "E0554", "E0640", "E0717", "E0729", + "E0279", "E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0490", "E0514", "E0519", + "E0523", "E0554", "E0640", "E0717", "E0729", ]; // Some error codes don't have any tests apparently...