Struct cairo_lang_semantic::resolve::Resolver
source · pub struct Resolver<'db> {
pub data: ResolverData,
/* private fields */
}
Expand description
Resolves paths semantically.
Fields§
§data: ResolverData
Implementations§
source§impl<'db> Resolver<'db>
impl<'db> Resolver<'db>
pub fn new( db: &'db dyn SemanticGroup, module_file_id: ModuleFileId, inference_id: InferenceId ) -> Self
pub fn with_data(db: &'db dyn SemanticGroup, data: ResolverData) -> Self
pub fn inference(&mut self) -> Inference<'_>
sourcepub fn add_generic_param(&mut self, generic_param_id: GenericParamId)
pub fn add_generic_param(&mut self, generic_param_id: GenericParamId)
Adds a generic param to an existing resolver. This is required since a resolver needs to exist before resolving the generic params, and thus, they are added to the Resolver only after they are resolved.
sourcepub fn resolve_concrete_path(
&mut self,
diagnostics: &mut SemanticDiagnostics,
path: impl AsSegments,
item_type: NotFoundItemType
) -> Maybe<ResolvedConcreteItem>
pub fn resolve_concrete_path( &mut self, diagnostics: &mut SemanticDiagnostics, path: impl AsSegments, item_type: NotFoundItemType ) -> Maybe<ResolvedConcreteItem>
Resolves a concrete item, given a path. Guaranteed to result in at most one diagnostic.
sourcepub fn resolve_generic_path(
&mut self,
diagnostics: &mut SemanticDiagnostics,
path: impl AsSegments,
item_type: NotFoundItemType
) -> Maybe<ResolvedGenericItem>
pub fn resolve_generic_path( &mut self, diagnostics: &mut SemanticDiagnostics, path: impl AsSegments, item_type: NotFoundItemType ) -> Maybe<ResolvedGenericItem>
Resolves a generic item, given a path. Guaranteed to result in at most one diagnostic.
sourcepub fn resolve_generic_path_with_args(
&mut self,
diagnostics: &mut SemanticDiagnostics,
path: impl AsSegments,
item_type: NotFoundItemType
) -> Maybe<ResolvedGenericItem>
pub fn resolve_generic_path_with_args( &mut self, diagnostics: &mut SemanticDiagnostics, path: impl AsSegments, item_type: NotFoundItemType ) -> Maybe<ResolvedGenericItem>
Resolves a generic item, given a concrete item path, while ignoring the generic args. Guaranteed to result in at most one diagnostic.
sourcepub fn prelude_submodule(&self) -> ModuleId
pub fn prelude_submodule(&self) -> ModuleId
Returns the crate’s prelude
submodule.
sourcepub fn specialize_function(
&mut self,
diagnostics: &mut SemanticDiagnostics,
stable_ptr: SyntaxStablePtrId,
generic_function: GenericFunctionId,
generic_args: Vec<GenericArg>
) -> Maybe<FunctionId>
pub fn specialize_function( &mut self, diagnostics: &mut SemanticDiagnostics, stable_ptr: SyntaxStablePtrId, generic_function: GenericFunctionId, generic_args: Vec<GenericArg> ) -> Maybe<FunctionId>
Specializes a generic function.
sourcepub fn specialize_type(
&mut self,
diagnostics: &mut SemanticDiagnostics,
stable_ptr: SyntaxStablePtrId,
generic_type: GenericTypeId,
generic_args: Vec<GenericArg>
) -> Maybe<TypeId>
pub fn specialize_type( &mut self, diagnostics: &mut SemanticDiagnostics, stable_ptr: SyntaxStablePtrId, generic_type: GenericTypeId, generic_args: Vec<GenericArg> ) -> Maybe<TypeId>
Specializes a generic type.
pub fn impl_lookup_context(&self) -> ImplLookupContext
pub fn resolve_generic_args( &mut self, diagnostics: &mut SemanticDiagnostics, generic_params: &[GenericParam], generic_args_syntax: Vec<GenericArg>, stable_ptr: SyntaxStablePtrId ) -> Maybe<Vec<GenericArgumentId>>
Methods from Deref<Target = ResolverData>§
pub fn clone_with_inference_id( &self, db: &dyn SemanticGroup, inference_id: InferenceId ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'db> !RefUnwindSafe for Resolver<'db>
impl<'db> !Send for Resolver<'db>
impl<'db> !Sync for Resolver<'db>
impl<'db> Unpin for Resolver<'db>
impl<'db> !UnwindSafe for Resolver<'db>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more