Struct rustc_resolve::imports::ImportResolver [−][src]
pub struct ImportResolver<'a, 'b> {
pub r: &'a mut Resolver<'b>,
}
Fields
r: &'a mut Resolver<'b>
Implementations
Adds suggestions for a path that cannot be resolved.
Suggest a missing self::
if that resolves to an correct module.
|
LL | use foo::Bar;
| ^^^ did you mean `self::foo`?
Suggests a missing crate::
if that resolves to an correct module.
|
LL | use foo::Bar;
| ^^^ did you mean `crate::foo`?
Suggests a missing super::
if that resolves to an correct module.
|
LL | use foo::Bar;
| ^^^ did you mean `super::foo`?
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.
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
Resolves all imports for the crate. This method performs the fixed- point iteration.
fn throw_unresolved_import_error(
&self,
errors: Vec<(String, UnresolvedImportError)>,
span: Option<MultiSpan>
)
Attempts to resolve the given import, returning true if its resolution is determined. If successful, the resolved bindings are written into the module.
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.
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
)
Trait Implementations
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
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes