| <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="`hir_def` crate contains everything between macro expansion and type inference."><title>hir_def - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-84e720fa.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="hir_def" data-themes="" data-resource-suffix="" data-rustdoc-version="1.89.0 (29483883e 2025-08-04)" data-channel="1.89.0" data-search-js="search-92309212.js" data-settings-js="settings-5514c975.js" ><script src="../static.files/storage-4e99c027.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-fd3af306.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../hir_def/index.html">hir_def</a><span class="version">0.0.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#reexports">Crate Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>hir_def</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/hir_def/lib.rs.html#1-1449">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>hir_def</code> crate contains everything between macro expansion and type |
| inference.</p> |
| <p>It defines various items (structs, enums, traits) which comprises Rust code, |
| as well as an algorithm for resolving paths to such entities.</p> |
| <p>Note that <code>hir_def</code> is a work in progress, so not all of the above is |
| actually true.</p> |
| </div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.type_ref"><code>pub use self::hir::<a class="mod" href="hir/type_ref/index.html" title="mod hir_def::hir::type_ref">type_ref</a>;</code></dt><dt id="reexport.layout"><code>pub use rustc_abi as layout;</code></dt><dt id="reexport.layout-1"><code>pub use rustc_abi as layout;</code></dt><dt id="reexport.LocalFieldId"><code>pub use crate::signatures::<a class="type" href="signatures/type.LocalFieldId.html" title="type hir_def::signatures::LocalFieldId">LocalFieldId</a>;</code></dt><dt id="reexport.layout-2"><code>pub use rustc_abi as layout;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="attr/index.html" title="mod hir_def::attr">attr</a></dt><dd>A higher level attributes based on TokenTree, with also some shortcuts.</dd><dt><a class="mod" href="builtin_type/index.html" title="mod hir_def::builtin_type">builtin_<wbr>type</a></dt><dd>This module defines built-in types.</dd><dt><a class="mod" href="db/index.html" title="mod hir_def::db">db</a></dt><dd>Defines database & queries for name resolution.</dd><dt><a class="mod" href="dyn_map/index.html" title="mod hir_def::dyn_map">dyn_map</a></dt><dd>This module defines a <code>DynMap</code> – a container for heterogeneous maps.</dd><dt><a class="mod" href="expr_store/index.html" title="mod hir_def::expr_store">expr_<wbr>store</a></dt><dd>Defines <code>ExpressionStore</code>: a lowered representation of functions, statics and |
| consts.</dd><dt><a class="mod" href="find_path/index.html" title="mod hir_def::find_path">find_<wbr>path</a></dt><dd>An algorithm to find a path to refer to a certain item.</dd><dt><a class="mod" href="hir/index.html" title="mod hir_def::hir">hir</a></dt><dd>This module describes hir-level representation of expressions.</dd><dt><a class="mod" href="import_map/index.html" title="mod hir_def::import_map">import_<wbr>map</a></dt><dd>A map of all publicly exported items in a crate.</dd><dt><a class="mod" href="item_scope/index.html" title="mod hir_def::item_scope">item_<wbr>scope</a></dt><dd>Describes items defined or visible (ie, imported) in a certain scope. |
| This is shared between modules and blocks.</dd><dt><a class="mod" href="item_tree/index.html" title="mod hir_def::item_tree">item_<wbr>tree</a></dt><dd>A simplified AST that only contains items.</dd><dt><a class="mod" href="lang_item/index.html" title="mod hir_def::lang_item">lang_<wbr>item</a></dt><dd>Collects lang items: items marked with <code>#[lang = "..."]</code> attribute.</dd><dt><a class="mod" href="nameres/index.html" title="mod hir_def::nameres">nameres</a></dt><dd>This module implements import-resolution/macro expansion algorithm.</dd><dt><a class="mod" href="per_ns/index.html" title="mod hir_def::per_ns">per_ns</a></dt><dd>In rust, it is possible to have a value, a type and a macro with the same |
| name without conflicts.</dd><dt><a class="mod" href="resolver/index.html" title="mod hir_def::resolver">resolver</a></dt><dd>Name resolution façade.</dd><dt><a class="mod" href="signatures/index.html" title="mod hir_def::signatures">signatures</a></dt><dd>Item signature IR definitions</dd><dt><a class="mod" href="src/index.html" title="mod hir_def::src">src</a></dt><dd>Utilities for mapping between hir IDs and the surface syntax.</dd><dt><a class="mod" href="tt/index.html" title="mod hir_def::tt">tt</a></dt><dt><a class="mod" href="visibility/index.html" title="mod hir_def::visibility">visibility</a></dt><dd>Defines hir-level representation of visibility (e.g. <code>pub</code> and <code>pub(crate)</code>).</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.AssocItemLoc.html" title="struct hir_def::AssocItemLoc">Assoc<wbr>Item<wbr>Loc</a></dt><dt><a class="struct" href="struct.BlockId.html" title="struct hir_def::BlockId">BlockId</a></dt><dt><a class="struct" href="struct.BlockLoc.html" title="struct hir_def::BlockLoc">Block<wbr>Loc</a></dt><dt><a class="struct" href="struct.ConstId.html" title="struct hir_def::ConstId">ConstId</a></dt><dt><a class="struct" href="struct.ConstParamId.html" title="struct hir_def::ConstParamId">Const<wbr>Param<wbr>Id</a></dt><dd>A TypeOrConstParamId with an invariant that it actually belongs to a const</dd><dt><a class="struct" href="struct.CrateRootModuleId.html" title="struct hir_def::CrateRootModuleId">Crate<wbr>Root<wbr>Module<wbr>Id</a></dt><dd>A <code>ModuleId</code> that is always a crate’s root module.</dd><dt><a class="struct" href="struct.EnumId.html" title="struct hir_def::EnumId">EnumId</a></dt><dt><a class="struct" href="struct.EnumVariantId.html" title="struct hir_def::EnumVariantId">Enum<wbr>Variant<wbr>Id</a></dt><dt><a class="struct" href="struct.EnumVariantLoc.html" title="struct hir_def::EnumVariantLoc">Enum<wbr>Variant<wbr>Loc</a></dt><dt><a class="struct" href="struct.ExternBlockId.html" title="struct hir_def::ExternBlockId">Extern<wbr>Block<wbr>Id</a></dt><dt><a class="struct" href="struct.ExternCrateId.html" title="struct hir_def::ExternCrateId">Extern<wbr>Crate<wbr>Id</a></dt><dt><a class="struct" href="struct.FieldId.html" title="struct hir_def::FieldId">FieldId</a></dt><dt><a class="struct" href="struct.FunctionId.html" title="struct hir_def::FunctionId">Function<wbr>Id</a></dt><dt><a class="struct" href="struct.ImplId.html" title="struct hir_def::ImplId">ImplId</a></dt><dt><a class="struct" href="struct.ImportPathConfig.html" title="struct hir_def::ImportPathConfig">Import<wbr>Path<wbr>Config</a></dt><dd>A wrapper around three booleans</dd><dt><a class="struct" href="struct.ItemLoc.html" title="struct hir_def::ItemLoc">ItemLoc</a></dt><dt><a class="struct" href="struct.LifetimeParamId.html" title="struct hir_def::LifetimeParamId">Lifetime<wbr>Param<wbr>Id</a></dt><dt><a class="struct" href="struct.Macro2Id.html" title="struct hir_def::Macro2Id">Macro2<wbr>Id</a></dt><dt><a class="struct" href="struct.Macro2Loc.html" title="struct hir_def::Macro2Loc">Macro2<wbr>Loc</a></dt><dt><a class="struct" href="struct.MacroRulesId.html" title="struct hir_def::MacroRulesId">Macro<wbr>Rules<wbr>Id</a></dt><dt><a class="struct" href="struct.MacroRulesLoc.html" title="struct hir_def::MacroRulesLoc">Macro<wbr>Rules<wbr>Loc</a></dt><dt><a class="struct" href="struct.MacroRulesLocFlags.html" title="struct hir_def::MacroRulesLocFlags">Macro<wbr>Rules<wbr>LocFlags</a></dt><dt><a class="struct" href="struct.ModuleId.html" title="struct hir_def::ModuleId">Module<wbr>Id</a></dt><dt><a class="struct" href="struct.ProcMacroId.html" title="struct hir_def::ProcMacroId">Proc<wbr>Macro<wbr>Id</a></dt><dt><a class="struct" href="struct.ProcMacroLoc.html" title="struct hir_def::ProcMacroLoc">Proc<wbr>Macro<wbr>Loc</a></dt><dt><a class="struct" href="struct.StaticId.html" title="struct hir_def::StaticId">Static<wbr>Id</a></dt><dt><a class="struct" href="struct.StructId.html" title="struct hir_def::StructId">Struct<wbr>Id</a></dt><dt><a class="struct" href="struct.SyntheticSyntax.html" title="struct hir_def::SyntheticSyntax">Synthetic<wbr>Syntax</a></dt><dt><a class="struct" href="struct.TraitId.html" title="struct hir_def::TraitId">TraitId</a></dt><dt><a class="struct" href="struct.TupleFieldId.html" title="struct hir_def::TupleFieldId">Tuple<wbr>Field<wbr>Id</a></dt><dt><a class="struct" href="struct.TupleId.html" title="struct hir_def::TupleId">TupleId</a></dt><dt><a class="struct" href="struct.TypeAliasId.html" title="struct hir_def::TypeAliasId">Type<wbr>Alias<wbr>Id</a></dt><dt><a class="struct" href="struct.TypeOrConstParamId.html" title="struct hir_def::TypeOrConstParamId">Type<wbr>OrConst<wbr>Param<wbr>Id</a></dt><dt><a class="struct" href="struct.TypeParamId.html" title="struct hir_def::TypeParamId">Type<wbr>Param<wbr>Id</a></dt><dd>A TypeOrConstParamId with an invariant that it actually belongs to a type</dd><dt><a class="struct" href="struct.UnionId.html" title="struct hir_def::UnionId">UnionId</a></dt><dt><a class="struct" href="struct.UnresolvedMacro.html" title="struct hir_def::UnresolvedMacro">Unresolved<wbr>Macro</a></dt><dt><a class="struct" href="struct.UseId.html" title="struct hir_def::UseId">UseId</a></dt></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.AdtId.html" title="enum hir_def::AdtId">AdtId</a></dt><dd>A Data Type</dd><dt><a class="enum" href="enum.AssocItemId.html" title="enum hir_def::AssocItemId">Assoc<wbr>Item<wbr>Id</a></dt><dt><a class="enum" href="enum.AttrDefId.html" title="enum hir_def::AttrDefId">Attr<wbr>DefId</a></dt><dt><a class="enum" href="enum.CallableDefId.html" title="enum hir_def::CallableDefId">Callable<wbr>DefId</a></dt><dt><a class="enum" href="enum.Complete.html" title="enum hir_def::Complete">Complete</a></dt><dd><code>#[rust_analyzer::completions(...)]</code> options.</dd><dt><a class="enum" href="enum.DefWithBodyId.html" title="enum hir_def::DefWithBodyId">DefWith<wbr>Body<wbr>Id</a></dt><dd>The defs which have a body (have root expressions for type inference).</dd><dt><a class="enum" href="enum.GeneralConstId.html" title="enum hir_def::GeneralConstId">General<wbr>Const<wbr>Id</a></dt><dd>A constant, which might appears as a const item, an anonymous const block in expressions |
| or patterns, or as a constant in types with const generics.</dd><dt><a class="enum" href="enum.GenericDefId.html" title="enum hir_def::GenericDefId">Generic<wbr>DefId</a></dt><dt><a class="enum" href="enum.GenericParamId.html" title="enum hir_def::GenericParamId">Generic<wbr>Param<wbr>Id</a></dt><dd>A generic param</dd><dt><a class="enum" href="enum.ItemContainerId.html" title="enum hir_def::ItemContainerId">Item<wbr>Container<wbr>Id</a></dt><dt><a class="enum" href="enum.MacroExpander.html" title="enum hir_def::MacroExpander">Macro<wbr>Expander</a></dt><dt><a class="enum" href="enum.MacroId.html" title="enum hir_def::MacroId">MacroId</a></dt><dd>A macro</dd><dt><a class="enum" href="enum.ModuleDefId.html" title="enum hir_def::ModuleDefId">Module<wbr>DefId</a></dt><dd>The defs which can be visible in the module.</dd><dt><a class="enum" href="enum.VariantId.html" title="enum hir_def::VariantId">Variant<wbr>Id</a></dt></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.AstIdLoc.html" title="trait hir_def::AstIdLoc">AstId<wbr>Loc</a></dt><dt><a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a></dt><dt><a class="trait" href="trait.Intern.html" title="trait hir_def::Intern">Intern</a></dt><dt><a class="trait" href="trait.Lookup.html" title="trait hir_def::Lookup">Lookup</a></dt></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.macro_call_as_call_id.html" title="fn hir_def::macro_call_as_call_id">macro_<wbr>call_<wbr>as_<wbr>call_<wbr>id</a></dt></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.EnumLoc.html" title="type hir_def::EnumLoc">EnumLoc</a></dt><dt><a class="type" href="type.LocalModuleId.html" title="type hir_def::LocalModuleId">Local<wbr>Module<wbr>Id</a></dt><dd>An ID of a module, <strong>local</strong> to a <code>DefMap</code>.</dd><dt><a class="type" href="type.StaticLoc.html" title="type hir_def::StaticLoc">Static<wbr>Loc</a></dt><dt><a class="type" href="type.TraitLoc.html" title="type hir_def::TraitLoc">Trait<wbr>Loc</a></dt><dt><a class="type" href="type.UnionLoc.html" title="type hir_def::UnionLoc">Union<wbr>Loc</a></dt></dl><script type="text/json" id="notable-traits-data">{"TtIter<'_, S>":"<h3>Notable traits for <code>TtIter<'a, S></code></h3><pre><code><div class=\"where\">impl<'a, S> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.89.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for TtIter<'a, S></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.89.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = TtElement<'a, S>;</div>","TtIter<'a, S>":"<h3>Notable traits for <code>TtIter<'a, S></code></h3><pre><code><div class=\"where\">impl<'a, S> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.89.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for TtIter<'a, S></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.89.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = TtElement<'a, S>;</div>"}</script></section></div></main></body></html> |