Skip to main content

DesugarCtxt

Trait DesugarCtxt 

Source
trait DesugarCtxt<'genv, 'tcx: 'genv>: ErrorEmitter + ErrorCollector<ErrorGuaranteed> {
Show 41 methods // Required methods fn genv(&self) -> GlobalEnv<'genv, 'tcx>; fn resolver_output(&self) -> &'genv ResolverOutput; fn next_fhir_id(&self) -> FhirId; fn desugar_impl_trait(&mut self, bounds: &[TraitRef]) -> TyKind<'genv>; // Provided methods fn allow_primop_app(&self) -> bool { ... } fn resolve_implicit_param( &self, node_id: NodeId, ) -> Option<(ParamId, ParamKind)> { ... } fn check_no_holes( &self, qself: &Ty, path: &Path, ) -> Result<(), ErrorGuaranteed> { ... } fn desugar_epath(&self, path: &ExprPath) -> QPathExpr<'genv> { ... } fn desugar_loc( &self, ident: Ident, node_id: NodeId, ) -> Result<Res, ErrorGuaranteed> { ... } fn opt_resolve_path(&self, node_id: NodeId) -> Option<PartialRes> { ... } fn resolve_path(&self, node_id: NodeId) -> PartialRes { ... } fn resolve_param(&self, node_id: NodeId) -> (ParamId, ParamKind) { ... } fn resolve_implicit_params( &self, scope: NodeId, ) -> impl ExactSizeIterator<Item = (Ident, ParamId, ParamKind)> { ... } fn implicit_params_to_params( &self, scope: NodeId, ) -> impl ExactSizeIterator<Item = RefineParam<'genv>> { ... } fn desugar_refine_params( &mut self, params: &[RefineParam], ) -> &'genv [RefineParam<'genv>] { ... } fn desugar_refine_params_iter( &mut self, params: &[RefineParam], ) -> impl ExactSizeIterator<Item = RefineParam<'genv>> { ... } fn desugar_refine_param( &mut self, param: &RefineParam, ) -> RefineParam<'genv> { ... } fn desugar_sort( &mut self, sort: &Sort, generic_id_to_var_idx: Option<&FxIndexSet<DefId>>, ) -> Sort<'genv> { ... } fn desugar_base_sort( &mut self, sort: &BaseSort, generic_id_to_var_idx: Option<&FxIndexSet<DefId>>, ) -> Sort<'genv> { ... } fn desugar_generic_args( &mut self, args: &[GenericArg], ) -> (&'genv [GenericArg<'genv>], &'genv [AssocItemConstraint<'genv>]) { ... } fn desugar_const_path_to_const_arg( &mut self, path: &Path, res: Res, ) -> GenericArg<'genv> { ... } fn desugar_const_path_to_const_arg_kind( &mut self, path: &Path, res: Res, ) -> ConstArgKind { ... } fn desugar_ty(&mut self, ty: &Ty) -> Ty<'genv> { ... } fn desugar_bare_fn( &mut self, bare_fn: &BareFnTy, ) -> Result<BareFnTy<'genv>, ErrorGuaranteed> { ... } fn desugar_const_arg(&mut self, const_arg: &ConstArg) -> ConstArg { ... } fn desugar_bty(&mut self, bty: &BaseTy) -> BaseTy<'genv> { ... } fn desugar_path_to_bty( &mut self, qself: Option<&Ty>, path: &Path, ) -> BaseTy<'genv> { ... } fn desugar_qpath(&mut self, qself: Option<&Ty>, path: &Path) -> QPath<'genv> { ... } fn desugar_path_segment( &mut self, segment: &PathSegment, ) -> PathSegment<'genv> { ... } fn desugar_epath_segment( &self, segment: &ExprPathSegment, ) -> PathSegment<'genv> { ... } fn ty_path(&self, qpath: QPath<'genv>) -> Ty<'genv> { ... } fn desugar_indices(&mut self, idxs: &Indices) -> Expr<'genv> { ... } fn desugar_refine_arg(&mut self, arg: &RefineArg) -> Expr<'genv> { ... } fn implicit_param_into_refine_arg( &self, ident: Ident, node_id: NodeId, ) -> Option<Expr<'genv>> { ... } fn desugar_quant_dom(&mut self, dom: &Option<Range<usize>>) -> QuantDom { ... } fn desugar_expr(&mut self, expr: &Expr) -> Expr<'genv> { ... } fn desugar_call(&mut self, callee: &Expr, args: &[Expr]) -> ExprKind<'genv> { ... } fn desugar_constructor( &mut self, path: Option<&ExprPath>, args: &[ConstructorArg], ) -> ExprKind<'genv> { ... } fn desugar_exprs(&mut self, exprs: &[Expr]) -> &'genv [Expr<'genv>] { ... } fn try_parse_int_lit( &self, span: Span, s: &str, ) -> Result<u128, ErrorGuaranteed> { ... } fn desugar_lit(&self, span: Span, lit: Lit) -> ExprKind<'genv> { ... }
}

Required Methods§

Source

fn genv(&self) -> GlobalEnv<'genv, 'tcx>

Source

fn resolver_output(&self) -> &'genv ResolverOutput

Source

fn next_fhir_id(&self) -> FhirId

