[−][src]Struct rustc_resolve::imports::ImportResolver
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]
&mut self,
span: Span,
path: Vec<Segment>,
parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
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]
&mut self,
span: Span,
path: Vec<Segment>,
parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
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]
&mut self,
span: Span,
path: Vec<Segment>,
parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
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]
&mut self,
span: Span,
path: Vec<Segment>,
parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
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]
&mut self,
span: Span,
path: Vec<Segment>,
parent_scope: &ParentScope<'b>
) -> Option<(Vec<Segment>, Vec<String>)>
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]
&mut self,
import: &'b Import<'b>,
module: ModuleOrUniformRoot<'b>,
ident: Ident
) -> Option<(Option<(Vec<(Span, String)>, String, Applicability)>, Vec<String>)>
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]
&self,
errors: Vec<(String, UnresolvedImportError)>,
span: Option<MultiSpan>
)
pub(in imports) fn resolve_import(
&mut self,
import: &'b Import<'b>
) -> bool[src]
&mut self,
import: &'b Import<'b>
) -> bool
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]
&mut self,
import: &'b Import<'b>
) -> Option<UnresolvedImportError>
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]
&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
)
pub(in imports) fn resolve_glob_import(
&mut self,
import: &'b Import<'b>
)[src]
&mut self,
import: &'b Import<'b>
)
pub(in imports) fn finalize_resolutions_in(
&mut self,
module: &'b ModuleData<'b>
)[src]
&mut self,
module: &'b ModuleData<'b>
)
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,
'b: 'a,
impl<'a, 'b> !UnwindSafe for ImportResolver<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,