pub(crate) fn def_to_moniker(
db: &RootDatabase,
definition: Definition,
from_crate: Crate,
) -> Option<MonikerResult>Expand description
Computes a MonikerResult for a definition. Result cases:
-
Some(MonikerResult::Moniker(_))provides a uniqueMonikerwhich refers to a definition. -
Some(MonikerResult::Local { .. })provides aMonikerfor the definition enclosing a local. -
Noneis returned for definitions which are not in a module:BuiltinAttr,BuiltinType,BuiltinLifetime,TupleField,ToolModule, andInlineAsmRegOrRegClass. TODO: it might be sensible to provide monikers that refer to some non-existent crate of compiler builtin definitions.