blob: 62c17d180491bee5edebf3de0b7c244b1cf7c731 [file] [log] [blame] [edit]
<!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="The type system. We currently use this to infer types for completion, hover information and various assists."><title>hir_ty - 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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="hir_ty" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.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]--><rustdoc-topbar><h2><a href="#">Crate hir_ty</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../hir_ty/index.html">hir_ty</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="#functions" title="Functions">Functions</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"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>hir_ty</span>&nbsp;<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_ty/lib.rs.html#1-618">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The type system. We currently use this to infer types for completion, hover
information and various assists.</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.autoderef"><code>pub use autoderef::<a class="fn" href="autoderef/fn.autoderef.html" title="fn hir_ty::autoderef::autoderef">autoderef</a>;</code></dt><dt id="reexport.check_orphan_rules"><code>pub use method_resolution::<a class="fn" href="method_resolution/fn.check_orphan_rules.html" title="fn hir_ty::method_resolution::check_orphan_rules">check_orphan_rules</a>;</code></dt><dt id="reexport.attach_db"><code>pub use next_solver::interner::<a class="fn" href="next_solver/interner/fn.attach_db.html" title="fn hir_ty::next_solver::interner::attach_db">attach_db</a>;</code></dt><dt id="reexport.attach_db_allow_change"><code>pub use next_solver::interner::<a class="fn" href="next_solver/interner/fn.attach_db_allow_change.html" title="fn hir_ty::next_solver::interner::attach_db_allow_change">attach_db_allow_change</a>;</code></dt><dt id="reexport.with_attached_db"><code>pub use next_solver::interner::<a class="fn" href="next_solver/interner/fn.with_attached_db.html" title="fn hir_ty::next_solver::interner::with_attached_db">with_attached_db</a>;</code></dt><dt id="reexport.TraitEnvironment"><code>pub use traits::<a class="struct" href="traits/struct.TraitEnvironment.html" title="struct hir_ty::traits::TraitEnvironment">TraitEnvironment</a>;</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="autoderef/index.html" title="mod hir_ty::autoderef">autoderef</a></dt><dd>In certain situations, rust automatically inserts derefs as necessary: for
example, field accesses <code>foo.bar</code> still work when <code>foo</code> is actually a
reference to a type with the field <code>bar</code>. This is an approximation of the
logic in rustc (which lives in rustc_hir_analysis/check/autoderef.rs).</dd><dt><a class="mod" href="consteval/index.html" title="mod hir_ty::consteval">consteval</a></dt><dd>Constant evaluation details</dd><dt><a class="mod" href="db/index.html" title="mod hir_ty::db">db</a></dt><dd>The home of <code>HirDatabase</code>, which is the Salsa database containing all the
type inference-related queries.</dd><dt><a class="mod" href="diagnostics/index.html" title="mod hir_ty::diagnostics">diagnostics</a></dt><dd>Type inference-based diagnostics.</dd><dt><a class="mod" href="display/index.html" title="mod hir_ty::display">display</a></dt><dd>The <code>HirDisplay</code> trait, which serves two purposes: Turning various bits from
HIR back into source code, and just displaying them for debugging/testing
purposes.</dd><dt><a class="mod" href="drop/index.html" title="mod hir_ty::drop">drop</a></dt><dd>Utilities for computing drop info about types.</dd><dt><a class="mod" href="dyn_compatibility/index.html" title="mod hir_ty::dyn_compatibility">dyn_<wbr>compatibility</a></dt><dd>Compute the dyn-compatibility of a trait</dd><dt><a class="mod" href="generics/index.html" title="mod hir_ty::generics">generics</a></dt><dd>Utilities for working with generics.</dd><dt><a class="mod" href="lang_items/index.html" title="mod hir_ty::lang_items">lang_<wbr>items</a></dt><dd>Functions to detect special lang items</dd><dt><a class="mod" href="layout/index.html" title="mod hir_ty::layout">layout</a></dt><dd>Compute the binary representation of a type</dd><dt><a class="mod" href="method_resolution/index.html" title="mod hir_ty::method_resolution">method_<wbr>resolution</a></dt><dd>This module is concerned with finding methods that a given type provides.
For details about how this works in rustc, see the method lookup page in the
<a href="https://rust-lang.github.io/rustc-guide/method-lookup.html">rustc guide</a>
and the corresponding code mostly in rustc_hir_analysis/check/method/probe.rs.</dd><dt><a class="mod" href="mir/index.html" title="mod hir_ty::mir">mir</a></dt><dd>MIR definitions and implementation</dd><dt><a class="mod" href="next_solver/index.html" title="mod hir_ty::next_solver">next_<wbr>solver</a></dt><dd>Things relevant to the next trait solver.</dd><dt><a class="mod" href="primitive/index.html" title="mod hir_ty::primitive">primitive</a></dt><dd>A few helper functions for dealing with primitives.</dd><dt><a class="mod" href="traits/index.html" title="mod hir_ty::traits">traits</a></dt><dd>Trait solving using next trait solver.</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.Adjustment.html" title="struct hir_ty::Adjustment">Adjustment</a></dt><dd>Represents coercing a value to a different type of value.</dd><dt><a class="struct" href="struct.CapturedItem.html" title="struct hir_ty::CapturedItem">Captured<wbr>Item</a></dt><dt><a class="struct" href="struct.ComplexMemoryMap.html" title="struct hir_ty::ComplexMemoryMap">Complex<wbr>Memory<wbr>Map</a></dt><dt><a class="struct" href="struct.InferenceResult.html" title="struct hir_ty::InferenceResult">Inference<wbr>Result</a></dt><dd>The result of type inference: A mapping from expressions and patterns to types.</dd><dt><a class="struct" href="struct.OverloadedDeref.html" title="struct hir_ty::OverloadedDeref">Overloaded<wbr>Deref</a></dt><dd>An overloaded autoderef step, representing a <code>Deref(Mut)::deref(_mut)</code>
call, with the signature <code>&amp;'a T -&gt; &amp;'a U</code> or <code>&amp;'a mut T -&gt; &amp;'a mut U</code>.
The target type is <code>U</code> in both cases, with the region and mutability
being those shared by both the receiver and the returned reference.</dd><dt><a class="struct" href="struct.TargetFeatures.html" title="struct hir_ty::TargetFeatures">Target<wbr>Features</a></dt><dt><a class="struct" href="struct.TyLoweringContext.html" title="struct hir_ty::TyLoweringContext">TyLowering<wbr>Context</a></dt><dt><a class="struct" href="struct.TyLoweringDiagnostic.html" title="struct hir_ty::TyLoweringDiagnostic">TyLowering<wbr>Diagnostic</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.Adjust.html" title="enum hir_ty::Adjust">Adjust</a></dt><dt><a class="enum" href="enum.AutoBorrow.html" title="enum hir_ty::AutoBorrow">Auto<wbr>Borrow</a></dt><dt><a class="enum" href="enum.BindingMode.html" title="enum hir_ty::BindingMode">Binding<wbr>Mode</a></dt><dd>Binding modes inferred for patterns.
<a href="https://doc.rust-lang.org/reference/patterns.html#binding-modes">https://doc.rust-lang.org/reference/patterns.html#binding-modes</a></dd><dt><a class="enum" href="enum.CaptureKind.html" title="enum hir_ty::CaptureKind">Capture<wbr>Kind</a></dt><dt><a class="enum" href="enum.CastError.html" title="enum hir_ty::CastError">Cast<wbr>Error</a></dt><dt><a class="enum" href="enum.FnAbi.html" title="enum hir_ty::FnAbi">FnAbi</a></dt><dt><a class="enum" href="enum.GenericArgsProhibitedReason.html" title="enum hir_ty::GenericArgsProhibitedReason">Generic<wbr>Args<wbr>Prohibited<wbr>Reason</a></dt><dt><a class="enum" href="enum.ImplTraitId.html" title="enum hir_ty::ImplTraitId">Impl<wbr>Trait<wbr>Id</a></dt><dt><a class="enum" href="enum.IncorrectGenericsLenKind.html" title="enum hir_ty::IncorrectGenericsLenKind">Incorrect<wbr>Generics<wbr>LenKind</a></dt><dt><a class="enum" href="enum.InferenceDiagnostic.html" title="enum hir_ty::InferenceDiagnostic">Inference<wbr>Diagnostic</a></dt><dt><a class="enum" href="enum.InferenceTyDiagnosticSource.html" title="enum hir_ty::InferenceTyDiagnosticSource">Inference<wbr>TyDiagnostic<wbr>Source</a></dt><dt><a class="enum" href="enum.LifetimeElisionKind.html" title="enum hir_ty::LifetimeElisionKind">Lifetime<wbr>Elision<wbr>Kind</a></dt><dt><a class="enum" href="enum.MemoryMap.html" title="enum hir_ty::MemoryMap">Memory<wbr>Map</a></dt><dd>A constant can have reference to other things. Memory map job is holding
the necessary bits of memory of the const eval session to keep the constant
meaningful.</dd><dt><a class="enum" href="enum.PathGenericsSource.html" title="enum hir_ty::PathGenericsSource">Path<wbr>Generics<wbr>Source</a></dt><dd>A path can have many generic arguments: each segment may have one associated with the
segment, and in addition, each associated type binding may have generic arguments. This
enum abstracts over both.</dd><dt><a class="enum" href="enum.PathLoweringDiagnostic.html" title="enum hir_ty::PathLoweringDiagnostic">Path<wbr>Lowering<wbr>Diagnostic</a></dt><dt><a class="enum" href="enum.PointerCast.html" title="enum hir_ty::PointerCast">Pointer<wbr>Cast</a></dt><dt><a class="enum" href="enum.TargetFeatureIsSafeInTarget.html" title="enum hir_ty::TargetFeatureIsSafeInTarget">Target<wbr>Feature<wbr>IsSafe<wbr>InTarget</a></dt><dt><a class="enum" href="enum.TyDefId.html" title="enum hir_ty::TyDefId">TyDefId</a></dt><dt><a class="enum" href="enum.TyLoweringDiagnosticKind.html" title="enum hir_ty::TyLoweringDiagnosticKind">TyLowering<wbr>Diagnostic<wbr>Kind</a></dt><dt><a class="enum" href="enum.Unsafety.html" title="enum hir_ty::Unsafety">Unsafety</a></dt><dt><a class="enum" href="enum.ValueTyDefId.html" title="enum hir_ty::ValueTyDefId">Value<wbr>TyDef<wbr>Id</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.all_super_traits.html" title="fn hir_ty::all_super_traits">all_<wbr>super_<wbr>traits</a></dt><dd>Returns an iterator over the whole super trait hierarchy (including the
trait itself).</dd><dt><a class="fn" href="fn.associated_type_shorthand_candidates.html" title="fn hir_ty::associated_type_shorthand_candidates">associated_<wbr>type_<wbr>shorthand_<wbr>candidates</a></dt><dt><a class="fn" href="fn.callable_sig_from_fn_trait.html" title="fn hir_ty::callable_sig_from_fn_trait">callable_<wbr>sig_<wbr>from_<wbr>fn_<wbr>trait</a></dt><dd>To be used from <code>hir</code> only.</dd><dt><a class="fn" href="fn.collect_params.html" title="fn hir_ty::collect_params">collect_<wbr>params</a></dt><dd>Returns unique params for types and consts contained in <code>value</code>.</dd><dt><a class="fn" href="fn.could_coerce.html" title="fn hir_ty::could_coerce">could_<wbr>coerce</a></dt><dt><a class="fn" href="fn.could_unify.html" title="fn hir_ty::could_unify">could_<wbr>unify</a></dt><dd>Check if types unify.</dd><dt><a class="fn" href="fn.could_unify_deeply.html" title="fn hir_ty::could_unify_deeply">could_<wbr>unify_<wbr>deeply</a></dt><dd>Check if types unify eagerly making sure there are no unresolved goals.</dd><dt><a class="fn" href="fn.direct_super_traits.html" title="fn hir_ty::direct_super_traits">direct_<wbr>super_<wbr>traits</a></dt><dd>Returns an iterator over the direct super traits (including the trait itself).</dd><dt><a class="fn" href="fn.is_fn_unsafe_to_call.html" title="fn hir_ty::is_fn_unsafe_to_call">is_<wbr>fn_<wbr>unsafe_<wbr>to_<wbr>call</a></dt><dt><a class="fn" href="fn.known_const_to_ast.html" title="fn hir_ty::known_const_to_ast">known_<wbr>const_<wbr>to_<wbr>ast</a></dt><dt><a class="fn" href="fn.param_idx.html" title="fn hir_ty::param_idx">param_<wbr>idx</a></dt><dd>Return an index of a parameter in the generic type parameter list by it’s id.</dd><dt><a class="fn" href="fn.replace_errors_with_variables.html" title="fn hir_ty::replace_errors_with_variables">replace_<wbr>errors_<wbr>with_<wbr>variables</a></dt><dd>‘Canonicalizes’ the <code>t</code> by replacing any errors with new variables. Also
ensures there are no unbound variables or inference variables anywhere in
the <code>t</code>.</dd><dt><a class="fn" href="fn.setup_tracing.html" title="fn hir_ty::setup_tracing">setup_<wbr>tracing</a></dt><dt><a class="fn" href="fn.target_feature_is_safe_in_target.html" title="fn hir_ty::target_feature_is_safe_in_target">target_<wbr>feature_<wbr>is_<wbr>safe_<wbr>in_<wbr>target</a></dt></dl></section></div></main></body></html>