Change:
This is an attempt to reproduce a minimal example of a regression problem (backwards compatibility not assured) from a closed-source company codebase. I tried this code: - I expected to see the code building (This code is old and was building for years on rust 1.54, and builds on rust 1.63. the code works as intended in the proprietary codebase) Instead, this happened: It most recently worked on: 1.63 (from my repo, commit : ) It does not work anymore on version 1.64: (from my repo, commit : ) Including the backtrace by setting does not change anything to the error message. I do not know why this problem occured though. modify labels: +regression-from-stable-to-{channel} -regression-untriaged --
searched nightlies: from nightly-2022-08-01 to nightly-2022-10-01 regressed nightly: nightly-2022-08-11 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.4</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailsOut of the rollup, this was probably caused by ?
WG-prioritization assigning priority (). label -I-prioritize +P-critical
Reopening to track backports.
can this be closed? was backported to stable, right? cc (unsure who to ping)
I have no involvement with this whatsoever.^^ is usually doing backports.
was beta backported to 1.65, which is now released. We won't be having a 1.64.1 release. So this should be considered "fixed", since it is resolved on the current stable release of Rust.

Discussion:
} /// Given the id of some node in the AST, finds the `LocalDefId` associated with it by the name <ins> /// resolver (if any). fn orig_opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> { self.resolver.node_id_to_def_id.get(&node).map(|local_def_id| *local_def_id) } fn orig_local_def_id(&self, node: NodeId) -> LocalDefId { self.orig_opt_local_def_id(node) .unwrap_or_else(|| panic!("no entry for node id: `{:?}`", node)) } /// Given the id of some node in the AST, finds the `LocalDefId` associated with it by the name </ins> /// resolver (if any), after applying any remapping from `get_remapped_def_id`. /// /// For example, in a function like `fn foo<'a>(x: &'a u32)`,

/// we would create an opaque type `type FooReturn<'a1> = impl Debug + 'a1`. /// When lowering the `Debug + 'a` bounds, we add a remapping to map `'a` to `'a1`. fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> { <del> self.resolver .node_id_to_def_id .get(&node) .map(|local_def_id| self.get_remapped_def_id(*local_def_id)) </del> <ins> self.orig_opt_local_def_id(node).map(|local_def_id| self.get_remapped_def_id(local_def_id)) </ins> } fn local_def_id(&self, node: NodeId) -> LocalDefId {

/// Get the previously recorded `to` local def id given the `from` local def id, obtained using /// `generics_def_id_map` field. <del> fn get_remapped_def_id(&self, mut local_def_id: LocalDefId) -> LocalDefId { </del> <ins> fn get_remapped_def_id(&self, local_def_id: LocalDefId) -> LocalDefId { </ins> // `generics_def_id_map` is a stack of mappings. As we go deeper in impl traits nesting we <del> // push new mappings so we need to try first the latest mappings, hence `iter().rev()`. </del> <ins> // push new mappings, so we first need to get the latest (innermost) mappings, hence `iter().rev()`. </ins> // // Consider: //

// // `[[fn#'b -> impl_trait#'b], [fn#'b -> impl_sized#'b]]` // <del> // for the opaque type generated on `impl Sized + 'b`, We want the result to be: // impl_sized#'b, so iterating forward is the wrong thing to do. for map in self.generics_def_id_map.iter().rev() { if let Some(r) = map.get(&local_def_id) { debug!("def_id_remapper: remapping from `{local_def_id:?}` to `{r:?}`"); local_def_id = *r; } else { debug!("def_id_remapper: no remapping for `{local_def_id:?}` found in map"); } } local_def_id </del> <ins> // for the opaque type generated on `impl Sized + 'b`, we want the result to be: impl_sized#'b. // So, if we were trying to find first from the start (outermost) would give the wrong result, impl_trait#'b. self.generics_def_id_map .iter() .rev() .find_map(|map| map.get(&local_def_id).map(|local_def_id| *local_def_id)) .unwrap_or(local_def_id) </ins> } /// Freshen the `LoweringContext` and ready it to lower a nested item.

LifetimeRes::Fresh { param, binder: _ } => { debug_assert_eq!(lifetime.ident.name, kw::UnderscoreLifetime); <del> if let Some(old_def_id) = self.opt_local_def_id(param) && remapping.get(&old_def_id).is_none() { </del> <ins> if let Some(old_def_id) = self.orig_opt_local_def_id(param) && remapping.get(&old_def_id).is_none() { </ins> let node_id = self.next_node_id(); let new_def_id = self.create_def(

let extra_lifetime_params = self.resolver.take_extra_lifetime_params(opaque_ty_node_id); debug!(?extra_lifetime_params); for (ident, outer_node_id, outer_res) in extra_lifetime_params { <del> let outer_def_id = self.local_def_id(outer_node_id); </del> <ins> let outer_def_id = self.orig_local_def_id(outer_node_id); </ins> let inner_node_id = self.next_node_id(); // Add a definition for the in scope lifetime def.

<ins> // check-pass pub struct VecNumber<'s> { pub vec_number: Vec<Number<'s>>, pub auxiliary_object: &'s Vec<usize>, } pub struct Number<'s> { pub number: &'s usize, } impl<'s> VecNumber<'s> { pub fn vec_number_iterable_per_item_in_auxiliary_object( &self, ) -> impl Iterator<Item = (&'s usize, impl Iterator<Item = &Number<'s>>)> { self.auxiliary_object.iter().map(move |n| { let iter_number = self.vec_number.iter(); (n, iter_number) }) } } fn main() {} </ins>