Skip to main content Module desugar Copy item path Source use std::iter ; π use std::ops::Range ; π use flux_common::bug; π use flux_common::bug; π use flux_common::dbg; π use flux_common::index::IndexGen; π use flux_common::iter::IterExt; π use flux_common::result::ErrorCollector; π use flux_common::result::ErrorEmitter; π use flux_common::span_bug; π use flux_config as config; π use flux_errors::Errors; π use flux_errors::FluxSession; π use flux_middle::ResolverOutput; π use flux_middle::def_id::FluxLocalDefId; π use flux_middle::def_id::MaybeExternId; π use flux_middle::fhir; π use flux_middle::fhir::FhirId; π use flux_middle::fhir::FluxOwnerId; π use flux_middle::fhir::Namespace; π use flux_middle::fhir::PartialRes; π use flux_middle::fhir::QPathExpr; π use flux_middle::fhir::Res; π use flux_middle::global_env::GlobalEnv; π use flux_middle::query_bug; π use flux_middle::rty::HintKind; π use flux_middle::try_alloc_slice; π use flux_syntax::surface; π use flux_syntax::surface::ConstructorArg; π use flux_syntax::surface::NodeId; π use flux_syntax::surface::visit::Visitor as _; π use flux_syntax::symbols::kw; π use flux_syntax::symbols::sym; π use flux_syntax::walk_list; π use hir::ItemKind; π use hir::def::DefKind; π use itertools::Either ; π use itertools::Itertools; π use rustc_ast::ast; π use rustc_data_structures::fx::FxIndexSet; π use rustc_data_structures::unord::UnordSet; π use rustc_errors::Diagnostic; π use rustc_errors::ErrorGuaranteed; π use rustc_hir as hir; π use rustc_hir::OwnerId; π use rustc_span::DUMMY_SP; π use rustc_span::Span; π use rustc_span::def_id::DefId; π use rustc_span::def_id::LocalDefId; π use crate::errors ; π lift π βLiftβ HIR types into FHIR types. FluxItemCtxt π OpaqueTypeCollector π RustItemCtxt π DesugarCtxt π collect_generics_in_params π Collect all sorts resolved to a generic type in a list of refinement parameters. Return the set
of generic def_ids used (sorted by their position in the list of generics). collect_holes π Collect the spans of every hole (_) inside a qualified path <qself as path>. collect_opaque_types π Traverses the hir for an item and collects the def_id of any opaque type (i.e., impl Trait or async)
Currently, we only support up to one opaque type and we report an error if thereβs more than one. Result π