enum ResolutionFailure<'a> {
    WrongNamespace {
        res: Res,
        expected_ns: Namespace,
    },
    NotResolved {
        module_id: DefId,
        partial_res: Option<Res>,
        unresolved: Cow<'a, str>,
    },
    NoParentItem,
    MalformedGenerics(MalformedGenerics),
    Dummy,
}
Expand description

A link failed to resolve.

Variants

WrongNamespace

Fields

res: Res

What the link resolved to.

expected_ns: Namespace

The expected namespace for the resolution, determined from the link’s disambiguator.

E.g., for [fn@Result] this is Namespace::ValueNS, even though Result’s actual namespace is Namespace::TypeNS.

This resolved, but with the wrong namespace.

NotResolved

Fields

module_id: DefId

The scope the link was resolved in.

partial_res: Option<Res>

If part of the link resolved, this has the Res.

In [std::io::Error::x], std::io::Error would be a partial resolution.

unresolved: Cow<'a, str>

The remaining unresolved path segments.

In [std::io::Error::x], x would be unresolved.

The link failed to resolve. resolution_failure should look to see if there’s a more helpful error that can be given.

NoParentItem

This happens when rustdoc can’t determine the parent scope for an item. It is always a bug in rustdoc.

MalformedGenerics(MalformedGenerics)

This link has malformed generic parameters; e.g., the angle brackets are unbalanced.

Dummy

Used to communicate that this should be ignored, but shouldn’t be reported to the user.

This happens when there is no disambiguator and one of the namespaces failed to resolve.

Implementations

This resolved fully (not just partially) but is erroneous for some other reason

Returns the full resolution of the link, if present.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. 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

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: 56 bytes

Size for each variant:

  • WrongNamespace: 15 bytes
  • NotResolved: 55 bytes
  • NoParentItem: 0 bytes
  • MalformedGenerics: 1 byte
  • Dummy: 0 bytes