Struct hir_def::resolver::Resolver[][src]

pub struct Resolver { /* fields omitted */ }

Implementations

Resolve known trait from std, like std::futures::Future

Resolve known struct from std, like std::boxed::Box

Resolve known enum from std, like std::result::Result

Returns a set of names available in the current scope.

Note that this is a somewhat fuzzy concept – internally, the compiler doesn’t necessary follow a strict scoping discipline. Rathe, it just tells for each ident what it resolves to.

A good example is something like str::from_utf8. From scopes point of view, this code is erroneous – both str module and str type occupy the same type namespace.

We don’t try to model that super-correctly – this functionality is primarily exposed for completions.

Note that in Rust one name can be bound to several items:

macro_rules! t { () => (()) }
type t = t!();
const t: t = t!()

That’s why we return a multimap.

The shadowing is accounted for: in

let x = 92;
{
    let x = 92;
    $0
}

there will be only one entry for x in the result.

The result is ordered roughly from the innermost scope to the outermost: when the name is introduced in two namespaces in two scopes, we use the position of the first scope.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more