repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/primitive.rs
src/tools/rust-analyzer/crates/hir-ty/src/primitive.rs
//! A few helper functions for dealing with primitives. pub use hir_def::builtin_type::{BuiltinFloat, BuiltinInt, BuiltinUint}; pub use rustc_type_ir::{FloatTy, IntTy, UintTy}; pub fn int_ty_to_string(ty: IntTy) -> &'static str { match ty { IntTy::Isize => "isize", IntTy::I8 => "i8", IntTy...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/consteval.rs
src/tools/rust-analyzer/crates/hir-ty/src/consteval.rs
//! Constant evaluation details #[cfg(test)] mod tests; use base_db::Crate; use hir_def::{ ConstId, EnumVariantId, GeneralConstId, HasModule, StaticId, attrs::AttrFlags, expr_store::Body, hir::{Expr, ExprId}, type_ref::LiteralConstRef, }; use hir_expand::Lookup; use rustc_type_ir::inherent::IntoKi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/variance.rs
src/tools/rust-analyzer/crates/hir-ty/src/variance.rs
//! Module for inferring the variance of type and lifetime parameters. See the [rustc dev guide] //! chapter for more info. //! //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/variance.html //! //! The implementation here differs from rustc. Rustc does a crate wide fixpoint resolution //! as the algorithm ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/inhabitedness.rs
src/tools/rust-analyzer/crates/hir-ty/src/inhabitedness.rs
//! Type inhabitedness logic. use std::ops::ControlFlow::{self, Break, Continue}; use hir_def::{AdtId, EnumVariantId, ModuleId, VariantId, visibility::Visibility}; use rustc_hash::FxHashSet; use rustc_type_ir::{ TypeSuperVisitable, TypeVisitable, TypeVisitor, inherent::{AdtDef, IntoKind}, }; use crate::{ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/layout.rs
src/tools/rust-analyzer/crates/hir-ty/src/layout.rs
//! Compute the binary representation of a type use std::fmt; use hir_def::{ AdtId, LocalFieldId, StructId, attrs::AttrFlags, layout::{LayoutCalculatorError, LayoutData}, }; use la_arena::{Idx, RawIdx}; use rustc_abi::{ AddressSpace, Float, Integer, LayoutCalculator, Primitive, ReprOptions, Scalar, S...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/drop.rs
src/tools/rust-analyzer/crates/hir-ty/src/drop.rs
//! Utilities for computing drop info about types. use hir_def::{AdtId, signatures::StructFlags}; use rustc_hash::FxHashSet; use rustc_type_ir::inherent::{AdtDef, IntoKind}; use stdx::never; use crate::{ InferenceResult, consteval, method_resolution::TraitImpls, next_solver::{ DbInterner, ParamEnv...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/specialization.rs
src/tools/rust-analyzer/crates/hir-ty/src/specialization.rs
//! Impl specialization related things use hir_def::{HasModule, ImplId, nameres::crate_def_map}; use intern::sym; use tracing::debug; use crate::{ db::HirDatabase, lower::GenericPredicates, next_solver::{ DbInterner, TypingMode, infer::{DbInternerInferExt, traits::ObligationCause}, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs
src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs
//! 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 //! [rustc guide](https://rust-lang.github.io/rustc-guide/method-lookup.html) //! and the corresponding code mostly in rustc_hir_analysis/check/method/probe.rs. ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/traits.rs
src/tools/rust-analyzer/crates/hir-ty/src/traits.rs
//! Trait solving using next trait solver. use std::hash::Hash; use base_db::Crate; use hir_def::{ AdtId, AssocItemId, HasModule, ImplId, Lookup, TraitId, lang_item::LangItems, nameres::DefMap, signatures::{ConstFlags, EnumFlags, FnFlags, StructFlags, TraitFlags, TypeAliasFlags}, }; use hir_expand::na...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/dyn_compatibility.rs
src/tools/rust-analyzer/crates/hir-ty/src/dyn_compatibility.rs
//! Compute the dyn-compatibility of a trait use std::ops::ControlFlow; use hir_def::{ AssocItemId, ConstId, FunctionId, GenericDefId, HasModule, TraitId, TypeAliasId, TypeOrConstParamId, TypeParamId, hir::generics::LocalTypeOrConstParamId, nameres::crate_def_map, signatures::TraitFlags, }; use rustc_hash...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/target_feature.rs
src/tools/rust-analyzer/crates/hir-ty/src/target_feature.rs
//! Stuff for handling `#[target_feature]` (needed for unsafe check). use std::borrow::Cow; use std::sync::LazyLock; use hir_def::FunctionId; use hir_def::attrs::AttrFlags; use intern::Symbol; use rustc_hash::{FxHashMap, FxHashSet}; use crate::db::HirDatabase; #[derive(Debug, Default, Clone)] pub struct TargetFeatu...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/builtin_derive.rs
src/tools/rust-analyzer/crates/hir-ty/src/builtin_derive.rs
//! Implementation of builtin derive impls. use std::ops::ControlFlow; use hir_def::{ AdtId, BuiltinDeriveImplId, BuiltinDeriveImplLoc, HasModule, LocalFieldId, TraitId, TypeOrConstParamId, TypeParamId, attrs::AttrFlags, builtin_derive::BuiltinDeriveImplTrait, hir::generics::{GenericParams, TypeOr...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/diagnostics.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/diagnostics.rs
use crate::tests::check_no_mismatches; use super::check; #[test] fn function_return_type_mismatch_1() { check( r#" fn test() -> &'static str { 5 //^ expected &'static str, got i32 } "#, ); } #[test] fn function_return_type_mismatch_2() { check( r#" fn test(x: bool) -> &'static str {...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/closure_captures.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/closure_captures.rs
use expect_test::{Expect, expect}; use hir_def::db::DefDatabase; use hir_expand::{HirFileId, files::InFileWrapper}; use itertools::Itertools; use span::TextRange; use syntax::{AstNode, AstPtr}; use test_fixture::WithFixture; use crate::{ InferenceResult, db::HirDatabase, display::{DisplayTarget, HirDisplay...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/regression.rs
mod new_solver; use expect_test::expect; use super::{check_infer, check_no_mismatches, check_types}; #[test] fn bug_484() { check_infer( r#" fn test() { let x = if true {}; } "#, expect![[r#" 10..37 '{ ... {}; }': () 20..21 'x': () ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/opaque_types.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/opaque_types.rs
use expect_test::expect; use super::{check_infer_with_mismatches, check_no_mismatches, check_types}; #[test] fn associated_type_impl_trait() { check_types( r#" trait Foo {} struct S1; impl Foo for S1 {} trait Bar { type Item; fn bar(&self) -> Self::Item; } struct S2; impl Bar for S2 { type It...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/simple.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/simple.rs
use expect_test::expect; use crate::tests::check_infer_with_mismatches; use super::{check, check_infer, check_no_mismatches, check_types}; #[test] fn infer_adt_self() { check_types( r#" enum Nat { Succ(Self), Demo(Nat), Zero } fn test() { let foo: Nat = Nat::Zero; if let Nat::Succ(x) = foo { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/macros.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/macros.rs
use expect_test::expect; use test_utils::{bench, bench_fixture, skip_slow_tests}; use crate::tests::{check_infer_with_mismatches, check_no_mismatches}; use super::{check_infer, check_types}; #[test] fn cfg_impl_def() { check_types( r#" //- /main.rs crate:main deps:foo cfg:test use foo::S as T; struct S; ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/patterns.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/patterns.rs
use expect_test::expect; use super::{check, check_infer, check_infer_with_mismatches, check_no_mismatches, check_types}; #[test] fn infer_pattern() { check_infer( r#" //- minicore: iterator, add, builtin_impls fn test(x: &i32) { let y = x; let &z = x; le...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/method_resolution.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/method_resolution.rs
use expect_test::expect; use crate::tests::check; use super::{check_infer, check_no_mismatches, check_types}; #[test] fn infer_slice_method() { check_types( r#" //- /core.rs crate:core impl<T> [T] { #[rustc_allow_incoherent_impl] fn foo(&self) -> T { loop {} } } fn test(x: &[u8]) { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/trait_aliases.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/trait_aliases.rs
use crate::tests::check_types; #[test] fn projection() { check_types( r#" #![feature(trait_alias)] pub trait A { type Output; } pub trait B = A<Output = u32>; pub fn a<T: B>(x: T::Output) { x; // ^ u32 } "#, ); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/traits.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/traits.rs
use expect_test::expect; use crate::tests::infer_with_mismatches; use super::{check, check_infer, check_infer_with_mismatches, check_no_mismatches, check_types}; #[test] fn infer_await() { check_types( r#" //- minicore: future struct IntFuture; impl core::future::Future for IntFuture { type Output =...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/display_source_code.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/display_source_code.rs
use super::check_types_source_code; #[test] fn qualify_path_to_submodule() { check_types_source_code( r#" mod foo { pub struct Foo; } fn bar() { let foo: foo::Foo = foo::Foo; foo; } //^^^ foo::Foo "#, ); } #[test] fn omit_default_type_parameters() { check_types_source_code( r...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/never_type.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/never_type.rs
use expect_test::expect; use super::{check_infer_with_mismatches, check_no_mismatches, check_types}; #[test] fn infer_never1() { check_types( r#" fn test() { let t = return; t; } //^ ! "#, ); } #[test] fn infer_never2() { check_types( r#" fn gen<T>() -> T { loop {} } fn test() { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/coercion.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/coercion.rs
use super::{check, check_no_mismatches, check_types}; #[test] fn block_expr_type_mismatch() { check( r" fn test() { let a: i32 = { 1i64 }; // ^^^^ expected i32, got i64 } ", ); } #[test] fn coerce_places() { check_no_mismatches( r#" //- minicore: coerce_unsized ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/incremental.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/incremental.rs
use base_db::SourceDatabase; use expect_test::Expect; use hir_def::{DefWithBodyId, ModuleDefId}; use salsa::EventKind; use test_fixture::WithFixture; use crate::{InferenceResult, method_resolution::TraitImpls, test_db::TestDB}; use super::visit_module; #[test] fn typing_whitespace_inside_a_function_should_not_invali...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs
src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs
use expect_test::expect; use crate::tests::{check_infer, check_no_mismatches, check_types}; #[test] fn regression_20365() { check_infer( r#" //- minicore: iterator struct Vec<T>(T); struct IntoIter<T>(T); impl<T> IntoIterator for Vec<T> { type IntoIter = IntoIter<T>; type Item = T; } impl<T> Itera...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution/probe.rs
src/tools/rust-analyzer/crates/hir-ty/src/method_resolution/probe.rs
//! Candidate assembly and selection in method resolution - where we enumerate all candidates //! and choose the best one (or, in some IDE scenarios, just enumerate them all). use std::{cell::RefCell, convert::Infallible, ops::ControlFlow}; use hir_def::{ AssocItemId, FunctionId, GenericParamId, ImplId, ItemConta...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution/confirm.rs
src/tools/rust-analyzer/crates/hir-ty/src/method_resolution/confirm.rs
//! Confirmation step of method selection, meaning ensuring the selected candidate //! is valid and registering all obligations. use hir_def::{ FunctionId, GenericDefId, GenericParamId, ItemContainerId, TraitId, expr_store::path::{GenericArg as HirGenericArg, GenericArgs as HirGenericArgs}, hir::{ExprId, g...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/opaques.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/opaques.rs
//! Things related to opaques in the next-trait-solver. use intern::{Interned, InternedRef, impl_internable}; use macros::GenericTypeVisitable; use rustc_ast_ir::try_visit; use rustc_type_ir::inherent::SliceLike; use crate::next_solver::{impl_foldable_for_interned_slice, interned_slice}; use super::{DbInterner, Solv...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/consts.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/consts.rs
//! Things related to consts in the next-trait-solver. use std::hash::Hash; use hir_def::ConstParamId; use intern::{Interned, InternedRef, impl_internable}; use macros::{GenericTypeVisitable, TypeFoldable, TypeVisitable}; use rustc_ast_ir::visit::VisitorResult; use rustc_type_ir::{ BoundVar, BoundVarIndexKind, Co...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/fold.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/fold.rs
//! Fold impls for the next-trait-solver. use rustc_type_ir::{ BoundVarIndexKind, DebruijnIndex, RegionKind, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, inherent::IntoKind, }; use crate::next_solver::{BoundConst, FxIndexMap}; use super::{ Binder, BoundRegion, BoundTy, Const, ConstKind,...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs
//! Defining `SolverContext` for next-trait-solver. use hir_def::{AssocItemId, GeneralConstId}; use rustc_next_trait_solver::delegate::SolverDelegate; use rustc_type_ir::{ AliasTyKind, GenericArgKind, InferCtxtLike, Interner, PredicatePolarity, TypeFlags, TypeVisitableExt, inherent::{IntoKind, Term as _, T...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/region.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/region.rs
//! Things related to regions. use hir_def::LifetimeParamId; use intern::{Interned, InternedRef, Symbol, impl_internable}; use macros::GenericTypeVisitable; use rustc_type_ir::{ BoundVar, BoundVarIndexKind, DebruijnIndex, Flags, GenericTypeVisitable, INNERMOST, RegionVid, TypeFlags, TypeFoldable, TypeVisitable...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/def_id.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/def_id.rs
//! Definition of `SolverDefId` use hir_def::{ AdtId, AttrDefId, BuiltinDeriveImplId, CallableDefId, ConstId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, GeneralConstId, GenericDefId, ImplId, StaticId, StructId, TraitId, TypeAliasId, UnionId, }; use rustc_type_ir::inherent; use stdx::impl_from; use ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs
//! Things related to the Interner in the next-trait-solver. use std::{fmt, ops::ControlFlow}; use intern::{Interned, InternedRef, InternedSliceRef, impl_internable}; use macros::GenericTypeVisitable; use rustc_ast_ir::{FloatTy, IntTy, UintTy}; pub use tls_cache::clear_tls_solver_cache; pub use tls_db::{attach_db, at...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/abi.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/abi.rs
//! ABI-related things in the next-trait-solver. use rustc_type_ir::{error::TypeError, relate::Relate}; use crate::FnAbi; use super::interner::DbInterner; #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub enum Safety { Unsafe, Safe, } impl<'db> Relate<DbInterner<'db>> for Safety { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/format_proof_tree.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/format_proof_tree.rs
use rustc_type_ir::{solve::GoalSource, solve::inspect::GoalEvaluation}; use serde_derive::{Deserialize, Serialize}; use crate::next_solver::inspect::{InspectCandidate, InspectGoal}; use crate::next_solver::{AnyImplId, infer::InferCtxt}; use crate::next_solver::{DbInterner, Span}; #[derive(Debug, Clone, Serialize, Des...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/predicate.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/predicate.rs
//! Things related to predicates. use std::cmp::Ordering; use intern::{ Interned, InternedRef, InternedSlice, InternedSliceRef, impl_internable, impl_slice_internable, }; use macros::{GenericTypeVisitable, TypeFoldable, TypeVisitable}; use rustc_type_ir::{ self as ty, CollectAndApply, EarlyBinder, FlagComputa...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generics.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generics.rs
//! Things related to generics in the next-trait-solver. use hir_def::{ ConstParamId, GenericDefId, GenericParamId, LifetimeParamId, TypeOrConstParamId, TypeParamId, hir::generics::{GenericParams, TypeOrConstParamData}, }; use rustc_type_ir::inherent::GenericsOf; use crate::generics::parent_generic_def; use ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/structural_normalize.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/structural_normalize.rs
use rustc_type_ir::{AliasRelationDirection, inherent::Term as _}; use crate::next_solver::{ Const, PredicateKind, Term, Ty, fulfill::{FulfillmentCtxt, NextSolverError}, infer::{at::At, traits::Obligation}, }; impl<'db> At<'_, 'db> { pub(crate) fn structurally_normalize_ty( &self, ty: T...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/util.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/util.rs
//! Various utilities for the next-trait-solver. use std::ops::ControlFlow; use hir_def::TraitId; use rustc_abi::{Float, HasDataLayout, Integer, IntegerType, Primitive, ReprOptions}; use rustc_type_ir::{ ConstKind, CoroutineArgs, DebruijnIndex, FloatTy, INNERMOST, IntTy, Interner, PredicatePolarity, RegionKin...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/fulfill.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/fulfill.rs
//! Fulfill loop for next-solver. mod errors; use std::ops::ControlFlow; use rustc_hash::FxHashSet; use rustc_next_trait_solver::{ delegate::SolverDelegate, solve::{GoalEvaluation, GoalStalledOn, HasChanged, SolverDelegateEvalExt}, }; use rustc_type_ir::{ Interner, TypeSuperVisitable, TypeVisitable, Type...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/ty.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/ty.rs
//! Things related to tys in the next-trait-solver. use std::ops::ControlFlow; use hir_def::{ AdtId, HasModule, TypeParamId, hir::generics::{TypeOrConstParamData, TypeParamProvenance}, }; use hir_def::{TraitId, type_ref::Rawness}; use intern::{Interned, InternedRef, impl_internable}; use macros::GenericTypeVi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/normalize.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/normalize.rs
use rustc_next_trait_solver::placeholder::BoundVarReplacer; use rustc_type_ir::{ AliasRelationDirection, FallibleTypeFolder, Flags, Interner, TermKind, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, UniverseIndex, inherent::{IntoKind, Term as _}, }; use crate::next_solver::{ Binder, Con...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generic_arg.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generic_arg.rs
//! Things related to generic args in the next-trait-solver (`GenericArg`, `GenericArgs`, `Term`). //! //! Implementations of `GenericArg` and `Term` are pointer-tagged instead of an enum (rustc does //! the same). This is done to save memory (which also helps speed) - one `GenericArg` is a machine //! word instead of ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/binder.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/binder.rs
use crate::{ FnAbi, next_solver::{ Binder, Clauses, EarlyBinder, FnSig, PolyFnSig, StoredBoundVarKinds, StoredClauses, StoredTy, StoredTys, Ty, abi::Safety, }, }; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct StoredEarlyBinder<T>(T); impl<T> StoredEarlyBinder<T> { #[inl...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/ir_print.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/ir_print.rs
//! Things related to IR printing in the next-trait-solver. use std::any::type_name_of_val; use rustc_type_ir::{self as ty, ir_print::IrPrint}; use super::SolverDefId; use super::interner::DbInterner; impl<'db> IrPrint<ty::AliasTy<Self>> for DbInterner<'db> { fn print(t: &ty::AliasTy<Self>, fmt: &mut std::fmt::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/inspect.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/inspect.rs
pub(crate) use rustc_next_trait_solver::solve::inspect::*; use rustc_ast_ir::try_visit; use rustc_next_trait_solver::{ canonical::instantiate_canonical_state, resolve::eager_resolve_vars, solve::{SolverDelegateEvalExt, inspect}, }; use rustc_type_ir::{ VisitorResult, inherent::{IntoKind, Span as _}...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/obligation_ctxt.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/obligation_ctxt.rs
use hir_def::TraitId; use rustc_type_ir::{TypeFoldable, Upcast, Variance}; use crate::next_solver::{ Const, DbInterner, ParamEnv, Term, TraitRef, Ty, TypeError, fulfill::{FulfillmentCtxt, NextSolverError}, infer::{ InferCtxt, InferOk, at::ToTrace, traits::{Obligation, ObligationCaus...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/fulfill/errors.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/fulfill/errors.rs
//! Trait solving error diagnosis and reporting. //! //! This code isn't used by rust-analyzer (it should, but then it'll probably be better to re-port it from rustc). //! It's only there because without it, debugging trait solver errors is a nightmare. use std::{fmt::Debug, ops::ControlFlow}; use rustc_next_trait_so...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/select.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/select.rs
#![expect(dead_code, reason = "this is used by rustc")] use std::ops::ControlFlow; use hir_def::TraitId; use macros::{TypeFoldable, TypeVisitable}; use rustc_type_ir::{ Interner, solve::{BuiltinImplSource, CandidateSource, Certainty, inspect::ProbeKind}, }; use crate::{ db::InternedOpaqueTyId, next_s...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/mod.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/mod.rs
//! Infer context the next-trait-solver. use std::cell::{Cell, RefCell}; use std::fmt; use std::ops::Range; use std::sync::Arc; pub use BoundRegionConversionTime::*; use ena::unify as ut; use hir_def::GenericParamId; use opaque_types::{OpaqueHiddenType, OpaqueTypeStorage}; use region_constraints::{RegionConstraintCol...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/resolve.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/resolve.rs
//! Things for resolving vars in the infer context of the next-trait-solver. use rustc_type_ir::{ TypeFolder, TypeSuperFoldable, TypeVisitableExt, data_structures::DelayedMap, inherent::{Const as _, Ty as _}, }; use crate::next_solver::{Const, DbInterner, ErrorGuaranteed, Region, Ty}; use super::InferCtx...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/at.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/at.rs
//! A nice interface for working with the infcx. The basic idea is to //! do `infcx.at(cause, param_env)`, which sets the "cause" of the //! operation as well as the surrounding parameter environment. Then //! you can do something like `.sub(a, b)` or `.eq(a, b)` to create a //! subtype or equality relationship respect...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/type_variable.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/type_variable.rs
//! Storage for type variables for the infer context the next-trait-solver. use std::cmp; use std::marker::PhantomData; use std::ops::Range; use ena::snapshot_vec as sv; use ena::undo_log::Rollback; use ena::unify as ut; use rustc_index::IndexVec; use rustc_type_ir::TyVid; use rustc_type_ir::UniverseIndex; use rustc_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/traits.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/traits.rs
//! Trait Resolution. See the [rustc-dev-guide] for more information on how this works. //! //! [rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/traits/resolution.html use std::{ cmp, hash::{Hash, Hasher}, }; use hir_def::TraitId; use macros::{TypeFoldable, TypeVisitable}; use rustc_type_ir::elaborate...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/unify_key.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/unify_key.rs
//! Unification keyes for the infer context the next-trait-solver. use std::cmp; use std::marker::PhantomData; use ena::unify::{NoError, UnifyKey, UnifyValue}; use rustc_type_ir::{ConstVid, RegionKind, RegionVid, UniverseIndex, inherent::IntoKind}; use crate::next_solver::{Const, Region}; #[derive(Clone, Debug)] pu...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/context.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/context.rs
//! Definition of `InferCtxtLike` from the librarified type layer. use rustc_type_ir::{ ConstVid, FloatVarValue, FloatVid, GenericArgKind, InferConst, InferTy, IntVarValue, IntVid, RegionVid, TyVid, TypeFoldable, TypingMode, UniverseIndex, inherent::{Const as _, IntoKind, Ty as _}, relate::combine::Pre...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/canonical/mod.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/canonical/mod.rs
//! **Canonicalization** is the key to constructing a query in the //! middle of type inference. Ordinarily, it is not possible to store //! types from type inference in query keys, because they contain //! references to inference variables whose lifetimes are too short //! and so forth. Canonicalizing a value T1 using...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/canonical/canonicalizer.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/canonical/canonicalizer.rs
//! This module contains code to canonicalize values into a `Canonical<'db, T>`. //! //! For an overview of what canonicalization is and how it fits into //! rustc, check out the [chapter in the rustc dev guide][c]. //! //! [c]: https://rust-lang.github.io/chalk/book/canonical_queries/canonicalization.html use rustc_h...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/canonical/instantiate.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/canonical/instantiate.rs
//! This module contains code to instantiate new values into a //! `Canonical<'db, T>`. //! //! For an overview of what canonicalization is and how it fits into //! rustc, check out the [chapter in the rustc dev guide][c]. //! //! [c]: https://rust-lang.github.io/chalk/book/canonical_queries/canonicalization.html use ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/table.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/table.rs
//! Things related to storage opaques in the infer context of the next-trait-solver. use std::ops::Deref; use ena::undo_log::UndoLogs; use tracing::instrument; use super::OpaqueHiddenType; use crate::next_solver::{ FxIndexMap, OpaqueTypeKey, Ty, infer::snapshot::undo_log::{InferCtxtUndoLogs, UndoLog}, }; #[...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/mod.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/mod.rs
//! Things related to the infer context of the next-trait-solver. pub(crate) mod table; pub(crate) use table::{OpaqueTypeStorage, OpaqueTypeTable}; use macros::{TypeFoldable, TypeVisitable}; use crate::next_solver::{OpaqueTypeKey, Ty, infer::InferCtxt}; #[derive(Copy, Clone, Debug, TypeVisitable, TypeFoldable)] pu...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/outlives/mod.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/outlives/mod.rs
mod obligations;
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/outlives/obligations.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/outlives/obligations.rs
use ena::undo_log::UndoLogs; use rustc_type_ir::{OutlivesPredicate, TypeVisitableExt}; use tracing::{debug, instrument}; use crate::next_solver::{ ArgOutlivesPredicate, GenericArgKind, Region, RegionOutlivesPredicate, Ty, infer::{InferCtxt, TypeOutlivesConstraint, snapshot::undo_log::UndoLog}, }; impl<'db> In...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/region_constraints/mod.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/region_constraints/mod.rs
//! See `README.md`. use std::ops::Range; use std::{cmp, fmt, mem}; use ena::undo_log::{Rollback, UndoLogs}; use ena::unify as ut; use rustc_hash::FxHashMap; use rustc_index::IndexVec; use rustc_type_ir::inherent::IntoKind; use rustc_type_ir::{RegionKind, RegionVid, UniverseIndex}; use tracing::{debug, instrument}; ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/higher_ranked.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/higher_ranked.rs
//! Helper routines for higher-ranked things. See the `doc` module at //! the end of the file for details. use rustc_type_ir::TypeFoldable; use tracing::{debug, instrument}; use crate::next_solver::fold::FnMutDelegate; use crate::next_solver::infer::InferCtxt; use crate::next_solver::{ Binder, BoundConst, BoundRe...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/lattice.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/lattice.rs
//! # Lattice variables //! //! Generic code for operating on [lattices] of inference variables //! that are characterized by an upper- and lower-bound. //! //! The code is defined quite generically so that it can be //! applied both to type variables, which represent types being inferred, //! and fn variables, which r...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/generalize.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/generalize.rs
//! Type generation code. use std::mem; use rustc_hash::FxHashMap; use rustc_type_ir::error::TypeError; use rustc_type_ir::inherent::{Const as _, IntoKind, Ty as _}; use rustc_type_ir::relate::VarianceDiagInfo; use rustc_type_ir::{ AliasRelationDirection, ConstVid, InferConst, InferCtxtLike, InferTy, RegionKind, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/mod.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/relate/mod.rs
//! This module contains the definitions of most `TypeRelation`s in the type system //! (except for some relations used for diagnostics and heuristics in the compiler). //! As well as the implementation of `Relate` for interned things (`Ty`/`Const`/etc). pub use rustc_type_ir::relate::combine::PredicateEmittingRelatio...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/snapshot/mod.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/snapshot/mod.rs
//! Snapshotting in the infer ctxt of the next-trait-solver. use ena::undo_log::UndoLogs; use rustc_type_ir::UniverseIndex; use tracing::{debug, instrument}; use super::InferCtxt; use super::region_constraints::RegionSnapshot; mod fudge; pub(crate) mod undo_log; use undo_log::{Snapshot, UndoLog}; #[must_use = "onc...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/snapshot/undo_log.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/snapshot/undo_log.rs
//! Snapshotting in the infer ctxt of the next-trait-solver. use ena::snapshot_vec as sv; use ena::undo_log::{Rollback, UndoLogs}; use ena::unify as ut; use rustc_type_ir::FloatVid; use rustc_type_ir::IntVid; use tracing::debug; use crate::next_solver::OpaqueTypeKey; use crate::next_solver::infer::opaque_types::Opaqu...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/snapshot/fudge.rs
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/snapshot/fudge.rs
use std::ops::Range; use ena::{ snapshot_vec as sv, unify::{self as ut, UnifyKey}, }; use rustc_type_ir::{ ConstVid, FloatVid, IntVid, RegionKind, RegionVid, TyVid, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, inherent::IntoKind, }; use crate::next_solver::{ Const, ConstKind, DbI...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/layout/tests.rs
src/tools/rust-analyzer/crates/hir-ty/src/layout/tests.rs
use base_db::target::TargetData; use either::Either; use hir_def::{HasModule, db::DefDatabase}; use project_model::{Sysroot, toolchain_info::QueryConfig}; use rustc_hash::FxHashMap; use rustc_type_ir::inherent::GenericArgs as _; use syntax::ToSmolStr; use test_fixture::WithFixture; use triomphe::Arc; use crate::{ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/layout/target.rs
src/tools/rust-analyzer/crates/hir-ty/src/layout/target.rs
//! Target dependent parameters needed for layouts use base_db::{Crate, target::TargetLoadError}; use hir_def::layout::TargetDataLayout; use rustc_abi::{AddressSpace, AlignFromBytesError, TargetDataLayoutErrors}; use triomphe::Arc; use crate::db::HirDatabase; pub fn target_data_layout_query( db: &dyn HirDatabase...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/layout/adt.rs
src/tools/rust-analyzer/crates/hir-ty/src/layout/adt.rs
//! Compute the binary representation of structs, unions and enums use std::{cmp, ops::Bound}; use hir_def::{ AdtId, VariantId, attrs::AttrFlags, signatures::{StructFlags, VariantFields}, }; use rustc_abi::{Integer, ReprOptions, TargetDataLayout}; use rustc_index::IndexVec; use smallvec::SmallVec; use tri...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/layout/tests/closure.rs
src/tools/rust-analyzer/crates/hir-ty/src/layout/tests/closure.rs
#![allow(clippy::match_single_binding)] #![allow(clippy::no_effect)] use crate::size_and_align_expr; #[test] fn zero_capture_simple() { size_and_align_expr! { |x: i32| x + 2 } } #[test] fn move_simple() { size_and_align_expr! { minicore: copy; stmts: [] let y: i32 = 5; ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/op.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/op.rs
//! Inference of binary and unary operators. use std::collections::hash_map; use hir_def::{GenericParamId, TraitId, hir::ExprId}; use intern::{Symbol, sym}; use rustc_ast_ir::Mutability; use rustc_type_ir::inherent::{IntoKind, Ty as _}; use syntax::ast::{ArithOp, BinaryOp, UnaryOp}; use tracing::debug; use crate::{ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/opaques.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/opaques.rs
//! Defining opaque types via inference. use rustc_type_ir::{TypeVisitableExt, fold_regions}; use tracing::{debug, instrument}; use crate::{ infer::InferenceContext, next_solver::{ EarlyBinder, OpaqueTypeKey, SolverDefId, TypingMode, infer::{opaque_types::OpaqueHiddenType, traits::ObligationCa...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/diagnostics.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/diagnostics.rs
//! This file contains the [`Diagnostics`] type used during inference, //! and a wrapper around [`TyLoweringContext`] ([`InferenceTyLoweringContext`]) that replaces //! it and takes care of diagnostics in inference. use std::cell::RefCell; use std::ops::{Deref, DerefMut}; use either::Either; use hir_def::GenericDefId...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs
//! Path expression resolution. use hir_def::{ AdtId, AssocItemId, GenericDefId, ItemContainerId, Lookup, expr_store::path::{Path, PathSegment}, resolver::{ResolveValueResult, TypeNs, ValueNs}, }; use hir_expand::name::Name; use rustc_type_ir::inherent::{SliceLike, Ty as _}; use stdx::never; use crate::{ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/unify.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/unify.rs
//! Unification and canonicalization logic. use std::fmt; use base_db::Crate; use hir_def::{AdtId, DefWithBodyId, GenericParamId}; use hir_expand::name::Name; use intern::sym; use rustc_hash::FxHashSet; use rustc_type_ir::{ TyVid, TypeFoldable, TypeVisitableExt, UpcastFrom, inherent::{Const as _, GenericArg a...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs
//! Type inference for expressions. use std::{iter::repeat_with, mem}; use either::Either; use hir_def::{ FieldId, GenericDefId, ItemContainerId, Lookup, TupleFieldId, TupleId, expr_store::path::{GenericArgs as HirGenericArgs, Path}, hir::{ Array, AsmOperand, AsmOptions, BinaryOp, BindingAnnotatio...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/pat.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/pat.rs
//! Type inference for patterns. use std::{cmp, iter}; use hir_def::{ HasModule, expr_store::{Body, path::Path}, hir::{Binding, BindingAnnotation, BindingId, Expr, ExprId, Literal, Pat, PatId}, }; use hir_expand::name::Name; use rustc_ast_ir::Mutability; use rustc_type_ir::inherent::{GenericArg as _, Gene...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/place_op.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/place_op.rs
//! Inference of *place operators*: deref and indexing (operators that create places, as opposed to values). use hir_def::hir::ExprId; use intern::sym; use rustc_ast_ir::Mutability; use rustc_type_ir::inherent::{IntoKind, Ty as _}; use tracing::debug; use crate::{ Adjust, Adjustment, AutoBorrow, PointerCast, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs
//! # Type Coercion //! //! Under certain circumstances we will coerce from one type to another, //! for example by auto-borrowing. This occurs in situations where the //! compiler has a firm 'expected type' that was supplied from the user, //! and where the actual type is similar to that expected type in purpose //! b...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/autoderef.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/autoderef.rs
//! Autoderef helpers for inference. use std::iter; use rustc_ast_ir::Mutability; use crate::{ Adjust, Adjustment, OverloadedDeref, autoderef::{Autoderef, AutoderefCtx, AutoderefKind, GeneralAutoderef}, infer::unify::InferenceTable, next_solver::{ Ty, infer::{InferOk, traits::Predicat...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/closure.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/closure.rs
//! Inference of closure parameter types based on the closure's expected type. pub(crate) mod analysis; use std::{iter, mem, ops::ControlFlow}; use hir_def::{ TraitId, hir::{ClosureKind, ExprId, PatId}, type_ref::TypeRefId, }; use rustc_type_ir::{ ClosureArgs, ClosureArgsParts, CoroutineArgs, Corouti...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/mutability.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/mutability.rs
//! Finds if an expression is an immutable context or a mutable context, which is used in selecting //! between `Deref` and `DerefMut` or `Index` and `IndexMut` or similar. use hir_def::hir::{ Array, AsmOperand, BinaryOp, BindingAnnotation, Expr, ExprId, Pat, PatId, Statement, UnaryOp, }; use rustc_ast_ir::Mutabil...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/cast.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/cast.rs
//! Type cast logic. Basically coercion + additional casts. use hir_def::{AdtId, hir::ExprId, signatures::TraitFlags}; use rustc_ast_ir::Mutability; use rustc_type_ir::{ Flags, InferTy, TypeFlags, UintTy, inherent::{AdtDef, BoundExistentialPredicates as _, IntoKind, Ty as _}, }; use stdx::never; use crate::{ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/fallback.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/fallback.rs
//! Fallback of infer vars to `!` and `i32`/`f64`. use intern::sym; use petgraph::{ Graph, visit::{Dfs, Walker}, }; use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet}; use rustc_type_ir::{ TyVid, inherent::{IntoKind, Ty as _}, }; use tracing::debug; use crate::{ infer::InferenceContext, nex...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/infer/closure/analysis.rs
src/tools/rust-analyzer/crates/hir-ty/src/infer/closure/analysis.rs
//! Post-inference closure analysis: captures and closure kind. use std::{cmp, mem}; use base_db::Crate; use hir_def::{ DefWithBodyId, FieldId, HasModule, VariantId, expr_store::path::Path, hir::{ Array, AsmOperand, BinaryOp, BindingId, CaptureBy, Expr, ExprId, ExprOrPatId, Pat, PatId, Sta...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/unsafe_check.rs
src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/unsafe_check.rs
//! Provides validations for unsafe code. Currently checks if unsafe functions are missing //! unsafe blocks. use std::mem; use either::Either; use hir_def::{ AdtId, CallableDefId, DefWithBodyId, FieldId, FunctionId, VariantId, expr_store::{Body, path::Path}, hir::{AsmOperand, Expr, ExprId, ExprOrPatId, I...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/expr.rs
src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/expr.rs
//! Various diagnostics for expressions that are collected together in one pass //! through the body using inference results: mismatched arg counts, missing //! fields, etc. use std::fmt; use base_db::Crate; use either::Either; use hir_def::{ AdtId, AssocItemId, DefWithBodyId, HasModule, ItemContainerId, Lookup, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/decl_check.rs
src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/decl_check.rs
//! Provides validators for names of declarations. //! //! This includes the following items: //! //! - variable bindings (e.g. `let x = foo();`) //! - struct fields (e.g. `struct Foo { field: u8 }`) //! - enum variants (e.g. `enum Foo { Variant { field: u8 } }`) //! - function/method arguments (e.g. `fn foo(arg: u8)`)...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check.rs
src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check.rs
//! Validation of matches. //! //! This module provides lowering from [hir_def::hir::Pat] to [self::Pat] and match //! checking algorithm. //! //! It is modeled on the rustc module `rustc_mir_build::thir::pattern`. mod pat_util; pub(crate) mod pat_analysis; use hir_def::{ AdtId, EnumVariantId, LocalFieldId, Look...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/decl_check/case_conv.rs
src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/decl_check/case_conv.rs
//! Functions for string case manipulation, such as detecting the identifier case, //! and converting it into appropriate form. // Code that was taken from rustc was taken at commit 89fdb30, // from file /compiler/rustc_lint/src/nonstandard_style.rs /// Converts an identifier to an UpperCamelCase form. /// Returns `N...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs
src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs
//! Interface with `rustc_pattern_analysis`. use std::{cell::LazyCell, fmt}; use hir_def::{ EnumId, EnumVariantId, HasModule, LocalFieldId, ModuleId, VariantId, attrs::AttrFlags, }; use intern::sym; use rustc_pattern_analysis::{ IndexVec, PatCx, PrivateUninhabitedField, constructor::{Constructor, Construc...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_util.rs
src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_util.rs
//! Pattern utilities. //! //! Originates from `rustc_hir::pat_util` use std::iter::Enumerate; pub(crate) struct EnumerateAndAdjust<I> { enumerate: Enumerate<I>, gap_pos: usize, gap_len: usize, } impl<I> Iterator for EnumerateAndAdjust<I> where I: Iterator, { type Item = (usize, <I as Iterator>::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false