diff --git a/compiler/rustc_ast_lowering/src/delegation/generics.rs b/compiler/rustc_ast_lowering/src/delegation/generics.rs index 4e960e3b9290c..821fe85e329d7 100644 --- a/compiler/rustc_ast_lowering/src/delegation/generics.rs +++ b/compiler/rustc_ast_lowering/src/delegation/generics.rs @@ -295,10 +295,9 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { let param_ident = Ident::new(p.name, span); let def_name = Some(param_ident.name); - let path_data = def_kind.def_path_data(def_name); let node_id = self.next_node_id(); - let def_id = self.create_def(node_id, def_name, def_kind, path_data, span); + let def_id = self.create_def(node_id, def_name, def_kind, span); let kind = match p.kind { GenericParamDefKind::Lifetime => { diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index b6bc122051cbc..bd013cd56c9a8 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -8,7 +8,6 @@ use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_errors::msg; use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; -use rustc_hir::definitions::DefPathData; use rustc_hir::{HirId, Target, find_attr}; use rustc_middle::span_bug; use rustc_middle::ty::TyCtxt; @@ -472,13 +471,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { for (idx, arg) in args.iter().cloned().enumerate() { if legacy_args_idx.contains(&idx) { let node_id = self.next_node_id(); - self.create_def( - node_id, - None, - DefKind::AnonConst, - DefPathData::LateAnonConst, - f.span, - ); + self.create_def(node_id, None, DefKind::AnonConst, f.span); let mut visitor = WillCreateDefIdsVisitor {}; let const_value = if let ControlFlow::Break(span) = visitor.visit_expr(&arg) { Box::new(Expr { diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 13971bdb3fd55..0f57a37290b8b 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -51,7 +51,7 @@ use rustc_data_structures::tagged_ptr::TaggedRef; use rustc_errors::{DiagArgFromDisplay, DiagCtxtHandle}; use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res}; use rustc_hir::def_id::{CRATE_DEF_ID, LOCAL_CRATE, LocalDefId}; -use rustc_hir::definitions::{DefPathData, DisambiguatorState}; +use rustc_hir::definitions::PerParentDisambiguatorState; use rustc_hir::lints::{AttributeLint, DelayedLint}; use rustc_hir::{ self as hir, AngleBrackets, ConstArg, GenericArg, HirId, ItemLocalMap, LifetimeSource, @@ -94,7 +94,7 @@ pub mod stability; struct LoweringContext<'a, 'hir, R> { tcx: TyCtxt<'hir>, resolver: &'a mut R, - disambiguator: DisambiguatorState, + disambiguator: PerParentDisambiguatorState, /// Used to allocate HIR nodes. arena: &'hir hir::Arena<'hir>, @@ -159,7 +159,7 @@ impl<'a, 'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'a, 'hir, R> { Self { tcx, resolver, - disambiguator: DisambiguatorState::new(), + disambiguator: Default::default(), arena: tcx.hir_arena, // HirId handling. @@ -302,6 +302,10 @@ impl<'a, 'tcx> ResolverAstLoweringExt<'tcx> for ResolverDelayedAstLowering<'a, ' fn next_node_id(&mut self) -> NodeId { next_node_id(&mut self.next_node_id) } + + fn steal_or_create_disambiguator(&self, parent: LocalDefId) -> PerParentDisambiguatorState { + self.base.steal_or_create_disambiguator(parent) + } } fn next_node_id(current_id: &mut NodeId) -> NodeId { @@ -404,6 +408,10 @@ impl<'tcx> ResolverAstLowering<'tcx> { fn next_node_id(&mut self) -> NodeId { next_node_id(&mut self.next_node_id) } + + fn steal_or_create_disambiguator(&self, parent: LocalDefId) -> PerParentDisambiguatorState { + self.per_parent_disambiguators.get(&parent).map(|s| s.steal()).unwrap_or_default() + } } /// How relaxed bounds `?Trait` should be treated. @@ -733,7 +741,6 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { node_id: ast::NodeId, name: Option, def_kind: DefKind, - def_path_data: DefPathData, span: Span, ) -> LocalDefId { let parent = self.current_hir_id_owner.def_id; @@ -749,7 +756,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { let def_id = self .tcx .at(span) - .create_def(parent, name, def_kind, Some(def_path_data), &mut self.disambiguator) + .create_def(parent, name, def_kind, None, &mut self.disambiguator) .def_id(); debug!("create_def: def_id_to_node_id[{:?}] <-> {:?}", def_id, node_id); @@ -790,6 +797,8 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { ) { let owner_id = self.owner_id(owner); + let new_disambig = self.resolver.steal_or_create_disambiguator(owner_id.def_id); + let disambiguator = std::mem::replace(&mut self.disambiguator, new_disambig); let current_attrs = std::mem::take(&mut self.attrs); let current_bodies = std::mem::take(&mut self.bodies); let current_define_opaque = std::mem::take(&mut self.define_opaque); @@ -824,6 +833,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { assert!(self.impl_trait_bounds.is_empty()); let info = self.make_owner_info(item); + self.disambiguator = disambiguator; self.attrs = current_attrs; self.bodies = current_bodies; self.define_opaque = current_define_opaque; @@ -1031,7 +1041,6 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { param, Some(kw::UnderscoreLifetime), DefKind::LifetimeParam, - DefPathData::DesugaredAnonymousLifetime, ident.span, ); debug!(?_def_id); @@ -2512,13 +2521,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { // We're lowering a const argument that was originally thought to be a type argument, // so the def collector didn't create the def ahead of time. That's why we have to do // it here. - let def_id = self.create_def( - node_id, - None, - DefKind::AnonConst, - DefPathData::LateAnonConst, - span, - ); + let def_id = self.create_def(node_id, None, DefKind::AnonConst, span); let hir_id = self.lower_node_id(node_id); let path_expr = Expr { diff --git a/compiler/rustc_ast_lowering/src/pat.rs b/compiler/rustc_ast_lowering/src/pat.rs index 40d42ffb5f4f9..07078cbbc003e 100644 --- a/compiler/rustc_ast_lowering/src/pat.rs +++ b/compiler/rustc_ast_lowering/src/pat.rs @@ -3,7 +3,6 @@ use std::sync::Arc; use rustc_ast::*; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_hir::def::{DefKind, Res}; -use rustc_hir::definitions::DefPathData; use rustc_hir::{self as hir, LangItem, Target}; use rustc_middle::span_bug; use rustc_span::{DesugaringKind, Ident, Span, Spanned, respan}; @@ -534,8 +533,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { // We're generating a range end that didn't exist in the AST, // so the def collector didn't create the def ahead of time. That's why we have to do // it here. - let def_id = - self.create_def(node_id, None, DefKind::AnonConst, DefPathData::LateAnonConst, span); + let def_id = self.create_def(node_id, None, DefKind::AnonConst, span); let hir_id = self.lower_node_id(node_id); let unstable_span = self.mark_span_with_reason( diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index 5e361891f6d04..d18653f6267ad 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -97,11 +97,34 @@ impl DefPathTable { } } -#[derive(Debug)] +pub trait Disambiguator { + fn entry(&mut self, parent: LocalDefId, data: DefPathData) -> &mut u32; +} + +#[derive(Debug, Default, Clone)] +pub struct PerParentDisambiguatorState { + next: UnordMap, +} + +impl Disambiguator for PerParentDisambiguatorState { + #[inline] + fn entry(&mut self, _: LocalDefId, data: DefPathData) -> &mut u32 { + self.next.entry(data).or_insert(0) + } +} + +#[derive(Debug, Default, Clone)] pub struct DisambiguatorState { next: UnordMap<(LocalDefId, DefPathData), u32>, } +impl Disambiguator for DisambiguatorState { + #[inline] + fn entry(&mut self, parent: LocalDefId, data: DefPathData) -> &mut u32 { + self.next.entry((parent, data)).or_insert(0) + } +} + impl DisambiguatorState { pub const fn new() -> Self { Self { next: Default::default() } @@ -302,10 +325,6 @@ pub enum DefPathData { Ctor, /// A constant expression (see `{ast,hir}::AnonConst`). AnonConst, - /// A constant expression created during AST->HIR lowering.. - LateAnonConst, - /// A fresh anonymous lifetime created by desugaring elided lifetimes. - DesugaredAnonymousLifetime, /// An existential `impl Trait` type node. /// Argument position `impl Trait` have a `TypeNs` with their pretty-printed name. OpaqueTy, @@ -389,7 +408,7 @@ impl Definitions { &mut self, parent: LocalDefId, data: DefPathData, - disambiguator: &mut DisambiguatorState, + disambiguator: &mut impl Disambiguator, ) -> LocalDefId { // We can't use `Debug` implementation for `LocalDefId` here, since it tries to acquire a // reference to `Definitions` and we're already holding a mutable reference. @@ -403,7 +422,7 @@ impl Definitions { // Find the next free disambiguator for this key. let disambiguator = { - let next_disamb = disambiguator.next.entry((parent, data)).or_insert(0); + let next_disamb = disambiguator.entry(parent, data); let disambiguator = *next_disamb; *next_disamb = next_disamb.checked_add(1).expect("disambiguator overflow"); disambiguator @@ -458,8 +477,6 @@ impl DefPathData { TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) | OpaqueLifetime(name) => Some(name), - DesugaredAnonymousLifetime => Some(kw::UnderscoreLifetime), - Impl | ForeignMod | CrateRoot @@ -468,7 +485,6 @@ impl DefPathData { | Closure | Ctor | AnonConst - | LateAnonConst | OpaqueTy | AnonAssocTy(..) | SyntheticCoroutineBody @@ -482,8 +498,6 @@ impl DefPathData { TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) | AnonAssocTy(name) | OpaqueLifetime(name) => Some(name), - DesugaredAnonymousLifetime => Some(kw::UnderscoreLifetime), - Impl | ForeignMod | CrateRoot @@ -492,7 +506,6 @@ impl DefPathData { | Closure | Ctor | AnonConst - | LateAnonConst | OpaqueTy | SyntheticCoroutineBody | NestedStatic => None, @@ -512,8 +525,7 @@ impl DefPathData { GlobalAsm => DefPathDataName::Anon { namespace: sym::global_asm }, Closure => DefPathDataName::Anon { namespace: sym::closure }, Ctor => DefPathDataName::Anon { namespace: sym::constructor }, - AnonConst | LateAnonConst => DefPathDataName::Anon { namespace: sym::constant }, - DesugaredAnonymousLifetime => DefPathDataName::Named(kw::UnderscoreLifetime), + AnonConst => DefPathDataName::Anon { namespace: sym::constant }, OpaqueTy => DefPathDataName::Anon { namespace: sym::opaque }, AnonAssocTy(..) => DefPathDataName::Anon { namespace: sym::anon_assoc }, SyntheticCoroutineBody => DefPathDataName::Anon { namespace: sym::synthetic }, diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs index 4312d5fa9dddf..b2df16887f762 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -1523,7 +1523,7 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> { None, DefKind::LifetimeParam, Some(DefPathData::OpaqueLifetime(ident.name)), - &mut self.disambiguator, + self.disambiguator, ); feed.def_span(ident.span); feed.def_ident_span(Some(ident.span)); diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index f0707cfbbb40c..c66e36496c6da 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -32,7 +32,7 @@ use rustc_data_structures::sync::{ use rustc_errors::{Applicability, Diag, DiagCtxtHandle, Diagnostic, MultiSpan}; use rustc_hir::def::DefKind; use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId}; -use rustc_hir::definitions::{DefPathData, Definitions, DisambiguatorState}; +use rustc_hir::definitions::{DefPathData, Definitions, Disambiguator}; use rustc_hir::intravisit::VisitorExt; use rustc_hir::lang_items::LangItem; use rustc_hir::limit::Limit; @@ -1355,7 +1355,7 @@ impl<'tcx> TyCtxtAt<'tcx> { name: Option, def_kind: DefKind, override_def_path_data: Option, - disambiguator: &mut DisambiguatorState, + disambiguator: &mut impl Disambiguator, ) -> TyCtxtFeed<'tcx, LocalDefId> { let feed = self.tcx.create_def(parent, name, def_kind, override_def_path_data, disambiguator); @@ -1373,7 +1373,7 @@ impl<'tcx> TyCtxt<'tcx> { name: Option, def_kind: DefKind, override_def_path_data: Option, - disambiguator: &mut DisambiguatorState, + disambiguator: &mut impl Disambiguator, ) -> TyCtxtFeed<'tcx, LocalDefId> { let data = override_def_path_data.unwrap_or_else(|| def_kind.def_path_data(name)); // The following call has the side effect of modifying the tables inside `definitions`. diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index dbf7d643a42ce..8146145a51b96 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -40,6 +40,7 @@ use rustc_hir as hir; use rustc_hir::attrs::StrippedCfgItem; use rustc_hir::def::{CtorKind, CtorOf, DefKind, DocLinkResMap, LifetimeRes, Res}; use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LocalDefIdMap}; +use rustc_hir::definitions::PerParentDisambiguatorState; use rustc_hir::{LangItem, attrs as attr, find_attr}; use rustc_index::IndexVec; use rustc_index::bit_set::BitMatrix; @@ -223,6 +224,8 @@ pub struct ResolverAstLowering<'tcx> { // Information about delegations which is used when handling recursive delegations pub delegation_infos: LocalDefIdMap, + + pub per_parent_disambiguators: LocalDefIdMap>, } #[derive(Debug)] diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 1262974325a1f..9a6bb81865ef3 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -2172,7 +2172,6 @@ fn guess_def_namespace(tcx: TyCtxt<'_>, def_id: DefId) -> Namespace { DefPathData::ValueNs(..) | DefPathData::AnonConst - | DefPathData::LateAnonConst | DefPathData::Closure | DefPathData::Ctor => Namespace::ValueNS, diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index d75f2981a7724..334392854be66 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -57,7 +57,7 @@ use rustc_hir::def::{ PerNS, }; use rustc_hir::def_id::{CRATE_DEF_ID, CrateNum, DefId, LOCAL_CRATE, LocalDefId, LocalDefIdMap}; -use rustc_hir::definitions::DisambiguatorState; +use rustc_hir::definitions::PerParentDisambiguatorState; use rustc_hir::{PrimTy, TraitCandidate, find_attr}; use rustc_index::bit_set::DenseBitSet; use rustc_metadata::creader::CStore; @@ -1356,7 +1356,7 @@ pub struct Resolver<'ra, 'tcx> { node_id_to_def_id: NodeMap>, - disambiguator: DisambiguatorState = DisambiguatorState::new(), + per_parent_disambiguators: LocalDefIdMap, /// Indices of unnamed struct or variant fields with unresolved attributes. placeholder_field_indices: FxHashMap = default::fx_hash_map(), @@ -1560,7 +1560,13 @@ impl<'tcx> Resolver<'_, 'tcx> { ); // FIXME: remove `def_span` body, pass in the right spans here and call `tcx.at().create_def()` - let feed = self.tcx.create_def(parent, name, def_kind, None, &mut self.disambiguator); + let feed = self.tcx.create_def( + parent, + name, + def_kind, + None, + self.per_parent_disambiguators.entry(parent).or_default(), + ); let def_id = feed.def_id(); // Create the definition. @@ -1742,6 +1748,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { doc_link_resolutions: Default::default(), doc_link_traits_in_scope: Default::default(), current_crate_outer_attr_insert_span, + per_parent_disambiguators: Default::default(), .. }; @@ -1873,6 +1880,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { lifetime_elision_allowed: self.lifetime_elision_allowed, lint_buffer: Steal::new(self.lint_buffer), delegation_infos: self.delegation_infos, + per_parent_disambiguators: self + .per_parent_disambiguators + .into_items() + .map(|(k, d)| (k, Steal::new(d))) + .collect(), }; ResolverOutputs { global_ctxt, ast_lowering } } diff --git a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs index 26979c24bdb68..2df1f390c92b1 100644 --- a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs +++ b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs @@ -680,7 +680,6 @@ fn encode_ty_name(tcx: TyCtxt<'_>, def_id: DefId) -> String { hir::definitions::DefPathData::Closure => "C", hir::definitions::DefPathData::Ctor => "c", hir::definitions::DefPathData::AnonConst => "K", - hir::definitions::DefPathData::LateAnonConst => "k", hir::definitions::DefPathData::OpaqueTy => "i", hir::definitions::DefPathData::SyntheticCoroutineBody => "s", hir::definitions::DefPathData::NestedStatic => "n", @@ -690,7 +689,6 @@ fn encode_ty_name(tcx: TyCtxt<'_>, def_id: DefId) -> String { | hir::definitions::DefPathData::MacroNs(..) | hir::definitions::DefPathData::OpaqueLifetime(..) | hir::definitions::DefPathData::LifetimeNs(..) - | hir::definitions::DefPathData::DesugaredAnonymousLifetime | hir::definitions::DefPathData::AnonAssocTy(..) => { bug!("encode_ty_name: unexpected `{:?}`", disambiguated_data.data); } diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index fa839eb845586..baacd4a9f196a 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -888,7 +888,6 @@ impl<'tcx> Printer<'tcx> for V0SymbolMangler<'tcx> { DefPathData::Closure => 'C', DefPathData::Ctor => 'c', DefPathData::AnonConst => 'K', - DefPathData::LateAnonConst => 'k', DefPathData::OpaqueTy => 'i', DefPathData::SyntheticCoroutineBody => 's', DefPathData::NestedStatic => 'n', @@ -900,7 +899,6 @@ impl<'tcx> Printer<'tcx> for V0SymbolMangler<'tcx> { | DefPathData::Impl | DefPathData::MacroNs(_) | DefPathData::LifetimeNs(_) - | DefPathData::DesugaredAnonymousLifetime | DefPathData::OpaqueLifetime(_) | DefPathData::AnonAssocTy(..) => { bug!("symbol_names: unexpected DefPathData: {:?}", disambiguated_data.data) diff --git a/tests/ui/delegation/generics/def-path-hash-collision-ice-153410.rs b/tests/ui/delegation/generics/def-path-hash-collision-ice-153410.rs new file mode 100644 index 0000000000000..a7e42ef977f47 --- /dev/null +++ b/tests/ui/delegation/generics/def-path-hash-collision-ice-153410.rs @@ -0,0 +1,27 @@ +//@ compile-flags: -Z deduplicate-diagnostics=yes +//@ edition:2024 + +#![feature(fn_delegation)] +#![feature(iter_advance_by)] +#![feature(iter_array_chunks)] +#![feature(iterator_try_collect)] +#![feature(iterator_try_reduce)] +#![feature(iter_collect_into)] +#![feature(iter_intersperse)] +#![feature(iter_is_partitioned)] +#![feature(iter_map_windows)] +#![feature(iter_next_chunk)] +#![feature(iter_order_by)] +#![feature(iter_partition_in_place)] +#![feature(trusted_random_access)] +#![feature(try_find)] +#![allow(incomplete_features)] + +impl Iterator { +//~^ ERROR: expected a type, found a trait [E0782] + reuse< < fn()>::Output>::Item as Iterator>::*; + //~^ ERROR: expected method or associated constant, found associated type `Iterator::Item` + //~| ERROR: ambiguous associated type +} + +fn main() {} diff --git a/tests/ui/delegation/generics/def-path-hash-collision-ice-153410.stderr b/tests/ui/delegation/generics/def-path-hash-collision-ice-153410.stderr new file mode 100644 index 0000000000000..f18634e8a2e19 --- /dev/null +++ b/tests/ui/delegation/generics/def-path-hash-collision-ice-153410.stderr @@ -0,0 +1,40 @@ +error[E0575]: expected method or associated constant, found associated type `Iterator::Item` + --> $DIR/def-path-hash-collision-ice-153410.rs:22:10 + | +LL | reuse< < fn()>::Output>::Item as Iterator>::*; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a method or associated constant + +error[E0782]: expected a type, found a trait + --> $DIR/def-path-hash-collision-ice-153410.rs:20:6 + | +LL | impl Iterator { + | ^^^^^^^^ + | +help: you can add the `dyn` keyword if you want a trait object + | +LL | impl dyn Iterator { + | +++ +help: you might have intended to implement this trait for a given type + | +LL | impl Iterator for /* Type */ { + | ++++++++++++++ + +error[E0223]: ambiguous associated type + --> $DIR/def-path-hash-collision-ice-153410.rs:22:14 + | +LL | reuse< < fn()>::Output>::Item as Iterator>::*; + | ^^^^^^^^^^^^^^^^^^^^^^ + | +help: use fully-qualified syntax + | +LL - reuse< < fn()>::Output>::Item as Iterator>::*; +LL + reuse< < ::Output>::Item as Iterator>::*; + | +LL - reuse< < fn()>::Output>::Item as Iterator>::*; +LL + reuse< < ::Output>::Item as Iterator>::*; + | + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0223, E0575, E0782. +For more information about an error, try `rustc --explain E0223`.