[−][src]Struct rustc_resolve::imports::ImportResolver

pub struct ImportResolver<'a, 'b> {
    pub r: &'a mut Resolver<'b>,
}

Fields

r: &'a mut Resolver<'b>

Implementations

impl<'a, 'b> ImportResolver<'a, 'b>[src]

pub(crate) fn make_path_suggestion(
    &mut self,
    span: Span,
    path: Vec<Segment>,
    parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
[src]

Adds suggestions for a path that cannot be resolved.

pub(in diagnostics) fn make_missing_self_suggestion(
    &mut self,
    span: Span,
    path: Vec<Segment>,
    parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
[src]

Suggest a missing self:: if that resolves to an correct module.

   |
LL | use foo::Bar;
   |     ^^^ did you mean `self::foo`?

pub(in diagnostics) fn make_missing_crate_suggestion(
    &mut self,
    span: Span,
    path: Vec<Segment>,
    parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
[src]

Suggests a missing crate:: if that resolves to an correct module.

   |
LL | use foo::Bar;
   |     ^^^ did you mean `crate::foo`?

pub(in diagnostics) fn make_missing_super_suggestion(
    &mut self,
    span: Span,
    path: Vec<Segment>,
    parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
[src]

Suggests a missing super:: if that resolves to an correct module.

   |
LL | use foo::Bar;
   |     ^^^ did you mean `super::foo`?

pub(in diagnostics) fn make_external_crate_suggestion(
    &mut self,
    span: Span,
    path: Vec<Segment>,
    parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
[src]

Suggests a missing external crate name if that resolves to an correct module.

   |
LL | use foobar::Baz;
   |     ^^^^^^ did you mean `baz::foobar`?

Used when importing a submodule of an external crate but missing that crate's name as the first part of path.

pub(crate) fn check_for_module_export_macro(
    &mut self,
    import: &'b Import<'b>,
    module: ModuleOrUniformRoot<'b>,
    ident: Ident
) -> Option<(Option<(Vec<(Span, String)>, String, Applicability)>, Vec<String>)>
[src]

Suggests importing a macro from the root of the crate rather than a module within the crate.

help: a macro with this name exists at the root of the crate
   |
LL | use issue_59764::makro;
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: this could be because a macro annotated with `#[macro_export]` will be exported
           at the root of the crate instead of the module where it is defined

impl<'a, 'b> ImportResolver<'a, 'b>[src]

pub fn resolve_imports(&mut self)[src]

Resolves all imports for the crate. This method performs the fixed- point iteration.

pub fn finalize_imports(&mut self)[src]

pub(in imports) fn throw_unresolved_import_error(
    &self,
    errors: Vec<(String, UnresolvedImportError)>,
    span: Option<MultiSpan>
)
[src]

pub(in imports) fn resolve_import(
    &mut self,
    import: &'b Import<'b>
) -> bool
[src]

Attempts to resolve the given import, returning true if its resolution is determined. If successful, the resolved bindings are written into the module.

pub(in imports) fn finalize_import(
    &mut self,
    import: &'b Import<'b>
) -> Option<UnresolvedImportError>
[src]

Performs final import resolution, consistency checks and error reporting.

Optionally returns an unresolved import error. This error is buffered and used to consolidate multiple unresolved import errors into a single diagnostic.

pub(in imports) fn check_for_redundant_imports(
    &mut self,
    ident: Ident,
    import: &'b Import<'b>,
    source_bindings: &PerNS<Cell<Result<&'b NameBinding<'b>, Determinacy>>>,
    target_bindings: &PerNS<Cell<Option<&'b NameBinding<'b>>>>,
    target: Ident
)
[src]

pub(in imports) fn resolve_glob_import(
    &mut self,
    import: &'b Import<'b>
)
[src]

pub(in imports) fn finalize_resolutions_in(
    &mut self,
    module: &'b ModuleData<'b>
)
[src]

Trait Implementations

impl<'a, 'b> DefIdTree for &'a ImportResolver<'a, 'b>[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for ImportResolver<'a, 'b>

impl<'a, 'b> !Send for ImportResolver<'a, 'b>

impl<'a, 'b> !Sync for ImportResolver<'a, 'b>

impl<'a, 'b> Unpin for ImportResolver<'a, 'b> where
    'b: 'a, 

impl<'a, 'b> !UnwindSafe for ImportResolver<'a, 'b>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.