Source

fn desugar_impl_trait(&mut self, bounds: &[TraitRef]) -> TyKind<'genv>

Provided Methods§

Source

fn allow_primop_app(&self) -> bool

Source

fn resolve_implicit_param( &self, node_id: NodeId, ) -> Option<(ParamId, ParamKind)>

Source

fn check_no_holes(&self, qself: &Ty, path: &Path) -> Result<(), ErrorGuaranteed>

Holes are filled in by zipping the annotation against the corresponding rust type, so they cannot appear in a qualified path <qself as path>, which has no rust counterpart.

Source

fn desugar_epath(&self, path: &ExprPath) -> QPathExpr<'genv>

Source

fn desugar_loc( &self, ident: Ident, node_id: NodeId, ) -> Result<Res, ErrorGuaranteed>

Source

fn opt_resolve_path(&self, node_id: NodeId) -> Option<PartialRes>

Source

fn resolve_path(&self, node_id: NodeId) -> PartialRes

Source

fn resolve_param(&self, node_id: NodeId) -> (ParamId, ParamKind)

Source

fn resolve_implicit_params( &self, scope: NodeId, ) -> impl ExactSizeIterator<Item = (Ident, ParamId, ParamKind)>

Source

fn implicit_params_to_params( &self, scope: NodeId, ) -> impl ExactSizeIterator<Item = RefineParam<'genv>>

Source

fn desugar_refine_params( &mut self, params: &[RefineParam], ) -> &'genv [RefineParam<'genv>]

Source

fn desugar_refine_params_iter( &mut self, params: &[RefineParam], ) -> impl ExactSizeIterator<Item = RefineParam<'genv>>

Source

fn desugar_refine_param(&mut self, param: &RefineParam) -> RefineParam<'genv>

Source

fn desugar_sort( &mut self, sort: &Sort, generic_id_to_var_idx: Option<&FxIndexSet<DefId>>, ) -> Sort<'genv>

Source

fn desugar_base_sort( &mut self, sort: &BaseSort, generic_id_to_var_idx: Option<&FxIndexSet<DefId>>, ) -> Sort<'genv>

Source

fn desugar_generic_args( &mut self, args: &[GenericArg], ) -> (&'genv [GenericArg<'genv>], &'genv [AssocItemConstraint<'genv>])

Source

fn desugar_const_path_to_const_arg( &mut self, path: &Path, res: Res, ) -> GenericArg<'genv>

Source

fn desugar_const_path_to_const_arg_kind( &mut self, path: &Path, res: Res, ) -> ConstArgKind

Source

fn desugar_ty(&mut self, ty: &Ty) -> Ty<'genv>

This is the mega desugaring function surface::Ty -> fhir::Ty. These are both similar representations. The most important difference is that fhir::Ty has explicit refinement parameters and surface::Ty does not. Refinements are implicitly scoped in surface.

Source

fn desugar_bare_fn( &mut self, bare_fn: &BareFnTy, ) -> Result<BareFnTy<'genv>, ErrorGuaranteed>

Source

fn desugar_const_arg(&mut self, const_arg: &ConstArg) -> ConstArg

Source

fn desugar_bty(&mut self, bty: &BaseTy) -> BaseTy<'genv>

Source

fn desugar_path_to_bty( &mut self, qself: Option<&Ty>, path: &Path, ) -> BaseTy<'genv>

Source

fn desugar_qpath(&mut self, qself: Option<&Ty>, path: &Path) -> QPath<'genv>

Source

fn desugar_path_segment(&mut self, segment: &PathSegment) -> PathSegment<'genv>

Source

fn desugar_epath_segment(&self, segment: &ExprPathSegment) -> PathSegment<'genv>

Source

fn ty_path(&self, qpath: QPath<'genv>) -> Ty<'genv>

Source

fn desugar_indices(&mut self, idxs: &Indices) -> Expr<'genv>

Source

fn desugar_refine_arg(&mut self, arg: &RefineArg) -> Expr<'genv>

Source

fn implicit_param_into_refine_arg( &self, ident: Ident, node_id: NodeId, ) -> Option<Expr<'genv>>

Source

fn desugar_quant_dom(&mut self, dom: &Option<Range<usize>>) -> QuantDom

Source

fn desugar_expr(&mut self, expr: &Expr) -> Expr<'genv>

Source

fn desugar_call(&mut self, callee: &Expr, args: &[Expr]) -> ExprKind<'genv>

Source

fn desugar_constructor( &mut self, path: Option<&ExprPath>, args: &[ConstructorArg], ) -> ExprKind<'genv>

Source

fn desugar_exprs(&mut self, exprs: &[Expr]) -> &'genv [Expr<'genv>]

Source

fn try_parse_int_lit( &self, span: Span, s: &str, ) -> Result<u128, ErrorGuaranteed>

Source

fn desugar_lit(&self, span: Span, lit: Lit) -> ExprKind<'genv>

Desugar surface literal

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'genv, 'tcx> DesugarCtxt<'genv, 'tcx> for FluxItemCtxt<'genv, 'tcx>

Source§

impl<'genv, 'tcx> DesugarCtxt<'genv, 'tcx> for RustItemCtxt<'_, 'genv, 'tcx>