From 6a47326a0452cc8d5cb57676508b5469d648c67f Mon Sep 17 00:00:00 2001 From: Diego de Oliveira Date: Wed, 14 Sep 2022 15:03:12 -0300 Subject: [PATCH 01/10] Migrated the rustc_passes lint for annotations without effect to the new diagnostic infrastructure --- .../locales/en-US/passes.ftl | 3 +++ compiler/rustc_passes/src/errors.rs | 7 +++++++ compiler/rustc_passes/src/stability.rs | 17 +++++++---------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/compiler/rustc_error_messages/locales/en-US/passes.ftl b/compiler/rustc_error_messages/locales/en-US/passes.ftl index 556a6452f1a19..995ad4fe25859 100644 --- a/compiler/rustc_error_messages/locales/en-US/passes.ftl +++ b/compiler/rustc_error_messages/locales/en-US/passes.ftl @@ -268,3 +268,6 @@ passes_link_ordinal = attribute should be applied to a foreign function or stati passes_collapse_debuginfo = `collapse_debuginfo` attribute should be applied to macro definitions .label = not a macro definition + +passes_deprecated_annotation_has_no_effect = this `#[deprecated]` annotation has no effect + .suggestion = remove the unnecessary deprecation attribute diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index 96cc8ae988cd5..726b5b6cd4d0b 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -658,3 +658,10 @@ pub struct CollapseDebuginfo { #[label] pub defn_span: Span, } + +#[derive(LintDiagnostic)] +#[diag(passes::deprecated_annotation_has_no_effect)] +pub struct DeprecatedAnnotationHasNoEffect { + #[suggestion(applicability = "machine-applicable", code = "")] + pub span: Span, +} diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 9ba1276099db5..3f23b027aef28 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -1,6 +1,7 @@ //! A pass that annotates every item and method with its stability level, //! propagating default levels lexically from parent to children ast nodes. +use crate::errors; use rustc_attr::{ self as attr, rust_version_symbol, ConstStability, Stability, StabilityLevel, Unstable, UnstableReason, VERSION_PLACEHOLDER, @@ -122,16 +123,12 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> { if kind == AnnotationKind::Prohibited || kind == AnnotationKind::DeprecationProhibited { let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id); - self.tcx.struct_span_lint_hir(USELESS_DEPRECATED, hir_id, *span, |lint| { - lint.build("this `#[deprecated]` annotation has no effect") - .span_suggestion_short( - *span, - "remove the unnecessary deprecation attribute", - "", - rustc_errors::Applicability::MachineApplicable, - ) - .emit(); - }); + self.tcx.emit_spanned_lint( + USELESS_DEPRECATED, + hir_id, + *span, + errors::DeprecatedAnnotationHasNoEffect { span: *span }, + ); } // `Deprecation` is just two pointers, no need to intern it From e0a2e2d892252ed6e6264ce5cc8dae3dd2800f4a Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 21 Sep 2022 12:31:48 +0000 Subject: [PATCH 02/10] Deduplicate two functions that would soon have been three --- compiler/rustc_typeck/src/check/writeback.rs | 22 ++++---------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/compiler/rustc_typeck/src/check/writeback.rs b/compiler/rustc_typeck/src/check/writeback.rs index 9ecf34e9ad3e7..680dbf7037fad 100644 --- a/compiler/rustc_typeck/src/check/writeback.rs +++ b/compiler/rustc_typeck/src/check/writeback.rs @@ -717,27 +717,13 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> { Resolver { tcx: fcx.tcx, infcx: fcx, span, body, replaced_with_error: false } } - fn report_type_error(&self, t: Ty<'tcx>) { + fn report_error(&self, p: impl Into>) { if !self.tcx.sess.has_errors().is_some() { self.infcx .emit_inference_failure_err( Some(self.body.id()), self.span.to_span(self.tcx), - t.into(), - E0282, - false, - ) - .emit(); - } - } - - fn report_const_error(&self, c: ty::Const<'tcx>) { - if self.tcx.sess.has_errors().is_none() { - self.infcx - .emit_inference_failure_err( - Some(self.body.id()), - self.span.to_span(self.tcx), - c.into(), + p.into(), E0282, false, ) @@ -782,7 +768,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Resolver<'cx, 'tcx> { } Err(_) => { debug!("Resolver::fold_ty: input type `{:?}` not fully resolvable", t); - self.report_type_error(t); + self.report_error(t); self.replaced_with_error = true; self.tcx().ty_error() } @@ -799,7 +785,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Resolver<'cx, 'tcx> { Ok(ct) => self.tcx.erase_regions(ct), Err(_) => { debug!("Resolver::fold_const: input const `{:?}` not fully resolvable", ct); - self.report_const_error(ct); + self.report_error(ct); self.replaced_with_error = true; self.tcx().const_error(ct.ty()) } From 3d8b3e6ca179dc2ac79c038ad607b2321be70e8d Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Wed, 21 Sep 2022 10:24:16 -0500 Subject: [PATCH 03/10] Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests This allows the tests to pass even if the user has RUST_BACKTRACE set when running 'x.py' --- src/test/ui/intrinsics/const-eval-select-backtrace-std.rs | 1 + .../ui/intrinsics/const-eval-select-backtrace-std.run.stderr | 2 +- src/test/ui/intrinsics/const-eval-select-backtrace.rs | 1 + src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs b/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs index 29aefe07162b3..1164a3a5b0180 100644 --- a/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs +++ b/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs @@ -1,6 +1,7 @@ // See issue #100696. // run-fail // check-run-results +// exec-env:RUST_BACKTRACE=0 fn main() { &""[1..]; } diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr index e53e6034620ca..463cd52c5aa7b 100644 --- a/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +++ b/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr @@ -1,2 +1,2 @@ -thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:5:6 +thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:6:6 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace.rs b/src/test/ui/intrinsics/const-eval-select-backtrace.rs index 99f0725200c1d..ef1c7c4195b91 100644 --- a/src/test/ui/intrinsics/const-eval-select-backtrace.rs +++ b/src/test/ui/intrinsics/const-eval-select-backtrace.rs @@ -2,6 +2,7 @@ // See issue #100696. // run-fail // check-run-results +// exec-env:RUST_BACKTRACE=0 #[track_caller] fn uhoh() { diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr b/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr index 2fd730ac7a68a..54e28db5e533d 100644 --- a/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr +++ b/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr @@ -1,2 +1,2 @@ -thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:16:9 +thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:17:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace From 47b1009722489dda5ddb8b960a8f6e479bfd55ab Mon Sep 17 00:00:00 2001 From: b-naber Date: Thu, 15 Sep 2022 18:46:40 +0200 Subject: [PATCH 04/10] don't duplicate late-bound region names in print of Binder --- compiler/rustc_middle/src/ty/print/pretty.rs | 80 +++++++++++++------- compiler/rustc_middle/src/ty/sty.rs | 28 +++++++ 2 files changed, 81 insertions(+), 27 deletions(-) diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index b6cd5396b1d23..bce081826b1b3 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1572,7 +1572,9 @@ pub struct FmtPrinterData<'a, 'tcx> { in_value: bool, pub print_alloc_ids: bool, + // set of all named (non-anonymous) region names used_region_names: FxHashSet, + region_index: usize, binder_depth: usize, printed_type_count: usize, @@ -2139,23 +2141,31 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { where T: Print<'tcx, Self, Output = Self, Error = fmt::Error> + TypeFoldable<'tcx>, { - fn name_by_region_index(index: usize) -> Symbol { - match index { - 0 => Symbol::intern("'r"), - 1 => Symbol::intern("'s"), - i => Symbol::intern(&format!("'t{}", i - 2)), + fn name_by_region_index( + index: usize, + available_names: &mut Vec, + num_available: usize, + ) -> Symbol { + if let Some(name) = available_names.pop() { + name + } else { + Symbol::intern(&format!("'t{}", index - num_available)) } } + debug!("name_all_regions"); + // Replace any anonymous late-bound regions with named // variants, using new unique identifiers, so that we can // clearly differentiate between named and unnamed regions in // the output. We'll probably want to tweak this over time to // decide just how much information to give. if self.binder_depth == 0 { - self.prepare_late_bound_region_info(value); + self.prepare_region_info(value); } + debug!("self.used_region_names: {:?}", &self.used_region_names); + let mut empty = true; let mut start_or_continue = |cx: &mut Self, start: &str, cont: &str| { let w = if empty { @@ -2172,13 +2182,23 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { define_scoped_cx!(self); + let possible_names = vec![Symbol::intern("'t"), Symbol::intern("'s"), Symbol::intern("'r")]; + + let mut available_names = possible_names + .into_iter() + .filter(|name| !self.used_region_names.contains(&name)) + .collect::>(); + debug!(?available_names); + let num_available = available_names.len(); + let mut region_index = self.region_index; - let mut next_name = |this: &Self| loop { - let name = name_by_region_index(region_index); + let mut next_name = |this: &Self| { + let name = name_by_region_index(region_index, &mut available_names, num_available); + debug!(?name); region_index += 1; - if !this.used_region_names.contains(&name) { - break name; - } + assert!(!this.used_region_names.contains(&name)); + + name }; // If we want to print verbosely, then print *all* binders, even if they @@ -2199,6 +2219,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { ty::BrAnon(_) | ty::BrEnv => { start_or_continue(&mut self, "for<", ", "); let name = next_name(&self); + debug!(?name); do_continue(&mut self, name); ty::BrNamed(CRATE_DEF_ID.to_def_id(), name) } @@ -2292,29 +2313,37 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { Ok(inner) } - fn prepare_late_bound_region_info(&mut self, value: &ty::Binder<'tcx, T>) + fn prepare_region_info(&mut self, value: &ty::Binder<'tcx, T>) where T: TypeVisitable<'tcx>, { - struct LateBoundRegionNameCollector<'a, 'tcx> { - used_region_names: &'a mut FxHashSet, + struct RegionNameCollector<'tcx> { + used_region_names: FxHashSet, type_collector: SsoHashSet>, } - impl<'tcx> ty::visit::TypeVisitor<'tcx> for LateBoundRegionNameCollector<'_, 'tcx> { + impl<'tcx> RegionNameCollector<'tcx> { + fn new() -> Self { + RegionNameCollector { + used_region_names: Default::default(), + type_collector: SsoHashSet::new(), + } + } + } + + impl<'tcx> ty::visit::TypeVisitor<'tcx> for RegionNameCollector<'tcx> { type BreakTy = (); fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow { trace!("address: {:p}", r.0.0); - if let ty::ReLateBound(_, ty::BoundRegion { kind: ty::BrNamed(_, name), .. }) = *r { - self.used_region_names.insert(name); - } else if let ty::RePlaceholder(ty::PlaceholderRegion { - name: ty::BrNamed(_, name), - .. - }) = *r - { + + // Collect all named lifetimes. These allow us to prevent duplication + // of already existing lifetime names when introducing names for + // anonymous late-bound regions. + if let Some(name) = r.get_name() { self.used_region_names.insert(name); } + r.super_visit_with(self) } @@ -2330,12 +2359,9 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { } } - self.used_region_names.clear(); - let mut collector = LateBoundRegionNameCollector { - used_region_names: &mut self.used_region_names, - type_collector: SsoHashSet::new(), - }; + let mut collector = RegionNameCollector::new(); value.visit_with(&mut collector); + self.used_region_names = collector.used_region_names; self.region_index = 0; } } diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index d2f73f274f8d9..e63ede2735392 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -85,6 +85,17 @@ impl BoundRegionKind { _ => false, } } + + pub fn get_name(&self) -> Option { + if self.is_named() { + match *self { + BoundRegionKind::BrNamed(_, name) => return Some(name), + _ => unreachable!(), + } + } + + None + } } pub trait Article { @@ -1441,6 +1452,23 @@ impl<'tcx> Region<'tcx> { *self.0.0 } + pub fn get_name(self) -> Option { + if self.has_name() { + let name = match *self { + ty::ReEarlyBound(ebr) => Some(ebr.name), + ty::ReLateBound(_, br) => br.kind.get_name(), + ty::ReFree(fr) => fr.bound_region.get_name(), + ty::ReStatic => Some(Symbol::intern("static")), + ty::RePlaceholder(placeholder) => placeholder.name.get_name(), + _ => None, + }; + + return name; + } + + None + } + /// Is this region named by the user? pub fn has_name(self) -> bool { match *self { From 8711ba5d322e54b1d9b7730ea18b40243152333e Mon Sep 17 00:00:00 2001 From: b-naber Date: Sun, 18 Sep 2022 22:02:56 +0200 Subject: [PATCH 05/10] bless tests --- ...arms.float_to_exponential_common.ConstProp.diff | 4 ++-- .../issue_73223.main.SimplifyArmIdentity.diff | 2 +- src/test/mir-opt/issue_99325.main.mir_map.0.mir | 4 ++-- ...ray_casts.SimplifyCfg-elaborate-drops.after.mir | 2 +- .../issue-70935-complex-spans.drop_tracking.stderr | 2 +- .../escape-argument-callee.stderr | 2 +- .../propagate-approximated-ref.stderr | 2 +- ...-approximated-shorter-to-static-no-bound.stderr | 2 +- ...proximated-shorter-to-static-wrong-bound.stderr | 2 +- ...ate-fail-to-approximate-longer-no-bounds.stderr | 2 +- ...-fail-to-approximate-longer-wrong-bounds.stderr | 2 +- src/test/ui/regions/issue-101280.rs | 10 ++++++++++ src/test/ui/regions/issue-101280.stderr | 14 ++++++++++++++ ...gion-lifetime-bounds-on-fns-where-clause.stderr | 2 +- ...iple-lifetime-bounds-on-fns-where-clause.stderr | 4 ++-- .../regions/regions-lifetime-bounds-on-fns.stderr | 2 +- 16 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 src/test/ui/regions/issue-101280.rs create mode 100644 src/test/ui/regions/issue-101280.stderr diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff index dca36b1a76d0f..cedf7e31b23f6 100644 --- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff +++ b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff @@ -100,7 +100,7 @@ _0 = float_to_exponential_common_exact::(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87 // mir::Constant // + span: $DIR/funky_arms.rs:26:9: 26:42 - // + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut Formatter<'s>, &'t0 T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::}, val: Value() } + // + literal: Const { ty: for<'r, 's, 't> fn(&'r mut Formatter<'s>, &'t T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::}, val: Value() } } bb7: { @@ -125,7 +125,7 @@ _0 = float_to_exponential_common_shortest::(move _18, move _19, move _20, move _21) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68 // mir::Constant // + span: $DIR/funky_arms.rs:28:9: 28:45 - // + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut Formatter<'s>, &'t0 T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::}, val: Value() } + // + literal: Const { ty: for<'r, 's, 't> fn(&'r mut Formatter<'s>, &'t T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::}, val: Value() } } bb9: { diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff index 76d8d9396255b..07bbb998d1b04 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff @@ -139,7 +139,7 @@ _21 = core::panicking::assert_failed::(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } + // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) } diff --git a/src/test/mir-opt/issue_99325.main.mir_map.0.mir b/src/test/mir-opt/issue_99325.main.mir_map.0.mir index 8659ddfdb00cc..ef28a8c97b3f3 100644 --- a/src/test/mir-opt/issue_99325.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_99325.main.mir_map.0.mir @@ -132,7 +132,7 @@ fn main() -> () { _16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } + // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } } bb4: { @@ -241,7 +241,7 @@ fn main() -> () { _37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } + // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } } bb13: { diff --git a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir index 899bb67fb3ae5..b39d4f468f5ba 100644 --- a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir @@ -180,7 +180,7 @@ fn array_casts() -> () { _28 = core::panicking::assert_failed::(move _29, move _30, move _32, move _34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r usize, &'s usize, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } + // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r usize, &'s usize, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } } bb4: { diff --git a/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr b/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr index 198de7bf79f36..8fba766bc8704 100644 --- a/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr +++ b/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr @@ -18,7 +18,7 @@ LL | async fn baz(_c: impl FnMut() -> T) where T: Future { | ___________________________________________________________________^ LL | | } | |_^ - = note: required because it captures the following types: `ResumeTy`, `impl for<'r, 's, 't0> Future`, `()` + = note: required because it captures the following types: `ResumeTy`, `impl for<'r, 's, 't> Future`, `()` note: required because it's used within this `async` block --> $DIR/issue-70935-complex-spans.rs:16:16 | diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr index 59b848ea85ce1..66c99bcdfed0c 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y); | = note: defining type: test::{closure#0} with closure substs [ i16, - for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) i32)), + for<'r, 's, 't> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) i32)), (), ] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr index 435a5353340da..ca4c1a1ee7e76 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t3) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>)), + for<'r, 's, 't, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index c95907ea75e5a..42404412bf990 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) u32>)), + for<'r, 's, 't, 't0, 't1> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) u32>)), (), ] = note: late-bound region is '_#2r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index db58d9d6f1a3c..c74430ea3fc2b 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t3) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>)), + for<'r, 's, 't, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index e6f88de4ee8d9..1e161757222f2 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)), + for<'r, 's, 't, 't0, 't1> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)), (), ] = note: late-bound region is '_#2r diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index 5f5fce77137c1..622113a875bd6 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t3) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>)), + for<'r, 's, 't, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/regions/issue-101280.rs b/src/test/ui/regions/issue-101280.rs new file mode 100644 index 0000000000000..29f158366f026 --- /dev/null +++ b/src/test/ui/regions/issue-101280.rs @@ -0,0 +1,10 @@ +use std::cell::Cell; + +type Ty = for<'r> fn(Cell<(&'r i32, &'r i32)>); + +fn f<'r>(f: fn(Cell<(&'r i32, &i32)>)) -> Ty { + f + //~^ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/regions/issue-101280.stderr b/src/test/ui/regions/issue-101280.stderr new file mode 100644 index 0000000000000..3ce08966326d0 --- /dev/null +++ b/src/test/ui/regions/issue-101280.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/issue-101280.rs:6:5 + | +LL | fn f<'r>(f: fn(Cell<(&'r i32, &i32)>)) -> Ty { + | -- expected `for<'r> fn(Cell<(&'r i32, &'r i32)>)` because of return type +LL | f + | ^ one type is more general than the other + | + = note: expected fn pointer `for<'r> fn(Cell<(&'r i32, &'r i32)>)` + found fn pointer `for<'s> fn(Cell<(&'r i32, &'s i32)>)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr index 48f2e1a2fa212..20c0c9f4514d7 100644 --- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr +++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types 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)` + = note: expected fn pointer `for<'r, 's, 't, 't0> fn(&'r mut &'s isize, &'t mut &'t0 isize)` found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr index 36f40cd9a0f62..676b0904ebfa4 100644 --- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr +++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types 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::<'_, '_, '_>}` + = note: expected fn pointer `for<'r, 's, 't, 't0, 't1, 't2> fn(&'r mut &'s isize, &'t mut &'t0 isize, &'t1 mut &'t2 isize)` + found fn item `for<'r, 's, 't> fn(&'r mut &isize, &'s mut &isize, &'t mut &isize) {a::<'_, '_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr index a0daf58c6b57b..e02bed707dca4 100644 --- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr +++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types 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)` + = note: expected fn pointer `for<'r, 's, 't, 't0> fn(&'r mut &'s isize, &'t mut &'t0 isize)` found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` error: aborting due to previous error From 953d88b181bf9ac60cb8690a84af5ce13be26ba6 Mon Sep 17 00:00:00 2001 From: b-naber Date: Wed, 21 Sep 2022 17:57:30 +0200 Subject: [PATCH 06/10] address review --- compiler/rustc_middle/src/ty/print/pretty.rs | 5 +++-- compiler/rustc_middle/src/ty/sty.rs | 2 +- ...primitives.{impl#0}-clone.InstCombine.diff | 6 +++--- ...motion_extern_static.BAR.PromoteTemps.diff | 2 +- ...motion_extern_static.FOO.PromoteTemps.diff | 2 +- ..._line_doc_comment_2.DeduplicateBlocks.diff | 2 +- .../derefer_complex_case.main.Derefer.diff | 2 +- .../simple.nrvo.DestinationPropagation.diff | 4 ++-- ...float_to_exponential_common.ConstProp.diff | 8 ++++---- src/test/mir-opt/inline/cycle.f.Inline.diff | 2 +- .../inline/dyn_trait.get_query.Inline.diff | 6 +++--- .../inline/dyn_trait.mk_cycle.Inline.diff | 2 +- .../dyn_trait.try_execute_query.Inline.diff | 4 ++-- .../inline/inline_generator.main.Inline.diff | 2 +- .../inline/inline_retag.bar.Inline.after.mir | 6 +++--- .../inline/inline_shims.clone.Inline.diff | 2 +- .../inline_trait_method.test.Inline.after.mir | 2 +- ...line_trait_method_2.test2.Inline.after.mir | 2 +- .../inline/issue_78442.bar.Inline.diff | 2 +- .../inline/issue_78442.bar.RevealAll.diff | 4 ++-- .../issue_73223.main.SimplifyArmIdentity.diff | 2 +- .../mir-opt/issue_91633.bar.mir_map.0.mir | 2 +- .../mir-opt/issue_91633.foo.mir_map.0.mir | 2 +- .../mir-opt/issue_91633.hey.mir_map.0.mir | 2 +- .../mir-opt/issue_99325.main.mir_map.0.mir | 8 ++++---- ...trinsics.discriminant.LowerIntrinsics.diff | 8 ++++---- ...er_slice_len.bound.LowerSliceLenCalls.diff | 2 +- ..._after_call.main.ElaborateDrops.before.mir | 2 +- .../nrvo_simple.nrvo.RenameReturnPlace.diff | 4 ++-- ...age_markers.main.RemoveStorageMarkers.diff | 2 +- ...asts.SimplifyCfg-elaborate-drops.after.mir | 2 +- ...place.Test.SimplifyCfg-make_shim.after.mir | 2 +- ...main.SimplifyCfg-elaborate-drops.after.mir | 10 +++++----- ...Vec_i32_.AddMovesForPackedDrops.before.mir | 2 +- src/test/pretty/issue-4264.pp | 2 +- .../anonymous-higher-ranked-lifetime.stderr | 20 +++++++++---------- ...e-70935-complex-spans.drop_tracking.stderr | 2 +- src/test/ui/binop/issue-77910-1.rs | 2 +- src/test/ui/binop/issue-77910-1.stderr | 10 +++++----- src/test/ui/binop/issue-77910-2.stderr | 4 ++-- .../expect-fn-supply-fn.stderr | 6 +++--- .../ui/closures/closure-reform-bad.stderr | 2 +- src/test/ui/compare-method/issue-90444.stderr | 6 +++--- .../bugs/issue-88382.stderr | 4 ++-- .../issue-30786.stderr | 10 +++++----- .../issue-46989.stderr | 2 +- .../normalize-under-binder/issue-71955.stderr | 16 +++++++-------- .../normalize-under-binder/issue-85455.rs | 2 +- .../normalize-under-binder/issue-85455.stderr | 6 +++--- src/test/ui/hygiene/impl_items.rs | 2 +- src/test/ui/hygiene/impl_items.stderr | 2 +- ...plicit-hrtb-without-dyn.edition2015.stderr | 4 ++-- ...plicit-hrtb-without-dyn.edition2021.stderr | 4 ++-- .../generic-with-implicit-hrtb-without-dyn.rs | 2 +- src/test/ui/issues/issue-18919.stderr | 4 ++-- src/test/ui/issues/issue-24322.stderr | 4 ++-- src/test/ui/issues/issue-40000.stderr | 4 ++-- src/test/ui/issues/issue-57362-2.stderr | 6 +++--- src/test/ui/lifetimes/issue-79187-2.stderr | 2 +- src/test/ui/lifetimes/issue-79187.stderr | 2 +- .../lifetime-errors/issue_74400.stderr | 2 +- .../ui/lifetimes/re-empty-in-error.stderr | 2 +- .../closure-arg-type-mismatch.stderr | 2 +- .../mismatched_types/closure-mismatch.stderr | 2 +- .../ui/mismatched_types/fn-variance-1.stderr | 4 ++-- .../ui/mismatched_types/issue-36053-2.stderr | 4 ++-- .../escape-argument-callee.stderr | 2 +- .../escape-argument.stderr | 2 +- ...pagate-approximated-fail-no-postdom.stderr | 2 +- .../propagate-approximated-ref.stderr | 2 +- ...er-to-static-comparing-against-free.stderr | 4 ++-- ...oximated-shorter-to-static-no-bound.stderr | 2 +- ...mated-shorter-to-static-wrong-bound.stderr | 2 +- .../propagate-approximated-val.stderr | 2 +- .../propagate-despite-same-free-region.stderr | 2 +- ...ail-to-approximate-longer-no-bounds.stderr | 2 +- ...-to-approximate-longer-wrong-bounds.stderr | 2 +- .../return-wrong-bound-region.stderr | 2 +- .../issue-57642-higher-ranked-subtype.stderr | 10 +++++----- src/test/ui/nll/issue-97997.stderr | 4 ++-- .../impl-fn-ignore-binder-via-bottom.stderr | 6 +++--- .../nll/relate_tys/universe-violation.stderr | 2 +- ...ram-closure-approximate-lower-bound.stderr | 4 ++-- .../associated-item-privacy-inherent.rs | 6 +++--- .../associated-item-privacy-inherent.stderr | 6 +++--- .../privacy/associated-item-privacy-trait.rs | 6 +++--- .../associated-item-privacy-trait.stderr | 6 +++--- .../ui/privacy/private-inferred-type-3.rs | 2 +- .../ui/privacy/private-inferred-type-3.stderr | 2 +- src/test/ui/privacy/private-inferred-type.rs | 2 +- .../ui/privacy/private-inferred-type.stderr | 2 +- src/test/ui/regions/issue-101280.stderr | 2 +- ...lifetime-bounds-on-fns-where-clause.stderr | 4 ++-- ...lifetime-bounds-on-fns-where-clause.stderr | 4 ++-- ...ons-fn-subtyping-return-static-fail.stderr | 2 +- .../regions-lifetime-bounds-on-fns.stderr | 4 ++-- src/test/ui/rfc1623-2.stderr | 2 +- .../fn-or-tuple-struct-without-args.stderr | 8 ++++---- .../ui/suggestions/return-closures.stderr | 2 +- src/test/ui/symbol-names/impl1.legacy.stderr | 2 +- src/test/ui/symbol-names/impl1.rs | 4 ++-- src/test/ui/symbol-names/impl1.v0.stderr | 2 +- .../check-trait-object-bounds-2.stderr | 2 +- .../issue-57611-trait-alias.stderr | 2 +- .../unboxed-closures-unsafe-extern-fn.stderr | 12 +++++------ .../unboxed-closures-wrong-abi.stderr | 18 ++++++++--------- ...d-closures-wrong-arg-type-extern-fn.stderr | 6 +++--- 107 files changed, 212 insertions(+), 211 deletions(-) diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index bce081826b1b3..471b105a1a24b 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -2149,7 +2149,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { if let Some(name) = available_names.pop() { name } else { - Symbol::intern(&format!("'t{}", index - num_available)) + Symbol::intern(&format!("'z{}", index - num_available)) } } @@ -2182,7 +2182,8 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { define_scoped_cx!(self); - let possible_names = vec![Symbol::intern("'t"), Symbol::intern("'s"), Symbol::intern("'r")]; + let possible_names = + ('a'..='z').rev().map(|s| Symbol::intern(&format!("'{s}"))).collect::>(); let mut available_names = possible_names .into_iter() diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index e63ede2735392..ac28a6d15732d 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1458,7 +1458,7 @@ impl<'tcx> Region<'tcx> { ty::ReEarlyBound(ebr) => Some(ebr.name), ty::ReLateBound(_, br) => br.kind.get_name(), ty::ReFree(fr) => fr.bound_region.get_name(), - ty::ReStatic => Some(Symbol::intern("static")), + ty::ReStatic => Some(kw::StaticLifetime), ty::RePlaceholder(placeholder) => placeholder.name.get_name(), _ => None, }; diff --git a/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff b/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff index bde2f04fac9f0..6f01553eef6da 100644 --- a/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff +++ b/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff @@ -24,7 +24,7 @@ _2 = ::clone(move _3) -> bb1; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9 // mir::Constant // + span: $DIR/combine_clone_of_primitives.rs:8:5: 8:9 - // + literal: Const { ty: for<'r> fn(&'r T) -> T {::clone}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a T) -> T {::clone}, val: Value() } } bb1: { @@ -37,7 +37,7 @@ - _5 = ::clone(move _6) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11 - // mir::Constant - // + span: $DIR/combine_clone_of_primitives.rs:9:5: 9:11 -- // + literal: Const { ty: for<'r> fn(&'r u64) -> u64 {::clone}, val: Value() } +- // + literal: Const { ty: for<'a> fn(&'a u64) -> u64 {::clone}, val: Value() } + _6 = _7; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11 + _5 = (*_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11 + goto -> bb2; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11 @@ -53,7 +53,7 @@ - _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16 - // mir::Constant - // + span: $DIR/combine_clone_of_primitives.rs:10:5: 10:16 -- // + literal: Const { ty: for<'r> fn(&'r [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value() } +- // + literal: Const { ty: for<'a> fn(&'a [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value() } + _9 = _10; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16 + _8 = (*_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16 + goto -> bb3; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16 diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff index 248abb8fd0e5b..f8a7c687e124a 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff +++ b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff @@ -33,7 +33,7 @@ _0 = core::slice::::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:44 // mir::Constant // + span: $DIR/const-promotion-extern-static.rs:9:36: 9:42 - // + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::::as_ptr}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::::as_ptr}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff index 8ce895fe72b00..e938ca28af5d6 100644 --- a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff +++ b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff @@ -35,7 +35,7 @@ _0 = core::slice::::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:55 // mir::Constant // + span: $DIR/const-promotion-extern-static.rs:13:47: 13:53 - // + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::::as_ptr}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::::as_ptr}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff b/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff index 53f977de5d6ad..995611f0e9664 100644 --- a/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff +++ b/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff @@ -20,7 +20,7 @@ _2 = core::str::::as_bytes(move _3) -> bb1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23 // mir::Constant // + span: $DIR/deduplicate_blocks.rs:5:13: 5:21 - // + literal: Const { ty: for<'r> fn(&'r str) -> &'r [u8] {core::str::::as_bytes}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a str) -> &'a [u8] {core::str::::as_bytes}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff b/src/test/mir-opt/derefer_complex_case.main.Derefer.diff index c353c375aa963..1858fa2203422 100644 --- a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff +++ b/src/test/mir-opt/derefer_complex_case.main.Derefer.diff @@ -56,7 +56,7 @@ _7 = as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 // mir::Constant // + span: $DIR/derefer_complex_case.rs:6:17: 6:26 - // + literal: Const { ty: for<'r> fn(&'r mut std::slice::Iter) -> Option< as Iterator>::Item> { as Iterator>::next}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter) -> Option< as Iterator>::Item> { as Iterator>::next}, val: Value() } } bb3: { diff --git a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff index a20a172af1bbc..80b09ed5f8d35 100644 --- a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff @@ -1,12 +1,12 @@ - // MIR for `nrvo` before DestinationPropagation + // MIR for `nrvo` after DestinationPropagation - fn nrvo(_1: for<'r> fn(&'r mut [u8; 1024])) -> [u8; 1024] { + fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] { debug init => _1; // in scope 0 at $DIR/simple.rs:+0:9: +0:13 let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/simple.rs:+0:39: +0:49 let mut _2: [u8; 1024]; // in scope 0 at $DIR/simple.rs:+1:9: +1:16 let _3: (); // in scope 0 at $DIR/simple.rs:+2:5: +2:19 - let mut _4: for<'r> fn(&'r mut [u8; 1024]); // in scope 0 at $DIR/simple.rs:+2:5: +2:9 + let mut _4: for<'a> fn(&'a mut [u8; 1024]); // in scope 0 at $DIR/simple.rs:+2:5: +2:9 let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18 let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18 scope 1 { diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff index cedf7e31b23f6..b51fd0522e528 100644 --- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff +++ b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff @@ -41,7 +41,7 @@ _4 = Formatter::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37 // mir::Constant // + span: $DIR/funky_arms.rs:15:26: 15:35 - // + literal: Const { ty: for<'r> fn(&'r Formatter) -> bool {Formatter::sign_plus}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a Formatter) -> bool {Formatter::sign_plus}, val: Value() } } bb1: { @@ -69,7 +69,7 @@ _7 = Formatter::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45 // mir::Constant // + span: $DIR/funky_arms.rs:24:34: 24:43 - // + literal: Const { ty: for<'r> fn(&'r Formatter) -> Option {Formatter::precision}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a Formatter) -> Option {Formatter::precision}, val: Value() } } bb5: { @@ -100,7 +100,7 @@ _0 = float_to_exponential_common_exact::(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87 // mir::Constant // + span: $DIR/funky_arms.rs:26:9: 26:42 - // + literal: Const { ty: for<'r, 's, 't> fn(&'r mut Formatter<'s>, &'t T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::}, val: Value() } + // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::}, val: Value() } } bb7: { @@ -125,7 +125,7 @@ _0 = float_to_exponential_common_shortest::(move _18, move _19, move _20, move _21) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68 // mir::Constant // + span: $DIR/funky_arms.rs:28:9: 28:45 - // + literal: Const { ty: for<'r, 's, 't> fn(&'r mut Formatter<'s>, &'t T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::}, val: Value() } + // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::}, val: Value() } } bb9: { diff --git a/src/test/mir-opt/inline/cycle.f.Inline.diff b/src/test/mir-opt/inline/cycle.f.Inline.diff index 40fdd1cdb19c9..75ea69a42eb59 100644 --- a/src/test/mir-opt/inline/cycle.f.Inline.diff +++ b/src/test/mir-opt/inline/cycle.f.Inline.diff @@ -17,7 +17,7 @@ _2 = >::call(move _3, move _4) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/cycle.rs:+1:5: +1:8 // mir::Constant // + span: $DIR/cycle.rs:6:5: 6:6 - // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> >::Output {>::call}, val: Value() } + // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> >::Output {>::call}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff b/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff index 4b50ba9501c1a..1e95b5b29ff4e 100644 --- a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff +++ b/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff @@ -28,7 +28,7 @@ // mir::Constant // + span: $DIR/dyn-trait.rs:33:13: 33:21 // + user_ty: UserType(0) - // + literal: Const { ty: for<'r> fn(&'r T) -> &'r ::C {::cache::}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a T) -> &'a ::C {::cache::}, val: Value() } } bb1: { @@ -46,9 +46,9 @@ + _0 = ::V> as Cache>::store_nocache(move _7) -> bb2; // scope 3 at $DIR/dyn-trait.rs:21:5: 21:22 // mir::Constant - // + span: $DIR/dyn-trait.rs:34:5: 34:22 -- // + literal: Const { ty: for<'r> fn(&'r ::C) {try_execute_query::<::C>}, val: Value() } +- // + literal: Const { ty: for<'a> fn(&'a ::C) {try_execute_query::<::C>}, val: Value() } + // + span: $DIR/dyn-trait.rs:21:7: 21:20 -+ // + literal: Const { ty: for<'r> fn(&'r dyn Cache::V>) {::V> as Cache>::store_nocache}, val: Value() } ++ // + literal: Const { ty: for<'a> fn(&'a dyn Cache::V>) {::V> as Cache>::store_nocache}, val: Value() } } bb2: { diff --git a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff b/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff index 994930ef4cf6f..7421db4d063af 100644 --- a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff +++ b/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff @@ -12,7 +12,7 @@ _0 = as Cache>::store_nocache(move _2) -> bb1; // scope 0 at $DIR/dyn-trait.rs:+1:5: +1:22 // mir::Constant // + span: $DIR/dyn-trait.rs:21:7: 21:20 - // + literal: Const { ty: for<'r> fn(&'r dyn Cache) { as Cache>::store_nocache}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a dyn Cache) { as Cache>::store_nocache}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff b/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff index 58c05b9f564df..e6e783744227e 100644 --- a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff +++ b/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff @@ -23,9 +23,9 @@ + _0 = ::V> as Cache>::store_nocache(move _4) -> bb1; // scope 1 at $DIR/dyn-trait.rs:21:5: 21:22 // mir::Constant - // + span: $DIR/dyn-trait.rs:27:5: 27:13 -- // + literal: Const { ty: for<'r> fn(&'r (dyn Cache::V> + 'r)) {mk_cycle::<::V>}, val: Value() } +- // + literal: Const { ty: for<'a> fn(&'a (dyn Cache::V> + 'a)) {mk_cycle::<::V>}, val: Value() } + // + span: $DIR/dyn-trait.rs:21:7: 21:20 -+ // + literal: Const { ty: for<'r> fn(&'r dyn Cache::V>) {::V> as Cache>::store_nocache}, val: Value() } ++ // + literal: Const { ty: for<'a> fn(&'a dyn Cache::V>) {::V> as Cache>::store_nocache}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/src/test/mir-opt/inline/inline_generator.main.Inline.diff index 0b992e3c32ad1..3fd8aad723880 100644 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff @@ -70,7 +70,7 @@ - _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46 - // mir::Constant - // + span: $DIR/inline-generator.rs:9:33: 9:39 -- // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator>::resume}, val: Value() } +- // + literal: Const { ty: for<'a> fn(Pin<&'a mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator>::resume}, val: Value() } + StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46 + _7 = const false; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46 + StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46 diff --git a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir index cabc1a92024fc..169e7f5c5d936 100644 --- a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir @@ -2,8 +2,8 @@ fn bar() -> bool { let mut _0: bool; // return place in scope 0 at $DIR/inline-retag.rs:+0:13: +0:17 - let _1: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+1:9: +1:10 - let mut _2: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+2:5: +2:6 + let _1: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+1:9: +1:10 + let mut _2: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+2:5: +2:6 let mut _3: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:7: +2:9 let _4: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:7: +2:9 let _5: i32; // in scope 0 at $DIR/inline-retag.rs:+2:8: +2:9 @@ -27,7 +27,7 @@ fn bar() -> bool { _1 = foo; // scope 0 at $DIR/inline-retag.rs:+1:13: +1:16 // mir::Constant // + span: $DIR/inline-retag.rs:11:13: 11:16 - // + literal: Const { ty: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}, val: Value() } + // + literal: Const { ty: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}, val: Value() } StorageLive(_2); // scope 1 at $DIR/inline-retag.rs:+2:5: +2:6 _2 = _1; // scope 1 at $DIR/inline-retag.rs:+2:5: +2:6 StorageLive(_3); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9 diff --git a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff b/src/test/mir-opt/inline/inline_shims.clone.Inline.diff index 25ca05893b2ee..d691e90b7dac6 100644 --- a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff +++ b/src/test/mir-opt/inline/inline_shims.clone.Inline.diff @@ -14,7 +14,7 @@ - _0 = ::clone(move _2) -> bb1; // scope 0 at $DIR/inline-shims.rs:+1:5: +1:14 - // mir::Constant - // + span: $DIR/inline-shims.rs:6:7: 6:12 -- // + literal: Const { ty: for<'r> fn(&'r fn(A, B)) -> fn(A, B) {::clone}, val: Value() } +- // + literal: Const { ty: for<'a> fn(&'a fn(A, B)) -> fn(A, B) {::clone}, val: Value() } - } - - bb1: { diff --git a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir b/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir index ed95edd16ce79..89eefc2926911 100644 --- a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir @@ -11,7 +11,7 @@ fn test(_1: &dyn X) -> u32 { _0 = ::y(move _2) -> bb1; // scope 0 at $DIR/inline-trait-method.rs:+1:5: +1:10 // mir::Constant // + span: $DIR/inline-trait-method.rs:9:7: 9:8 - // + literal: Const { ty: for<'r> fn(&'r dyn X) -> u32 {::y}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a dyn X) -> u32 {::y}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir index b8896430d221a..3d05869fa513e 100644 --- a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir @@ -21,7 +21,7 @@ fn test2(_1: &dyn X) -> bool { _0 = ::y(move _4) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10 // mir::Constant // + span: $DIR/inline-trait-method_2.rs:10:7: 10:8 - // + literal: Const { ty: for<'r> fn(&'r dyn X) -> bool {::y}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a dyn X) -> bool {::y}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff b/src/test/mir-opt/inline/issue_78442.bar.Inline.diff index c16dfdf395ecc..4186650dfabe0 100644 --- a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff +++ b/src/test/mir-opt/inline/issue_78442.bar.Inline.diff @@ -29,7 +29,7 @@ - _2 = >::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 - // mir::Constant - // + span: $DIR/issue-78442.rs:11:5: 11:15 -- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r fn() {foo}, ()) -> >::Output {>::call}, val: Value() } +- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> >::Output {>::call}, val: Value() } + _2 = move (*_3)() -> [return: bb5, unwind: bb3]; // scope 1 at $SRC_DIR/core/src/ops/function.rs:LL:COL } diff --git a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff b/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff index 0faa522cbaa9c..24e9a3df15acd 100644 --- a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff +++ b/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff @@ -29,8 +29,8 @@ + _2 = >::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 // mir::Constant // + span: $DIR/issue-78442.rs:11:5: 11:15 -- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> >::Output {>::call}, val: Value() } -+ // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r fn() {foo}, ()) -> >::Output {>::call}, val: Value() } +- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> >::Output {>::call}, val: Value() } ++ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> >::Output {>::call}, val: Value() } } bb2: { diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff index 07bbb998d1b04..208f9e0a0a373 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff @@ -139,7 +139,7 @@ _21 = core::panicking::assert_failed::(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } + // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a i32, &'b i32, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) } diff --git a/src/test/mir-opt/issue_91633.bar.mir_map.0.mir b/src/test/mir-opt/issue_91633.bar.mir_map.0.mir index f5092d2ac9238..625f6c7361ac8 100644 --- a/src/test/mir-opt/issue_91633.bar.mir_map.0.mir +++ b/src/test/mir-opt/issue_91633.bar.mir_map.0.mir @@ -15,7 +15,7 @@ fn bar(_1: Box<[T]>) -> () { _2 = <[T] as Index>::index(move _3, const 0_usize) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-91633.rs:+4:14: +4:19 // mir::Constant // + span: $DIR/issue-91633.rs:15:14: 15:19 - // + literal: Const { ty: for<'r> fn(&'r [T], usize) -> &'r <[T] as Index>::Output {<[T] as Index>::index}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a [T], usize) -> &'a <[T] as Index>::Output {<[T] as Index>::index}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/issue_91633.foo.mir_map.0.mir b/src/test/mir-opt/issue_91633.foo.mir_map.0.mir index 2e8b0feedd3f9..9903e203a2312 100644 --- a/src/test/mir-opt/issue_91633.foo.mir_map.0.mir +++ b/src/test/mir-opt/issue_91633.foo.mir_map.0.mir @@ -27,7 +27,7 @@ fn foo(_1: Box<[T]>) -> T { _2 = ::clone(move _3) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/issue-91633.rs:+2:14: +2:27 // mir::Constant // + span: $DIR/issue-91633.rs:28:20: 28:25 - // + literal: Const { ty: for<'r> fn(&'r T) -> T {::clone}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a T) -> T {::clone}, val: Value() } } bb2: { diff --git a/src/test/mir-opt/issue_91633.hey.mir_map.0.mir b/src/test/mir-opt/issue_91633.hey.mir_map.0.mir index 74f4a5a976116..37c3b3fcacafb 100644 --- a/src/test/mir-opt/issue_91633.hey.mir_map.0.mir +++ b/src/test/mir-opt/issue_91633.hey.mir_map.0.mir @@ -17,7 +17,7 @@ fn hey(_1: &[T]) -> () { _3 = <[T] as Index>::index(move _4, const 0_usize) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/issue-91633.rs:+4:15: +4:20 // mir::Constant // + span: $DIR/issue-91633.rs:7:15: 7:20 - // + literal: Const { ty: for<'r> fn(&'r [T], usize) -> &'r <[T] as Index>::Output {<[T] as Index>::index}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a [T], usize) -> &'a <[T] as Index>::Output {<[T] as Index>::index}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/issue_99325.main.mir_map.0.mir b/src/test/mir-opt/issue_99325.main.mir_map.0.mir index ef28a8c97b3f3..bb47ecb6b4ac3 100644 --- a/src/test/mir-opt/issue_99325.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_99325.main.mir_map.0.mir @@ -101,7 +101,7 @@ fn main() -> () { _11 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _12, move _13) -> [return: bb2, unwind: bb19]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's> fn(&'r &[u8], &'s &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value() } + // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value() } } bb2: { @@ -132,7 +132,7 @@ fn main() -> () { _16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } + // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } } bb4: { @@ -210,7 +210,7 @@ fn main() -> () { _32 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _33, move _34) -> [return: bb11, unwind: bb19]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's> fn(&'r &[u8], &'s &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value() } + // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value() } } bb11: { @@ -241,7 +241,7 @@ fn main() -> () { _37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } + // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } } bb13: { diff --git a/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff index a648e5d672dc8..d962ef8cb12dc 100644 --- a/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff +++ b/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff @@ -32,7 +32,7 @@ - _2 = discriminant_value::(move _3) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45 - // mir::Constant - // + span: $DIR/lower_intrinsics.rs:49:5: 49:41 -- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r T) -> ::Discriminant {discriminant_value::}, val: Value() } +- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a T) -> ::Discriminant {discriminant_value::}, val: Value() } + _2 = discriminant((*_3)); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45 + goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45 } @@ -53,7 +53,7 @@ - _5 = discriminant_value::(move _6) -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45 - // mir::Constant - // + span: $DIR/lower_intrinsics.rs:50:5: 50:41 -- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r i32) -> ::Discriminant {discriminant_value::}, val: Value() } +- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a i32) -> ::Discriminant {discriminant_value::}, val: Value() } + _5 = discriminant((*_6)); // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45 + goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45 } @@ -74,7 +74,7 @@ - _9 = discriminant_value::<()>(move _10) -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46 - // mir::Constant - // + span: $DIR/lower_intrinsics.rs:51:5: 51:41 -- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r ()) -> <() as DiscriminantKind>::Discriminant {discriminant_value::<()>}, val: Value() } +- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a ()) -> <() as DiscriminantKind>::Discriminant {discriminant_value::<()>}, val: Value() } + _9 = discriminant((*_10)); // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46 + goto -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46 } @@ -95,7 +95,7 @@ - _13 = discriminant_value::(move _14) -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48 - // mir::Constant - // + span: $DIR/lower_intrinsics.rs:52:5: 52:41 -- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r E) -> ::Discriminant {discriminant_value::}, val: Value() } +- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a E) -> ::Discriminant {discriminant_value::}, val: Value() } + _13 = discriminant((*_14)); // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48 + goto -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48 } diff --git a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff index 46fccba56f7c8..5f5d6e68fdc17 100644 --- a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff +++ b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff @@ -23,7 +23,7 @@ - _5 = core::slice::::len(move _6) -> bb1; // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27 - // mir::Constant - // + span: $DIR/lower_slice_len.rs:5:22: 5:25 -- // + literal: Const { ty: for<'r> fn(&'r [u8]) -> usize {core::slice::::len}, val: Value() } +- // + literal: Const { ty: for<'a> fn(&'a [u8]) -> usize {core::slice::::len}, val: Value() } + _5 = Len((*_6)); // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27 + goto -> bb1; // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27 } diff --git a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir b/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir index 25c6e3060069d..963e7cde6567b 100644 --- a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir +++ b/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir @@ -20,7 +20,7 @@ fn main() -> () { _2 = ::to_string(move _3) -> bb1; // scope 0 at $DIR/no-spurious-drop-after-call.rs:+1:20: +1:34 // mir::Constant // + span: $DIR/no-spurious-drop-after-call.rs:9:23: 9:32 - // + literal: Const { ty: for<'r> fn(&'r str) -> String {::to_string}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a str) -> String {::to_string}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff b/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff index 9e89bd9fb9631..ce35f920bf627 100644 --- a/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff +++ b/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff @@ -1,13 +1,13 @@ - // MIR for `nrvo` before RenameReturnPlace + // MIR for `nrvo` after RenameReturnPlace - fn nrvo(_1: for<'r> fn(&'r mut [u8; 1024])) -> [u8; 1024] { + fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] { debug init => _1; // in scope 0 at $DIR/nrvo-simple.rs:+0:9: +0:13 - let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/nrvo-simple.rs:+0:39: +0:49 + let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/nrvo-simple.rs:+1:9: +1:16 let mut _2: [u8; 1024]; // in scope 0 at $DIR/nrvo-simple.rs:+1:9: +1:16 let _3: (); // in scope 0 at $DIR/nrvo-simple.rs:+2:5: +2:19 - let mut _4: for<'r> fn(&'r mut [u8; 1024]); // in scope 0 at $DIR/nrvo-simple.rs:+2:5: +2:9 + let mut _4: for<'a> fn(&'a mut [u8; 1024]); // in scope 0 at $DIR/nrvo-simple.rs:+2:5: +2:9 let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/nrvo-simple.rs:+2:10: +2:18 let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/nrvo-simple.rs:+2:10: +2:18 scope 1 { diff --git a/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff b/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff index 99667aabdaee2..188aa55649069 100644 --- a/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff +++ b/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff @@ -57,7 +57,7 @@ _7 = as Iterator>::next(move _8) -> bb3; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19 // mir::Constant // + span: $DIR/remove_storage_markers.rs:10:14: 10:19 - // + literal: Const { ty: for<'r> fn(&'r mut std::ops::Range) -> Option< as Iterator>::Item> { as Iterator>::next}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range) -> Option< as Iterator>::Item> { as Iterator>::next}, val: Value() } } bb3: { diff --git a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir index b39d4f468f5ba..db5cf23148bef 100644 --- a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir @@ -180,7 +180,7 @@ fn array_casts() -> () { _28 = core::panicking::assert_failed::(move _29, move _30, move _32, move _34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: for<'r, 's, 't> fn(core::panicking::AssertKind, &'r usize, &'s usize, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } + // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a usize, &'b usize, Option>) -> ! {core::panicking::assert_failed::}, val: Value() } } bb4: { diff --git a/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir b/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir index 84f674db2d154..cdc413c568f18 100644 --- a/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir +++ b/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir @@ -11,7 +11,7 @@ fn std::ptr::drop_in_place(_1: *mut Test) -> () { _3 = ::drop(move _2) -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 // mir::Constant // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL - // + literal: Const { ty: for<'r> fn(&'r mut Test) {::drop}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a mut Test) {::drop}, val: Value() } } bb1: { diff --git a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir index 7212de52fc378..81225b44ebf9f 100644 --- a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir @@ -11,7 +11,7 @@ fn main() -> () { let mut _9: &mut i32; // in scope 0 at $DIR/retag.rs:+4:19: +4:20 let mut _12: *mut i32; // in scope 0 at $DIR/retag.rs:+7:18: +7:29 let mut _14: [closure@main::{closure#0}]; // in scope 0 at $DIR/retag.rs:+11:31: +14:6 - let mut _16: for<'r> fn(&'r i32) -> &'r i32; // in scope 0 at $DIR/retag.rs:+15:14: +15:15 + let mut _16: for<'a> fn(&'a i32) -> &'a i32; // in scope 0 at $DIR/retag.rs:+15:14: +15:15 let mut _17: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18 let _18: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18 let _19: &i32; // in scope 0 at $DIR/retag.rs:+18:5: +18:24 @@ -25,7 +25,7 @@ fn main() -> () { scope 1 { debug x => _1; // in scope 1 at $DIR/retag.rs:+1:9: +1:14 let _3: &mut i32; // in scope 1 at $DIR/retag.rs:+3:13: +3:14 - let _13: for<'r> fn(&'r i32) -> &'r i32; // in scope 1 at $DIR/retag.rs:+11:9: +11:10 + let _13: for<'a> fn(&'a i32) -> &'a i32; // in scope 1 at $DIR/retag.rs:+11:9: +11:10 scope 2 { debug v => _3; // in scope 2 at $DIR/retag.rs:+3:13: +3:14 let _8: &mut i32; // in scope 2 at $DIR/retag.rs:+4:13: +4:14 @@ -75,7 +75,7 @@ fn main() -> () { _3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8]; // scope 1 at $DIR/retag.rs:+3:17: +3:36 // mir::Constant // + span: $DIR/retag.rs:33:25: 33:28 - // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value() } + // + literal: Const { ty: for<'a, 'x> fn(&'a Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value() } } bb1: { @@ -114,7 +114,7 @@ fn main() -> () { StorageLive(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6 Deinit(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6 Retag(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6 - _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:+11:31: +14:6 + _13 = move _14 as for<'a> fn(&'a i32) -> &'a i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:+11:31: +14:6 StorageDead(_14); // scope 1 at $DIR/retag.rs:+11:47: +11:48 StorageLive(_15); // scope 6 at $DIR/retag.rs:+15:9: +15:11 StorageLive(_16); // scope 6 at $DIR/retag.rs:+15:14: +15:15 @@ -154,7 +154,7 @@ fn main() -> () { _19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb7]; // scope 7 at $DIR/retag.rs:+18:5: +18:24 // mir::Constant // + span: $DIR/retag.rs:48:13: 48:20 - // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value() } + // + literal: Const { ty: for<'a, 'x> fn(&'a Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value() } } bb4: { diff --git a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir index 7ffd242e0dc3b..ed9f3bdbdf4d6 100644 --- a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir +++ b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir @@ -34,6 +34,6 @@ fn std::ptr::drop_in_place(_1: *mut Vec) -> () { _3 = as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 // mir::Constant // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL - // + literal: Const { ty: for<'r> fn(&'r mut Vec) { as Drop>::drop}, val: Value() } + // + literal: Const { ty: for<'a> fn(&'a mut Vec) { as Drop>::drop}, val: Value() } } } diff --git a/src/test/pretty/issue-4264.pp b/src/test/pretty/issue-4264.pp index 752c36a0fbc5a..1b9ebf75cc49c 100644 --- a/src/test/pretty/issue-4264.pp +++ b/src/test/pretty/issue-4264.pp @@ -32,7 +32,7 @@ ({ let res = ((::alloc::fmt::format as - for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1 + for<'a> fn(Arguments<'a>) -> String {format})(((::core::fmt::Arguments::new_v1 as fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test" as &str)] as [&str; 1]) as &[&str; 1]), diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr index 1a0a5fdf4eb23..bf5f642ca823d 100644 --- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr +++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr @@ -6,7 +6,7 @@ LL | f1(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'r, 's> fn(&'r (), &'s ()) -> _` + = note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `f1` --> $DIR/anonymous-higher-ranked-lifetime.rs:16:25 @@ -22,7 +22,7 @@ LL | f2(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'a, 'r> fn(&'a (), &'r ()) -> _` + = note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `f2` --> $DIR/anonymous-higher-ranked-lifetime.rs:17:25 @@ -38,7 +38,7 @@ LL | f3(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'r> fn(&(), &'r ()) -> _` + = note: expected closure signature `for<'a> fn(&(), &'a ()) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `f3` --> $DIR/anonymous-higher-ranked-lifetime.rs:18:29 @@ -54,7 +54,7 @@ LL | f4(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'r, 's> fn(&'s (), &'r ()) -> _` + = note: expected closure signature `for<'r, 'a> fn(&'a (), &'r ()) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `f4` --> $DIR/anonymous-higher-ranked-lifetime.rs:19:25 @@ -86,7 +86,7 @@ LL | g1(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'r> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _` + = note: expected closure signature `for<'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `g1` --> $DIR/anonymous-higher-ranked-lifetime.rs:23:25 @@ -102,7 +102,7 @@ LL | g2(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'r> fn(&'r (), for<'r> fn(&'r ())) -> _` + = note: expected closure signature `for<'a> fn(&'a (), for<'a> fn(&'a ())) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `g2` --> $DIR/anonymous-higher-ranked-lifetime.rs:24:25 @@ -118,7 +118,7 @@ LL | g3(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _` + = note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `g3` --> $DIR/anonymous-higher-ranked-lifetime.rs:25:25 @@ -134,7 +134,7 @@ LL | g4(|_: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _` + = note: expected closure signature `for<'a> fn(&'a (), for<'r> fn(&'r ())) -> _` found closure signature `fn((), ()) -> _` note: required by a bound in `g4` --> $DIR/anonymous-higher-ranked-lifetime.rs:26:25 @@ -150,7 +150,7 @@ LL | h1(|_: (), _: (), _: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'r, 's> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>, &'s (), for<'r, 's> fn(&'r (), &'s ())) -> _` + = note: expected closure signature `for<'a, 'b> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'b (), for<'a, 'b> fn(&'a (), &'b ())) -> _` found closure signature `fn((), (), (), ()) -> _` note: required by a bound in `h1` --> $DIR/anonymous-higher-ranked-lifetime.rs:29:25 @@ -166,7 +166,7 @@ LL | h2(|_: (), _: (), _: (), _: ()| {}); | | | expected due to this | - = note: expected closure signature `for<'t0, 'r> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>, &'t0 (), for<'r, 's> fn(&'r (), &'s ())) -> _` + = note: expected closure signature `for<'t0, 'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _` found closure signature `fn((), (), (), ()) -> _` note: required by a bound in `h2` --> $DIR/anonymous-higher-ranked-lifetime.rs:30:25 diff --git a/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr b/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr index 8fba766bc8704..85f7d1dd6748b 100644 --- a/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr +++ b/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr @@ -18,7 +18,7 @@ LL | async fn baz(_c: impl FnMut() -> T) where T: Future { | ___________________________________________________________________^ LL | | } | |_^ - = note: required because it captures the following types: `ResumeTy`, `impl for<'r, 's, 't> Future`, `()` + = note: required because it captures the following types: `ResumeTy`, `impl for<'a, 'b, 'c> Future`, `()` note: required because it's used within this `async` block --> $DIR/issue-70935-complex-spans.rs:16:16 | diff --git a/src/test/ui/binop/issue-77910-1.rs b/src/test/ui/binop/issue-77910-1.rs index d786e33585984..95bbd6a60ec86 100644 --- a/src/test/ui/binop/issue-77910-1.rs +++ b/src/test/ui/binop/issue-77910-1.rs @@ -7,5 +7,5 @@ fn main() { // we shouldn't ice with the bound var here. assert_eq!(foo, y); //~^ ERROR binary operation `==` cannot be applied to type - //~| ERROR `for<'r> fn(&'r i32) -> &'r i32 {foo}` doesn't implement `Debug` + //~| ERROR `for<'a> fn(&'a i32) -> &'a i32 {foo}` doesn't implement `Debug` } diff --git a/src/test/ui/binop/issue-77910-1.stderr b/src/test/ui/binop/issue-77910-1.stderr index 097a14f26f868..9c7bf6228be6e 100644 --- a/src/test/ui/binop/issue-77910-1.stderr +++ b/src/test/ui/binop/issue-77910-1.stderr @@ -1,24 +1,24 @@ -error[E0369]: binary operation `==` cannot be applied to type `for<'r> fn(&'r i32) -> &'r i32 {foo}` +error[E0369]: binary operation `==` cannot be applied to type `for<'a> fn(&'a i32) -> &'a i32 {foo}` --> $DIR/issue-77910-1.rs:8:5 | LL | assert_eq!(foo, y); | ^^^^^^^^^^^^^^^^^^ | | - | for<'r> fn(&'r i32) -> &'r i32 {foo} + | for<'a> fn(&'a i32) -> &'a i32 {foo} | _ | = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: `for<'r> fn(&'r i32) -> &'r i32 {foo}` doesn't implement `Debug` +error[E0277]: `for<'a> fn(&'a i32) -> &'a i32 {foo}` doesn't implement `Debug` --> $DIR/issue-77910-1.rs:8:5 | LL | fn foo(s: &i32) -> &i32 { | --- consider calling this function ... LL | assert_eq!(foo, y); - | ^^^^^^^^^^^^^^^^^^ `for<'r> fn(&'r i32) -> &'r i32 {foo}` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | ^^^^^^^^^^^^^^^^^^ `for<'a> fn(&'a i32) -> &'a i32 {foo}` cannot be formatted using `{:?}` because it doesn't implement `Debug` | - = help: the trait `Debug` is not implemented for fn item `for<'r> fn(&'r i32) -> &'r i32 {foo}` + = help: the trait `Debug` is not implemented for fn item `for<'a> fn(&'a i32) -> &'a i32 {foo}` = help: use parentheses to call the function: `foo(s)` = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/binop/issue-77910-2.stderr b/src/test/ui/binop/issue-77910-2.stderr index a334bd8562593..b3856b6ae1681 100644 --- a/src/test/ui/binop/issue-77910-2.stderr +++ b/src/test/ui/binop/issue-77910-2.stderr @@ -1,10 +1,10 @@ -error[E0369]: binary operation `==` cannot be applied to type `for<'r> fn(&'r i32) -> &'r i32 {foo}` +error[E0369]: binary operation `==` cannot be applied to type `for<'a> fn(&'a i32) -> &'a i32 {foo}` --> $DIR/issue-77910-2.rs:7:12 | LL | if foo == y {} | --- ^^ - _ | | - | for<'r> fn(&'r i32) -> &'r i32 {foo} + | for<'a> fn(&'a i32) -> &'a i32 {foo} | help: use parentheses to call this function | diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr index 284fc1c21f5f9..e6ddc60689779 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr @@ -26,7 +26,7 @@ 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)` + found fn pointer `for<'a> fn(&'a u32)` error[E0308]: mismatched types --> $DIR/expect-fn-supply-fn.rs:39:50 @@ -34,7 +34,7 @@ error[E0308]: mismatched types 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)` + = note: expected fn pointer `for<'a> fn(&'a u32)` found fn pointer `fn(&u32)` error[E0308]: mismatched types @@ -43,7 +43,7 @@ error[E0308]: mismatched types 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)` + = note: expected fn pointer `for<'a> fn(&'a u32)` found fn pointer `fn(&u32)` error: aborting due to 5 previous errors diff --git a/src/test/ui/closures/closure-reform-bad.stderr b/src/test/ui/closures/closure-reform-bad.stderr index 9dfff8499fddd..4c40f70b9d0a8 100644 --- a/src/test/ui/closures/closure-reform-bad.stderr +++ b/src/test/ui/closures/closure-reform-bad.stderr @@ -8,7 +8,7 @@ LL | call_bare(f) | | | arguments to this function are incorrect | - = note: expected fn pointer `for<'r> fn(&'r str)` + = note: expected fn pointer `for<'a> fn(&'a str)` found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:22]` note: closures can only be coerced to `fn` types if they do not capture any variables --> $DIR/closure-reform-bad.rs:10:43 diff --git a/src/test/ui/compare-method/issue-90444.stderr b/src/test/ui/compare-method/issue-90444.stderr index 84bbec0623fd8..ee63f34b799a5 100644 --- a/src/test/ui/compare-method/issue-90444.stderr +++ b/src/test/ui/compare-method/issue-90444.stderr @@ -5,10 +5,10 @@ LL | fn from(_: fn((), (), &mut ())) -> Self { | ^^^^^^^^^^^^^^^^^^^ | | | types differ in mutability - | help: change the parameter type to match the trait: `for<'r> fn((), (), &'r ())` + | help: change the parameter type to match the trait: `for<'a> fn((), (), &'a ())` | - = note: expected fn pointer `fn(for<'r> fn((), (), &'r ())) -> A` - found fn pointer `fn(for<'r> fn((), (), &'r mut ())) -> A` + = note: expected fn pointer `fn(for<'a> fn((), (), &'a ())) -> A` + found fn pointer `fn(for<'a> fn((), (), &'a mut ())) -> A` error[E0053]: method `from` has an incompatible type for trait --> $DIR/issue-90444.rs:11:16 diff --git a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr index c5fd58096b7fd..a9a70bb7130cb 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr @@ -9,8 +9,8 @@ LL | do_something(SomeImplementation(), test); LL | fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {} | ------------------------------------------------- found signature defined here | - = note: expected function signature `for<'r> fn(&'r mut std::iter::Empty) -> _` - found function signature `for<'a, 'r> fn(&'r mut <_ as Iterable>::Iterator<'a>) -> _` + = note: expected function signature `for<'a> fn(&'a mut std::iter::Empty) -> _` + found function signature `for<'a, 'b> fn(&'b mut <_ as Iterable>::Iterator<'a>) -> _` note: required by a bound in `do_something` --> $DIR/issue-88382.rs:20:48 | diff --git a/src/test/ui/higher-rank-trait-bounds/issue-30786.stderr b/src/test/ui/higher-rank-trait-bounds/issue-30786.stderr index ffe3d7b81f51e..c1e235441d65d 100644 --- a/src/test/ui/higher-rank-trait-bounds/issue-30786.stderr +++ b/src/test/ui/higher-rank-trait-bounds/issue-30786.stderr @@ -19,7 +19,7 @@ note: the following trait bounds were not satisfied: LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} | --------- - ^^^^^^ unsatisfied trait bound introduced here -error[E0599]: the method `countx` exists for struct `Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>`, but its trait bounds were not satisfied +error[E0599]: the method `countx` exists for struct `Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>`, but its trait bounds were not satisfied --> $DIR/issue-30786.rs:130:24 | LL | pub struct Filter { @@ -29,12 +29,12 @@ 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:129:30: 129:37]>` due to unsatisfied trait bounds + | ^^^^^^ method cannot be called on `Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>` 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:129:30: 129:37]>: Stream` - `&'a mut &mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` - `&'a mut Filter fn(&'r u64) -> &'r u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` + `&'a mut &Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` + `&'a mut &mut Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` + `&'a mut Filter fn(&'a u64) -> &'a u64 {identity::}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream` --> $DIR/issue-30786.rs:96:50 | LL | impl StreamExt for T where for<'a> &'a mut T: Stream {} diff --git a/src/test/ui/higher-rank-trait-bounds/issue-46989.stderr b/src/test/ui/higher-rank-trait-bounds/issue-46989.stderr index 309e1a676edaf..3f874220a2708 100644 --- a/src/test/ui/higher-rank-trait-bounds/issue-46989.stderr +++ b/src/test/ui/higher-rank-trait-bounds/issue-46989.stderr @@ -4,7 +4,7 @@ error: implementation of `Foo` is not general enough 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: `Foo` would have to be implemented for the type `for<'a> fn(&'a 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/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr index eebce827d1cae..4ef96cd954106 100644 --- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr +++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | foo(bar, "string", |s| s.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r, 's> FnOnce<(&'r &'s str,)>` - found trait `for<'r> FnOnce<(&'r &str,)>` + = note: expected trait `for<'a, 'b> FnOnce<(&'a &'b str,)>` + found trait `for<'a> FnOnce<(&'a &str,)>` note: this closure does not fulfill the lifetime requirements --> $DIR/issue-71955.rs:45:24 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | foo(bar, "string", |s| s.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r, 's> FnOnce<(&'r &'s str,)>` - found trait `for<'r> FnOnce<(&'r &str,)>` + = note: expected trait `for<'a, 'b> FnOnce<(&'a &'b str,)>` + found trait `for<'a> FnOnce<(&'a &str,)>` note: this closure does not fulfill the lifetime requirements --> $DIR/issue-71955.rs:45:24 | @@ -42,8 +42,8 @@ error[E0308]: mismatched types LL | foo(baz, "string", |s| s.0.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>` - found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>` + = note: expected trait `for<'a, 'b> FnOnce<(&'a Wrapper<'b>,)>` + found trait `for<'a> FnOnce<(&'a Wrapper<'_>,)>` note: this closure does not fulfill the lifetime requirements --> $DIR/issue-71955.rs:48:24 | @@ -61,8 +61,8 @@ error[E0308]: mismatched types LL | foo(baz, "string", |s| s.0.len() == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>` - found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>` + = note: expected trait `for<'a, 'b> FnOnce<(&'a Wrapper<'b>,)>` + found trait `for<'a> FnOnce<(&'a Wrapper<'_>,)>` note: this closure does not fulfill the lifetime requirements --> $DIR/issue-71955.rs:48:24 | diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs index de9348f539709..c10a0888a4f27 100644 --- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs +++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs @@ -6,7 +6,7 @@ trait SomeTrait<'a> { fn give_me_ice() { callee:: >::Associated>(); - //~^ ERROR the trait bound `for<'r> T: SomeTrait<'r>` is not satisfied [E0277] + //~^ ERROR the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied [E0277] } fn callee>() { diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr index 6a948a116e03b..25a4f6088deba 100644 --- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr +++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr @@ -1,12 +1,12 @@ -error[E0277]: the trait bound `for<'r> T: SomeTrait<'r>` is not satisfied +error[E0277]: the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied --> $DIR/issue-85455.rs:8:5 | LL | callee:: >::Associated>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'r> SomeTrait<'r>` is not implemented for `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> SomeTrait<'a>` is not implemented for `T` | help: consider restricting type parameter `T` | -LL | fn give_me_ice SomeTrait<'r>>() { +LL | fn give_me_ice SomeTrait<'a>>() { | +++++++++++++++++++++++ error: aborting due to previous error diff --git a/src/test/ui/hygiene/impl_items.rs b/src/test/ui/hygiene/impl_items.rs index 37794c6e0773c..ddb25c06b1b17 100644 --- a/src/test/ui/hygiene/impl_items.rs +++ b/src/test/ui/hygiene/impl_items.rs @@ -9,7 +9,7 @@ mod foo { } pub macro m() { - let _: () = S.f(); //~ ERROR type `for<'r> fn(&'r foo::S) {foo::S::f}` is private + let _: () = S.f(); //~ ERROR type `for<'a> fn(&'a foo::S) {foo::S::f}` is private } } diff --git a/src/test/ui/hygiene/impl_items.stderr b/src/test/ui/hygiene/impl_items.stderr index 523309f432504..46a2500386e0f 100644 --- a/src/test/ui/hygiene/impl_items.stderr +++ b/src/test/ui/hygiene/impl_items.stderr @@ -1,4 +1,4 @@ -error: type `for<'r> fn(&'r foo::S) {foo::S::f}` is private +error: type `for<'a> fn(&'a foo::S) {foo::S::f}` is private --> $DIR/impl_items.rs:12:23 | LL | let _: () = S.f(); diff --git a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr index fd2e454e7e455..edf3911e2a097 100644 --- a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr +++ b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied +error[E0277]: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied --> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13 | LL | fn ice() -> impl AsRef { - | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()` + | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()` error: aborting due to previous error diff --git a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr index 8f40922732486..88e2520bf4b24 100644 --- a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr +++ b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr @@ -9,11 +9,11 @@ help: add `dyn` keyword before this trait LL | fn ice() -> impl AsRef { | +++ -error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied +error[E0277]: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied --> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13 | LL | fn ice() -> impl AsRef { - | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()` + | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs index 856dc7a3f5a22..5a922697f6ff9 100644 --- a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs +++ b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs @@ -4,7 +4,7 @@ #![allow(warnings)] fn ice() -> impl AsRef { - //~^ ERROR: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied [E0277] + //~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277] //[edition2021]~| ERROR: trait objects must include the `dyn` keyword [E0782] todo!() } diff --git a/src/test/ui/issues/issue-18919.stderr b/src/test/ui/issues/issue-18919.stderr index d7dbb8299b9ef..b0b03a0eea69e 100644 --- a/src/test/ui/issues/issue-18919.stderr +++ b/src/test/ui/issues/issue-18919.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `dyn for<'r> Fn(&'r isize) -> isize` cannot be known at compilation time +error[E0277]: the size for values of type `dyn for<'a> Fn(&'a isize) -> isize` cannot be known at compilation time --> $DIR/issue-18919.rs:3:15 | LL | fn ho_func(f: Option) { | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `dyn for<'r> Fn(&'r isize) -> isize` + = help: the trait `Sized` is not implemented for `dyn for<'a> Fn(&'a isize) -> isize` note: required by a bound in `Option` --> $DIR/issue-18919.rs:7:13 | diff --git a/src/test/ui/issues/issue-24322.stderr b/src/test/ui/issues/issue-24322.stderr index 1a4fab165405d..1e4c8ac7c356c 100644 --- a/src/test/ui/issues/issue-24322.stderr +++ b/src/test/ui/issues/issue-24322.stderr @@ -6,8 +6,8 @@ LL | let x: &fn(&B) -> u32 = &B::func; | | | expected due to this | - = note: expected reference `&for<'r> fn(&'r B) -> u32` - found reference `&for<'r> fn(&'r B) -> u32 {B::func}` + = note: expected reference `&for<'a> fn(&'a B) -> u32` + found reference `&for<'a> fn(&'a B) -> u32 {B::func}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40000.stderr b/src/test/ui/issues/issue-40000.stderr index e6f0b5fbfba1d..c41fbb9d2ec1d 100644 --- a/src/test/ui/issues/issue-40000.stderr +++ b/src/test/ui/issues/issue-40000.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | foo(bar); | ^^^ one type is more general than the other | - = note: expected trait object `dyn for<'r> Fn(&'r i32)` + = note: expected trait object `dyn for<'a> Fn(&'a i32)` found trait object `dyn Fn(&i32)` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | foo(bar); | ^^^ one type is more general than the other | - = note: expected trait object `dyn for<'r> Fn(&'r i32)` + = note: expected trait object `dyn for<'a> Fn(&'a i32)` found trait object `dyn Fn(&i32)` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-57362-2.stderr b/src/test/ui/issues/issue-57362-2.stderr index 3b6cffeafe4c2..7d08c4643ff2f 100644 --- a/src/test/ui/issues/issue-57362-2.stderr +++ b/src/test/ui/issues/issue-57362-2.stderr @@ -1,11 +1,11 @@ -error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'r> fn(&'r ())`, but its trait bounds were not satisfied +error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied --> $DIR/issue-57362-2.rs:22:25 | LL | let x = ::make_g(); - | ^^^^^^ function or associated item cannot be called on `for<'r> fn(&'r ())` due to unsatisfied trait bounds + | ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: - `for<'r> fn(&'r ()): X` + `for<'a> fn(&'a ()): 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-57362-2.rs:8:1 diff --git a/src/test/ui/lifetimes/issue-79187-2.stderr b/src/test/ui/lifetimes/issue-79187-2.stderr index 9322e617176a1..c5f654b37bf6f 100644 --- a/src/test/ui/lifetimes/issue-79187-2.stderr +++ b/src/test/ui/lifetimes/issue-79187-2.stderr @@ -31,7 +31,7 @@ error[E0308]: mismatched types LL | take_foo(|a| a); | ^^^^^^^^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r> Fn<(&'r i32,)>` + = note: expected trait `for<'a> Fn<(&'a i32,)>` found trait `Fn<(&i32,)>` note: this closure does not fulfill the lifetime requirements --> $DIR/issue-79187-2.rs:8:14 diff --git a/src/test/ui/lifetimes/issue-79187.stderr b/src/test/ui/lifetimes/issue-79187.stderr index 3e75e7fed2cc1..ee6e7b89d5f0e 100644 --- a/src/test/ui/lifetimes/issue-79187.stderr +++ b/src/test/ui/lifetimes/issue-79187.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | thing(f); | ^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r> FnOnce<(&'r u32,)>` + = note: expected trait `for<'a> FnOnce<(&'a u32,)>` found trait `FnOnce<(&u32,)>` note: this closure does not fulfill the lifetime requirements --> $DIR/issue-79187.rs:4:13 diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr index d82b2684cce58..7049f28e2f6eb 100644 --- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr @@ -15,7 +15,7 @@ error[E0308]: mismatched types LL | f(data, identity) | ^^^^^^^^^^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r> Fn<(&'r T,)>` + = note: expected trait `for<'a> Fn<(&'a T,)>` found trait `Fn<(&T,)>` note: the lifetime requirement is introduced here --> $DIR/issue_74400.rs:8:34 diff --git a/src/test/ui/lifetimes/re-empty-in-error.stderr b/src/test/ui/lifetimes/re-empty-in-error.stderr index 72bb0782f4b4f..840707d947081 100644 --- a/src/test/ui/lifetimes/re-empty-in-error.stderr +++ b/src/test/ui/lifetimes/re-empty-in-error.stderr @@ -4,7 +4,7 @@ error: higher-ranked lifetime error LL | foo(&10); | ^^^^^^^^ | - = note: could not prove `for<'b, 'r> &'b (): 'r` + = note: could not prove `for<'b, 'a> &'b (): 'a` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index 71469bfec2d39..92d545b7366e3 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -23,7 +23,7 @@ LL | a.iter().map(|_: &(u16, u16)| 45); | expected due to this | = note: expected closure signature `fn(&(u32, u32)) -> _` - found closure signature `for<'r> fn(&'r (u16, u16)) -> _` + found closure signature `for<'a> fn(&'a (u16, u16)) -> _` note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | diff --git a/src/test/ui/mismatched_types/closure-mismatch.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr index ef76ec63fdaf8..a7ef8fa08923f 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-mismatch.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | baz(|_| ()); | ^^^^^^^^^^^ one type is more general than the other | - = note: expected trait `for<'r> Fn<(&'r (),)>` + = note: expected trait `for<'a> Fn<(&'a (),)>` found trait `Fn<(&(),)>` note: this closure does not fulfill the lifetime requirements --> $DIR/closure-mismatch.rs:8:9 diff --git a/src/test/ui/mismatched_types/fn-variance-1.stderr b/src/test/ui/mismatched_types/fn-variance-1.stderr index eec6d83fe223c..5794e606eeb93 100644 --- a/src/test/ui/mismatched_types/fn-variance-1.stderr +++ b/src/test/ui/mismatched_types/fn-variance-1.stderr @@ -10,7 +10,7 @@ LL | apply(&3, takes_mut); | required by a bound introduced by this call | = note: expected function signature `fn(&{integer}) -> _` - found function signature `for<'r> fn(&'r mut isize) -> _` + found function signature `for<'a> fn(&'a mut isize) -> _` note: required by a bound in `apply` --> $DIR/fn-variance-1.rs:5:37 | @@ -29,7 +29,7 @@ LL | apply(&mut 3, takes_imm); | required by a bound introduced by this call | = note: expected function signature `fn(&mut {integer}) -> _` - found function signature `for<'r> fn(&'r isize) -> _` + found function signature `for<'a> fn(&'a isize) -> _` note: required by a bound in `apply` --> $DIR/fn-variance-1.rs:5:37 | diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index b11ea97d160be..906001ca1e09e 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -6,8 +6,8 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); | | | expected due to this | - = note: expected closure signature `for<'r> fn(&'r &str) -> _` - found closure signature `for<'r> fn(&'r str) -> _` + = note: expected closure signature `for<'a> fn(&'a &str) -> _` + found closure signature `for<'a> fn(&'a str) -> _` note: required by a bound in `filter` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr index 66c99bcdfed0c..d2d26b23d646e 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y); | = note: defining type: test::{closure#0} with closure substs [ i16, - for<'r, 's, 't> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) i32)), + for<'a, 'b, 'c> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) i32)), (), ] diff --git a/src/test/ui/nll/closure-requirements/escape-argument.stderr b/src/test/ui/nll/closure-requirements/escape-argument.stderr index ff4e8e590e5a6..6355d3295247f 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument.stderr @@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y); | = note: defining type: test::{closure#0} with closure substs [ i16, - for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32)), + for<'a, 'b> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32)), (), ] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr index 0d94fca2823e5..5f9724ce3db19 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr @@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| { | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)), + for<'a, 'b> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)), (), ] = note: late-bound region is '_#4r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr index ca4c1a1ee7e76..ec728ebd5adf5 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>)), + for<'a, 'b, 'c, 'd, 'e, 'f> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('f) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr index 6aafbe42c496c..01293379700d2 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr @@ -6,7 +6,7 @@ LL | foo(cell, |cell_a, cell_x| { | = note: defining type: case1::{closure#0} with closure substs [ i32, - for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>)), + for<'a> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>)), (), ] @@ -36,7 +36,7 @@ LL | foo(cell, |cell_a, cell_x| { | = note: defining type: case2::{closure#0} with closure substs [ i32, - for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>)), + for<'a> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>)), (), ] = note: number of external vids: 2 diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index 42404412bf990..ce85b20b344e2 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't, 't0, 't1> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) u32>)), + for<'a, 'b, 'c, 'd, 'e> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) u32>)), (), ] = note: late-bound region is '_#2r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index c74430ea3fc2b..20c7967b78bc9 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>)), + for<'a, 'b, 'c, 'd, 'e, 'f> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('f) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr index be5f1e5ef1a68..f7db5ab1f27a0 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| { | = note: defining type: test::{closure#0} with closure substs [ i16, - for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)), + for<'a, 'b> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr index d18db97be5789..3488edc75e102 100644 --- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr @@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, x, y| { | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)), + for<'a, 'b> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index 1e161757222f2..0dc2d0de98fe7 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't, 't0, 't1> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)), + for<'a, 'b, 'c, 'd, 'e> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)), (), ] = note: late-bound region is '_#2r diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index 622113a875bd6..4c9e026ea522c 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure substs [ i16, - for<'r, 's, 't, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t0) }) u32>)), + for<'a, 'b, 'c, 'd, 'e, 'f> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('f) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>)), (), ] = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr index da89071eabda9..68429142edecd 100644 --- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr +++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr @@ -6,7 +6,7 @@ LL | expect_sig(|a, b| b); // ought to return `a` | = note: defining type: test::{closure#0} with closure substs [ i16, - for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32)) -> &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) i32, + for<'a, 'b> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32)) -> &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) i32, (), ] 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 0ae6b7c1d7f06..6e96f40c0e0d8 100644 --- a/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr +++ b/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr @@ -1,11 +1,11 @@ -error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'r> fn(&'r ())`, but its trait bounds were not satisfied +error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied --> $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 + | ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: - `for<'r> fn(&'r ()): X` + `for<'a> fn(&'a ()): 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:4:1 @@ -13,11 +13,11 @@ note: `X` defines an item `make_g`, perhaps you need to implement it 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 +error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'a> fn(&'a ())` in the current scope --> $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 ())` + | ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())` | = 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 diff --git a/src/test/ui/nll/issue-97997.stderr b/src/test/ui/nll/issue-97997.stderr index 78401bbf6540a..46440c021f543 100644 --- a/src/test/ui/nll/issue-97997.stderr +++ b/src/test/ui/nll/issue-97997.stderr @@ -4,7 +4,7 @@ error: implementation of `Foo` is not general enough LL | ::ASSOC; | ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough | - = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r u8)` + = note: `Foo` would have to be implemented for the type `for<'a> fn(&'a u8)` = note: ...but `Foo` is actually implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0` error: implementation of `Foo` is not general enough @@ -13,7 +13,7 @@ error: implementation of `Foo` is not general enough LL | ::ASSOC; | ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough | - = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r u8)` + = note: `Foo` would have to be implemented for the type `for<'a> fn(&'a u8)` = note: ...but `Foo` is actually implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0` error: aborting due to 2 previous errors 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 8c47379886d2a..b945ffedda5ae 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 @@ -4,7 +4,7 @@ error: implementation of `Y` is not general enough LL | let _x = ::make_f(); | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough | - = note: `Y` would have to be implemented for the type `for<'r> fn(&'r ())` + = note: `Y` would have to be implemented for the type `for<'a> fn(&'a ())` = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0` error: implementation of `Y` is not general enough @@ -13,7 +13,7 @@ error: implementation of `Y` is not general enough LL | let _x = ::make_f(); | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough | - = note: `Y` would have to be implemented for the type `for<'r> fn(&'r ())` + = note: `Y` would have to be implemented for the type `for<'a> fn(&'a ())` = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0` error: implementation of `Y` is not general enough @@ -22,7 +22,7 @@ error: implementation of `Y` is not general enough LL | let _x = ::make_f(); | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough | - = note: `Y` would have to be implemented for the type `for<'r> fn(&'r ())` + = note: `Y` would have to be implemented for the type `for<'a> fn(&'a ())` = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0` error: aborting due to 3 previous errors diff --git a/src/test/ui/nll/relate_tys/universe-violation.stderr b/src/test/ui/nll/relate_tys/universe-violation.stderr index 6f38154e37927..fe801b42c0a49 100644 --- a/src/test/ui/nll/relate_tys/universe-violation.stderr +++ b/src/test/ui/nll/relate_tys/universe-violation.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let b: fn(&u32) -> &u32 = a; | ^ one type is more general than the other | - = note: expected fn pointer `for<'r> fn(&'r u32) -> &'r u32` + = note: expected fn pointer `for<'a> fn(&'a u32) -> &'a u32` found fn pointer `fn(&u32) -> &u32` error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index 5d9a044d107f9..61c7d2550caad 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -6,7 +6,7 @@ LL | twice(cell, value, |a, b| invoke(a, b)); | = note: defining type: generic::::{closure#0} with closure substs [ i16, - for<'r, 's> extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) T)), + for<'a, 'b> extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) T)), (), ] = note: number of external vids: 2 @@ -28,7 +28,7 @@ LL | twice(cell, value, |a, b| invoke(a, b)); | = note: defining type: generic_fail::::{closure#0} with closure substs [ i16, - for<'r, 's> extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) T)), + for<'a, 'b> extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) T)), (), ] = note: late-bound region is '_#2r diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.rs b/src/test/ui/privacy/associated-item-privacy-inherent.rs index c3ae920238f18..7b7c734a99a1c 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.rs +++ b/src/test/ui/privacy/associated-item-privacy-inherent.rs @@ -11,11 +11,11 @@ mod priv_nominal { pub macro mac() { let value = Pub::method; - //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private value; - //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private Pub.method(); - //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private Pub::CONST; //~^ ERROR associated constant `CONST` is private // let _: Pub::AssocTy; diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.stderr b/src/test/ui/privacy/associated-item-privacy-inherent.stderr index 4478e5c2aba57..f4d4ee459204d 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.stderr +++ b/src/test/ui/privacy/associated-item-privacy-inherent.stderr @@ -1,4 +1,4 @@ -error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private +error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:13:21 | LL | let value = Pub::method; @@ -9,7 +9,7 @@ LL | priv_nominal::mac!(); | = note: this error originates in the macro `priv_nominal::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private +error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:15:9 | LL | value; @@ -20,7 +20,7 @@ LL | priv_nominal::mac!(); | = note: this error originates in the macro `priv_nominal::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private +error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:17:13 | LL | Pub.method(); diff --git a/src/test/ui/privacy/associated-item-privacy-trait.rs b/src/test/ui/privacy/associated-item-privacy-trait.rs index c07aeed99c74a..ad9a5e15c4e6e 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.rs +++ b/src/test/ui/privacy/associated-item-privacy-trait.rs @@ -13,11 +13,11 @@ mod priv_trait { pub macro mac() { let value = ::method; - //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private value; - //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private Pub.method(); - //~^ ERROR type `for<'r> fn(&'r Self) {::method}` is private + //~^ ERROR type `for<'a> fn(&'a Self) {::method}` is private ::CONST; //~^ ERROR associated constant `::CONST` is private let _: ::AssocTy; diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/src/test/ui/privacy/associated-item-privacy-trait.stderr index 6095f5f42b86d..c4be1a9d9a202 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.stderr +++ b/src/test/ui/privacy/associated-item-privacy-trait.stderr @@ -1,4 +1,4 @@ -error: type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private +error: type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:15:21 | LL | let value = ::method; @@ -9,7 +9,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private +error: type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:17:9 | LL | value; @@ -20,7 +20,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r Self) {::method}` is private +error: type `for<'a> fn(&'a Self) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:19:13 | LL | Pub.method(); diff --git a/src/test/ui/privacy/private-inferred-type-3.rs b/src/test/ui/privacy/private-inferred-type-3.rs index 00f0a715a836d..0337aedd00881 100644 --- a/src/test/ui/privacy/private-inferred-type-3.rs +++ b/src/test/ui/privacy/private-inferred-type-3.rs @@ -6,7 +6,7 @@ // error-pattern:type `fn() {::method}` is private // error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private // error-pattern:type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private -// error-pattern:type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private +// error-pattern:type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private #![feature(decl_macro)] diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/src/test/ui/privacy/private-inferred-type-3.stderr index f9dd1c3d03509..00b61512de6b4 100644 --- a/src/test/ui/privacy/private-inferred-type-3.stderr +++ b/src/test/ui/privacy/private-inferred-type-3.stderr @@ -46,7 +46,7 @@ LL | ext::m!(); | = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private +error: type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); diff --git a/src/test/ui/privacy/private-inferred-type.rs b/src/test/ui/privacy/private-inferred-type.rs index b083a3970d6b9..e8743dd968feb 100644 --- a/src/test/ui/privacy/private-inferred-type.rs +++ b/src/test/ui/privacy/private-inferred-type.rs @@ -47,7 +47,7 @@ mod m { PubTupleStruct; //~^ ERROR type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private Pub(0u8).priv_method(); - //~^ ERROR type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private + //~^ ERROR type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private } trait Trait {} diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/src/test/ui/privacy/private-inferred-type.stderr index aecd8b58c8311..fc3f9ab62bfa9 100644 --- a/src/test/ui/privacy/private-inferred-type.stderr +++ b/src/test/ui/privacy/private-inferred-type.stderr @@ -161,7 +161,7 @@ LL | m::m!(); | = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private +error: type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private --> $DIR/private-inferred-type.rs:49:18 | LL | Pub(0u8).priv_method(); diff --git a/src/test/ui/regions/issue-101280.stderr b/src/test/ui/regions/issue-101280.stderr index 3ce08966326d0..320d008aeff2f 100644 --- a/src/test/ui/regions/issue-101280.stderr +++ b/src/test/ui/regions/issue-101280.stderr @@ -7,7 +7,7 @@ LL | f | ^ one type is more general than the other | = note: expected fn pointer `for<'r> fn(Cell<(&'r i32, &'r i32)>)` - found fn pointer `for<'s> fn(Cell<(&'r i32, &'s i32)>)` + found fn pointer `for<'a> fn(Cell<(&'r i32, &'a i32)>)` error: aborting due to previous error diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr index 20c0c9f4514d7..3b62c7b61c1b1 100644 --- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr +++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ one type is more general than the other | - = note: expected fn pointer `for<'r, 's, 't, 't0> fn(&'r mut &'s isize, &'t mut &'t0 isize)` - found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)` + found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr index 676b0904ebfa4..8a18a234b5c4e 100644 --- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr +++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types 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, 't, 't0, 't1, 't2> fn(&'r mut &'s isize, &'t mut &'t0 isize, &'t1 mut &'t2 isize)` - found fn item `for<'r, 's, 't> fn(&'r mut &isize, &'s mut &isize, &'t mut &isize) {a::<'_, '_, '_>}` + = note: expected fn pointer `for<'a, 'b, 'c, 'd, 'e, 'f> fn(&'a mut &'b isize, &'c mut &'d isize, &'e mut &'f isize)` + found fn item `for<'a, 'b, 'c> fn(&'a mut &isize, &'b mut &isize, &'c mut &isize) {a::<'_, '_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr index d87d0d2f6f991..8d82ff958ff3a 100644 --- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr +++ b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr @@ -7,7 +7,7 @@ LL | want_G(baz); | 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}` + found fn item `for<'a> fn(&'a S) -> &'a S {baz}` note: function defined here --> $DIR/regions-fn-subtyping-return-static-fail.rs:20:4 | diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr index e02bed707dca4..17a9019436a1e 100644 --- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr +++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ one type is more general than the other | - = note: expected fn pointer `for<'r, 's, 't, 't0> fn(&'r mut &'s isize, &'t mut &'t0 isize)` - found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)` + found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/rfc1623-2.stderr b/src/test/ui/rfc1623-2.stderr index 495d45e223416..945c6533c797b 100644 --- a/src/test/ui/rfc1623-2.stderr +++ b/src/test/ui/rfc1623-2.stderr @@ -23,7 +23,7 @@ help: consider making the type lifetime-generic with a new `'a` lifetime LL | &(non_elidable as for<'a> fn(&'a u8, &'a u8) -> &'a u8); | +++++++ ++ ++ ++ -error[E0605]: non-primitive cast: `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {non_elidable}` as `for<'r, 's> fn(&'r u8, &'s u8) -> &u8` +error[E0605]: non-primitive cast: `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {non_elidable}` as `for<'a, 'b> fn(&'a u8, &'b u8) -> &u8` --> $DIR/rfc1623-2.rs:10:6 | LL | &(non_elidable as fn(&u8, &u8) -> &u8); diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr index 3c7b895e337e7..f05dba1d4ca7e 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -220,7 +220,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:41:20 | LL | fn ban(&self) -> usize { 42 } - | ---------------------- for<'r> fn(&'r X) -> usize {::ban} defined here + | ---------------------- for<'a> fn(&'a X) -> usize {::ban} defined here ... LL | let _: usize = X::ban; | ----- ^^^^^^ expected `usize`, found fn item @@ -228,7 +228,7 @@ LL | let _: usize = X::ban; | expected due to this | = note: expected type `usize` - found fn item `for<'r> fn(&'r X) -> usize {::ban}` + found fn item `for<'a> fn(&'a X) -> usize {::ban}` help: use parentheses to call this associated function | LL | let _: usize = X::ban(/* &X */); @@ -238,7 +238,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:42:20 | LL | fn bal(&self) -> usize; - | ----------------------- for<'r> fn(&'r X) -> usize {::bal} defined here + | ----------------------- for<'a> fn(&'a X) -> usize {::bal} defined here ... LL | let _: usize = X::bal; | ----- ^^^^^^ expected `usize`, found fn item @@ -246,7 +246,7 @@ LL | let _: usize = X::bal; | expected due to this | = note: expected type `usize` - found fn item `for<'r> fn(&'r X) -> usize {::bal}` + found fn item `for<'a> fn(&'a X) -> usize {::bal}` help: use parentheses to call this associated function | LL | let _: usize = X::bal(/* &X */); diff --git a/src/test/ui/suggestions/return-closures.stderr b/src/test/ui/suggestions/return-closures.stderr index e273793ea2c29..8b856d8de7033 100644 --- a/src/test/ui/suggestions/return-closures.stderr +++ b/src/test/ui/suggestions/return-closures.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/return-closures.rs:3:5 | LL | fn foo() { - | - help: try adding a return type: `-> impl for<'r> Fn(&'r i32) -> i32` + | - help: try adding a return type: `-> impl for<'a> Fn(&'a i32) -> i32` LL | LL | |x: &i32| 1i32 | ^^^^^^^^^^^^^^ expected `()`, found closure diff --git a/src/test/ui/symbol-names/impl1.legacy.stderr b/src/test/ui/symbol-names/impl1.legacy.stderr index b6012e41594b5..3d438df92b85d 100644 --- a/src/test/ui/symbol-names/impl1.legacy.stderr +++ b/src/test/ui/symbol-names/impl1.legacy.stderr @@ -64,7 +64,7 @@ error: demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::A LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: def-path(<[&dyn Foo extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) +error: def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:69:13 | LL | #[rustc_def_path] diff --git a/src/test/ui/symbol-names/impl1.rs b/src/test/ui/symbol-names/impl1.rs index 86f0a8b0bef4d..629c2f33ddcc6 100644 --- a/src/test/ui/symbol-names/impl1.rs +++ b/src/test/ui/symbol-names/impl1.rs @@ -67,8 +67,8 @@ fn main() { //[v0]~| ERROR demangling(<[&dyn //[v0]~| ERROR demangling-alt(<[&dyn impl1::Foo extern "C" fn(&'a u8, ...)> + impl1::AutoTrait; 3] as impl1::main::{closure#1}::Bar>::method) #[rustc_def_path] - //[legacy]~^ ERROR def-path(<[&dyn Foo extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) - //[v0]~^^ ERROR def-path(<[&dyn Foo extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) + //[legacy]~^ ERROR def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) + //[v0]~^^ ERROR def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) fn method(&self) {} } }; diff --git a/src/test/ui/symbol-names/impl1.v0.stderr b/src/test/ui/symbol-names/impl1.v0.stderr index 48f7473b6a0d1..33caad71f52fe 100644 --- a/src/test/ui/symbol-names/impl1.v0.stderr +++ b/src/test/ui/symbol-names/impl1.v0.stderr @@ -64,7 +64,7 @@ error: demangling-alt(<[&dyn impl1::Foo extern "C" fn(&'a u8, .. LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: def-path(<[&dyn Foo extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) +error: def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:69:13 | LL | #[rustc_def_path] diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr index 4084f69a6f04b..10e82c54e0f2b 100644 --- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr +++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr @@ -4,7 +4,7 @@ error[E0277]: expected a `FnOnce<(&i32,)>` closure, found `i32` LL | f:: X<'x, F = i32>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32` | - = help: the trait `for<'r> FnOnce<(&'r i32,)>` is not implemented for `i32` + = help: the trait `for<'a> FnOnce<(&'a i32,)>` is not implemented for `i32` note: required by a bound in `f` --> $DIR/check-trait-object-bounds-2.rs:8:9 | diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr index f14bf6b0f7f5c..6344f114a9131 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | |x| x | ^^^^^ one type is more general than the other | - = note: expected trait `for<'r> Fn<(&'r X,)>` + = note: expected trait `for<'a> Fn<(&'a X,)>` found trait `Fn<(&X,)>` note: this closure does not fulfill the lifetime requirements --> $DIR/issue-57611-trait-alias.rs:21:9 diff --git a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr index 9833304c636b1..802696e1b2f94 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` +error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21 | LL | let x = call_it(&square, 22); @@ -6,7 +6,7 @@ LL | let x = call_it(&square, 22); | | | required by a bound introduced by this call | - = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}` + = help: the trait `for<'a> Fn<(&'a isize,)>` is not implemented for fn item `for<'a> unsafe fn(&'a isize) -> isize {square}` = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `call_it` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15 @@ -14,7 +14,7 @@ note: required by a bound in `call_it` LL | fn call_it isize>(_: &F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` -error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` +error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25 | LL | let y = call_it_mut(&mut square, 22); @@ -22,7 +22,7 @@ LL | let y = call_it_mut(&mut square, 22); | | | required by a bound introduced by this call | - = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}` + = help: the trait `for<'a> FnMut<(&'a isize,)>` is not implemented for fn item `for<'a> unsafe fn(&'a isize) -> isize {square}` = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `call_it_mut` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19 @@ -30,7 +30,7 @@ note: required by a bound in `call_it_mut` LL | fn call_it_mut isize>(_: &mut F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` -error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` +error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26 | LL | let z = call_it_once(square, 22); @@ -38,7 +38,7 @@ LL | let z = call_it_once(square, 22); | | | required by a bound introduced by this call | - = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}` + = help: the trait `for<'a> FnOnce<(&'a isize,)>` is not implemented for fn item `for<'a> unsafe fn(&'a isize) -> isize {square}` = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `call_it_once` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20 diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr index 54c92e0cd040c..0bbb9836c5840 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr @@ -1,42 +1,42 @@ -error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` +error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-abi.rs:20:21 | LL | let x = call_it(&square, 22); - | ------- ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` + | ------- ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | | | required by a bound introduced by this call | - = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for fn item `for<'r> extern "C" fn(&'r isize) -> isize {square}` + = help: the trait `for<'a> Fn<(&'a isize,)>` is not implemented for fn item `for<'a> extern "C" fn(&'a isize) -> isize {square}` note: required by a bound in `call_it` --> $DIR/unboxed-closures-wrong-abi.rs:9:15 | LL | fn call_it isize>(_: &F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` -error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` +error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-abi.rs:25:25 | LL | let y = call_it_mut(&mut square, 22); - | ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` + | ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | | | required by a bound introduced by this call | - = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for fn item `for<'r> extern "C" fn(&'r isize) -> isize {square}` + = help: the trait `for<'a> FnMut<(&'a isize,)>` is not implemented for fn item `for<'a> extern "C" fn(&'a isize) -> isize {square}` note: required by a bound in `call_it_mut` --> $DIR/unboxed-closures-wrong-abi.rs:12:19 | LL | fn call_it_mut isize>(_: &mut F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` -error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` +error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-abi.rs:30:26 | LL | let z = call_it_once(square, 22); - | ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` + | ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | | | required by a bound introduced by this call | - = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for fn item `for<'r> extern "C" fn(&'r isize) -> isize {square}` + = help: the trait `for<'a> FnOnce<(&'a isize,)>` is not implemented for fn item `for<'a> extern "C" fn(&'a isize) -> isize {square}` note: required by a bound in `call_it_once` --> $DIR/unboxed-closures-wrong-abi.rs:15:20 | diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr index 2fedb5b92c289..31a66790ce089 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr @@ -6,7 +6,7 @@ LL | let x = call_it(&square, 22); | | | required by a bound introduced by this call | - = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}` + = help: the trait `for<'a> Fn<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}` = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `call_it` --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:10:15 @@ -22,7 +22,7 @@ LL | let y = call_it_mut(&mut square, 22); | | | required by a bound introduced by this call | - = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}` + = help: the trait `for<'a> FnMut<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}` = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `call_it_mut` --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:19 @@ -38,7 +38,7 @@ LL | let z = call_it_once(square, 22); | | | required by a bound introduced by this call | - = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}` + = help: the trait `for<'a> FnOnce<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}` = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `call_it_once` --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:16:20 From ba5f05b1c4cd3a3db4f1f526a911cf76f815c6a2 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 20 Sep 2022 12:07:35 -0700 Subject: [PATCH 07/10] rustdoc: remove unnecessary `max-width` on headers This code was added in 003b2bc1c65251ec2fc80b78ed91c43fb35402ec to prevent these headers from overlapping `.out-of-band` side items. That stopped being a problem when 3f92ff34b5a2fe8dd1a32aa27d437519e63782f0 switched rustdoc over to using `float`, rather than `position: absolute`, to implement this. --- src/librustdoc/html/static/css/rustdoc.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index e985e6c43ade9..c2875f126078d 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -674,7 +674,6 @@ h2.location a { } .method > .code-header, .trait-impl > .code-header { - max-width: calc(100% - 41px); display: block; } From f528d49c23c8d1f50152cbbebe0f1920136fa956 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 21 Sep 2022 17:29:47 -0700 Subject: [PATCH 08/10] rustdoc: update test case for headers without max-width --- src/test/rustdoc-gui/notable-trait.goml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/rustdoc-gui/notable-trait.goml b/src/test/rustdoc-gui/notable-trait.goml index 69088a0774fc4..7eb00d825a5c3 100644 --- a/src/test/rustdoc-gui/notable-trait.goml +++ b/src/test/rustdoc-gui/notable-trait.goml @@ -83,7 +83,7 @@ assert-position: ( ) // Checking on very small mobile. The `i` should be on its own line. -size: (410, 600) +size: (365, 600) compare-elements-position-false: ( "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", From d0a07495be4906db5028a605f650aafeabee1879 Mon Sep 17 00:00:00 2001 From: Dan Johnson Date: Thu, 18 Aug 2022 16:27:16 -0700 Subject: [PATCH 09/10] Split out async_fn_in_trait into a separate feature PR #101224 added support for async fn in trait desuraging behind the return_position_impl_trait_in_trait feature. Split this out so that it's behind its own feature gate, since async fn in trait doesn't need to follow the same stabilization schedule. --- compiler/rustc_ast_lowering/src/lib.rs | 23 +++++++--- compiler/rustc_feature/src/active.rs | 2 + compiler/rustc_span/src/symbol.rs | 1 + src/test/ui/async-await/async-trait-fn.stderr | 6 +-- .../edition-deny-async-fns-2015.stderr | 2 +- .../feature-gate-async_fn_in_trait.rs | 25 +++++++++++ .../feature-gate-async_fn_in_trait.stderr | 42 +++++++++++++++++++ .../ui/async-await/issues/issue-95307.stderr | 2 +- ...ate-return_position_impl_trait_in_trait.rs | 13 ++++++ ...return_position_impl_trait_in_trait.stderr | 22 +++++++++- .../ui/parser/fn-header-semantic-fail.stderr | 8 ++-- ...0736-async-fn-no-body-def-collector.stderr | 4 +- ...incompatible-closure-captures-93117.stderr | 2 +- 13 files changed, 133 insertions(+), 19 deletions(-) create mode 100644 src/test/ui/async-await/feature-gate-async_fn_in_trait.rs create mode 100644 src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index e9c05eb5f455f..a11721ba0213a 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -332,6 +332,15 @@ impl FnDeclKind { _ => false, } } + + fn async_fn_allowed(&self, tcx: TyCtxt<'_>) -> bool { + match self { + FnDeclKind::Fn | FnDeclKind::Inherent => true, + FnDeclKind::Impl if tcx.features().async_fn_in_trait => true, + FnDeclKind::Trait if tcx.features().async_fn_in_trait => true, + _ => false, + } + } } #[derive(Copy, Clone)] @@ -1692,14 +1701,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { })); let output = if let Some((ret_id, span)) = make_ret_async { - if !kind.impl_trait_allowed(self.tcx) { + if !kind.async_fn_allowed(self.tcx) { match kind { FnDeclKind::Trait | FnDeclKind::Impl => { self.tcx .sess .create_feature_err( TraitFnAsync { fn_span, span }, - sym::return_position_impl_trait_in_trait, + sym::async_fn_in_trait, ) .emit(); } @@ -1917,9 +1926,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let future_bound = this.lower_async_fn_output_type_to_future_bound( output, span, - ImplTraitContext::ReturnPositionOpaqueTy { - origin: hir::OpaqueTyOrigin::FnReturn(fn_def_id), - in_trait, + if in_trait && !this.tcx.features().return_position_impl_trait_in_trait { + ImplTraitContext::Disallowed(ImplTraitPosition::TraitReturn) + } else { + ImplTraitContext::ReturnPositionOpaqueTy { + origin: hir::OpaqueTyOrigin::FnReturn(fn_def_id), + in_trait, + } }, ); diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index ad28595ca82b3..4c891fbf16e94 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -312,6 +312,8 @@ declare_features! ( (active, associated_type_defaults, "1.2.0", Some(29661), None), /// Allows `async || body` closures. (active, async_closure, "1.37.0", Some(62290), None), + /// Alows async functions to be declared, implemented, and used in traits. + (incomplete, async_fn_in_trait, "CURRENT_RUSTC_VERSION", Some(91611), None), /// Allows `extern "C-unwind" fn` to enable unwinding across ABI boundaries. (active, c_unwind, "1.52.0", Some(74990), None), /// Allows using C-variadics. diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 7785d29c15f2c..502ef67fc6767 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -396,6 +396,7 @@ symbols! { assume_init, async_await, async_closure, + async_fn_in_trait, atomic, atomic_mod, atomics, diff --git a/src/test/ui/async-await/async-trait-fn.stderr b/src/test/ui/async-await/async-trait-fn.stderr index e5c584e31e815..4fa54c6e36960 100644 --- a/src/test/ui/async-await/async-trait-fn.stderr +++ b/src/test/ui/async-await/async-trait-fn.stderr @@ -9,7 +9,7 @@ LL | async fn foo() {} = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0706]: functions in traits cannot be declared `async` --> $DIR/async-trait-fn.rs:5:5 @@ -22,7 +22,7 @@ LL | async fn bar(&self) {} = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0706]: functions in traits cannot be declared `async` --> $DIR/async-trait-fn.rs:7:5 @@ -35,7 +35,7 @@ LL | async fn baz() { = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0308]: mismatched types --> $DIR/async-trait-fn.rs:3:20 diff --git a/src/test/ui/async-await/edition-deny-async-fns-2015.stderr b/src/test/ui/async-await/edition-deny-async-fns-2015.stderr index 8c2902d9b00d1..62a243e69e743 100644 --- a/src/test/ui/async-await/edition-deny-async-fns-2015.stderr +++ b/src/test/ui/async-await/edition-deny-async-fns-2015.stderr @@ -90,7 +90,7 @@ LL | async fn foo() {} = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0308]: mismatched types --> $DIR/edition-deny-async-fns-2015.rs:18:20 diff --git a/src/test/ui/async-await/feature-gate-async_fn_in_trait.rs b/src/test/ui/async-await/feature-gate-async_fn_in_trait.rs new file mode 100644 index 0000000000000..792f378cb57f1 --- /dev/null +++ b/src/test/ui/async-await/feature-gate-async_fn_in_trait.rs @@ -0,0 +1,25 @@ +// edition:2021 + +// RPITIT is not enough to allow use of async functions +#![allow(incomplete_features)] +#![feature(return_position_impl_trait_in_trait)] + +trait T { + async fn foo(); //~ ERROR functions in traits cannot be declared `async` +} + +// Both return_position_impl_trait_in_trait and async_fn_in_trait are required for this (see also +// feature-gate-return_position_impl_trait_in_trait.rs) +trait T2 { + async fn foo() -> impl Sized; //~ ERROR functions in traits cannot be declared `async` +} + +trait T3 { + fn foo() -> impl std::future::Future; +} + +impl T3 for () { + async fn foo() {} //~ ERROR functions in traits cannot be declared `async` +} + +fn main() {} diff --git a/src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr b/src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr new file mode 100644 index 0000000000000..2a5fbd1ecd03d --- /dev/null +++ b/src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr @@ -0,0 +1,42 @@ +error[E0706]: functions in traits cannot be declared `async` + --> $DIR/feature-gate-async_fn_in_trait.rs:8:5 + | +LL | async fn foo(); + | -----^^^^^^^^^^ + | | + | `async` because of this + | + = note: `async` trait functions are not currently supported + = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait + = note: see issue #91611 for more information + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable + +error[E0706]: functions in traits cannot be declared `async` + --> $DIR/feature-gate-async_fn_in_trait.rs:14:5 + | +LL | async fn foo() -> impl Sized; + | -----^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | `async` because of this + | + = note: `async` trait functions are not currently supported + = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait + = note: see issue #91611 for more information + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable + +error[E0706]: functions in traits cannot be declared `async` + --> $DIR/feature-gate-async_fn_in_trait.rs:22:5 + | +LL | async fn foo() {} + | -----^^^^^^^^^ + | | + | `async` because of this + | + = note: `async` trait functions are not currently supported + = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait + = note: see issue #91611 for more information + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0706`. diff --git a/src/test/ui/async-await/issues/issue-95307.stderr b/src/test/ui/async-await/issues/issue-95307.stderr index 1c12f1e4862e8..a497cebe3c3d8 100644 --- a/src/test/ui/async-await/issues/issue-95307.stderr +++ b/src/test/ui/async-await/issues/issue-95307.stderr @@ -9,7 +9,7 @@ LL | async fn new() -> [u8; _]; = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error: in expressions, `_` can only be used on the left-hand side of an assignment --> $DIR/issue-95307.rs:7:28 diff --git a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs index de7966c66b057..637765fff11e4 100644 --- a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs +++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs @@ -1,5 +1,18 @@ +// edition:2021 + +// async_fn_in_trait is not enough to allow use of RPITIT +#![allow(incomplete_features)] +#![feature(async_fn_in_trait)] + trait Foo { fn bar() -> impl Sized; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return + fn baz() -> Box; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return +} + +// Both return_position_impl_trait_in_trait and async_fn_in_trait are required for this (see also +// feature-gate-async_fn_in_trait.rs) +trait AsyncFoo { + async fn bar() -> impl Sized; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return } fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr index 36177bbe15830..aeabed4a6ab66 100644 --- a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr +++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr @@ -1,5 +1,5 @@ error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return - --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:2:17 + --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:8:17 | LL | fn bar() -> impl Sized; | ^^^^^^^^^^ @@ -7,6 +7,24 @@ LL | fn bar() -> impl Sized; = note: see issue #91611 for more information = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable -error: aborting due to previous error +error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return + --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:9:21 + | +LL | fn baz() -> Box; + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #91611 for more information + = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + +error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return + --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:15:23 + | +LL | async fn bar() -> impl Sized; + | ^^^^^^^^^^ + | + = note: see issue #91611 for more information + = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0562`. diff --git a/src/test/ui/parser/fn-header-semantic-fail.stderr b/src/test/ui/parser/fn-header-semantic-fail.stderr index 36304779df36f..800b5a43a0066 100644 --- a/src/test/ui/parser/fn-header-semantic-fail.stderr +++ b/src/test/ui/parser/fn-header-semantic-fail.stderr @@ -147,7 +147,7 @@ LL | async fn ft1(); = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0706]: functions in traits cannot be declared `async` --> $DIR/fn-header-semantic-fail.rs:21:9 @@ -160,7 +160,7 @@ LL | const async unsafe extern "C" fn ft5(); = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0706]: functions in traits cannot be declared `async` --> $DIR/fn-header-semantic-fail.rs:29:9 @@ -173,7 +173,7 @@ LL | async fn ft1() {} = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0706]: functions in traits cannot be declared `async` --> $DIR/fn-header-semantic-fail.rs:33:9 @@ -186,7 +186,7 @@ LL | const async unsafe extern "C" fn ft5() {} = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0391]: cycle detected when computing type of `main::ff5::{opaque#0}` --> $DIR/fn-header-semantic-fail.rs:12:44 diff --git a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr index 55c3b66f1363d..1354abb4f144b 100644 --- a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr +++ b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr @@ -33,7 +33,7 @@ LL | async fn associated(); = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0706]: functions in traits cannot be declared `async` --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:5 @@ -46,7 +46,7 @@ LL | async fn associated(); = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error: aborting due to 5 previous errors diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr index 3814c568e72c1..2c1fa7b36b60e 100644 --- a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr +++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr @@ -51,7 +51,7 @@ LL | trait C{async fn new(val: T) {} = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 for more information - = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable warning: changes to closure capture in Rust 2021 will affect drop order --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:57 From e572d513bd2ca1743d141ccee91563d6faf2e19f Mon Sep 17 00:00:00 2001 From: Luca Palmieri Date: Tue, 20 Sep 2022 11:36:36 +0200 Subject: [PATCH 10/10] Distribute rust-json-docs via rustup. --- src/bootstrap/dist.rs | 14 ++++---------- src/tools/build-manifest/src/main.rs | 5 ++++- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index c9ee3c1c7d65d..3aff60b03a8be 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -98,29 +98,23 @@ impl Step for JsonDocs { fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = run.builder.config.docs; - run.alias("rust-json-docs").default_condition(default) + run.alias("rust-docs-json").default_condition(default) } fn make_run(run: RunConfig<'_>) { run.builder.ensure(JsonDocs { host: run.target }); } - /// Builds the `rust-json-docs` installer component. + /// Builds the `rust-docs-json` installer component. fn run(self, builder: &Builder<'_>) -> Option { - // This prevents JSON docs from being built for "dist" or "install" - // on the stable/beta channels. The JSON format is not stable yet and - // should not be included in stable/beta toolchains. - if !builder.build.unstable_features() { - return None; - } - let host = self.host; builder.ensure(crate::doc::JsonStd { stage: builder.top_stage, target: host }); let dest = "share/doc/rust/json"; - let mut tarball = Tarball::new(builder, "rust-json-docs", &host.triple); + let mut tarball = Tarball::new(builder, "rust-docs-json", &host.triple); tarball.set_product_name("Rust Documentation In JSON Format"); + tarball.is_preview(true); tarball.add_bulk_dir(&builder.json_doc_out(host), dest); Some(tarball.generate()) } diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 1a6760d8c68b9..62d6ea4a64221 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -184,7 +184,7 @@ static PKG_INSTALLERS: &[&str] = &["x86_64-apple-darwin", "aarch64-apple-darwin" static MINGW: &[&str] = &["i686-pc-windows-gnu", "x86_64-pc-windows-gnu"]; -static NIGHTLY_ONLY_COMPONENTS: &[&str] = &["miri-preview"]; +static NIGHTLY_ONLY_COMPONENTS: &[&str] = &["miri-preview", "rust-docs-json-preview"]; macro_rules! t { ($e:expr) => { @@ -318,6 +318,7 @@ impl Builder { package!("rust-mingw", MINGW); package!("rust-std", TARGETS); self.package("rust-docs", &mut manifest.pkg, HOSTS, DOCS_FALLBACK); + self.package("rust-docs-json-preview", &mut manifest.pkg, HOSTS, DOCS_FALLBACK); package!("rust-src", &["*"]); package!("rls-preview", HOSTS); package!("rust-analyzer-preview", HOSTS); @@ -403,6 +404,7 @@ impl Builder { rename("rustfmt", "rustfmt-preview"); rename("clippy", "clippy-preview"); rename("miri", "miri-preview"); + rename("rust-docs-json", "rust-docs-json-preview"); rename("rust-analyzer", "rust-analyzer-preview"); } @@ -459,6 +461,7 @@ impl Builder { host_component("rustfmt-preview"), host_component("llvm-tools-preview"), host_component("rust-analysis"), + host_component("rust-docs-json"), ]); extensions.extend(