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-def/src/src.rs
src/tools/rust-analyzer/crates/hir-def/src/src.rs
//! Utilities for mapping between hir IDs and the surface syntax. use either::Either; use hir_expand::{AstId, InFile}; use la_arena::{Arena, ArenaMap, Idx}; use syntax::{AstNode, AstPtr, ast}; use crate::{ AstIdLoc, GenericDefId, LocalFieldId, LocalLifetimeParamId, LocalTypeOrConstParamId, Lookup, UseId, Vari...
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-def/src/attrs.rs
src/tools/rust-analyzer/crates/hir-def/src/attrs.rs
//! Attributes for anything that is not name resolution. //! //! The fundamental idea of this module stems from the observation that most "interesting" //! attributes have a more memory-compact form than storing their full syntax, and //! that most of the attributes are flags, and those that are not are rare. Therefore...
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-def/src/lib.rs
src/tools/rust-analyzer/crates/hir-def/src/lib.rs
//! `hir_def` crate contains everything between macro expansion and type //! inference. //! //! It defines various items (structs, enums, traits) which comprises Rust code, //! as well as an algorithm for resolving paths to such entities. //! //! Note that `hir_def` is a work in progress, so not all of the above is //!...
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-def/src/hir.rs
src/tools/rust-analyzer/crates/hir-def/src/hir.rs
//! This module describes hir-level representation of expressions. //! //! This representation is: //! //! 1. Identity-based. Each expression has an `id`, so we can distinguish //! between different `1` in `1 + 1`. //! 2. Independent of syntax. Though syntactic provenance information can be //! attached separatel...
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-def/src/signatures.rs
src/tools/rust-analyzer/crates/hir-def/src/signatures.rs
//! Item signature IR definitions use std::{cell::LazyCell, ops::Not as _}; use bitflags::bitflags; use cfg::{CfgExpr, CfgOptions}; use hir_expand::{ InFile, Intern, Lookup, name::{AsName, Name}, }; use intern::{Symbol, sym}; use la_arena::{Arena, Idx}; use rustc_abi::{IntegerType, ReprOptions}; use syntax::{...
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-def/src/per_ns.rs
src/tools/rust-analyzer/crates/hir-def/src/per_ns.rs
//! In rust, it is possible to have a value, a type and a macro with the same //! name without conflicts. //! //! `PerNs` (per namespace) captures this. use bitflags::bitflags; use crate::{ MacroId, ModuleDefId, item_scope::{ImportId, ImportOrExternCrate, ImportOrGlob, ItemInNs}, visibility::Visibility, }...
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-def/src/import_map.rs
src/tools/rust-analyzer/crates/hir-def/src/import_map.rs
//! A map of all publicly exported items in a crate. use std::fmt; use base_db::Crate; use fst::{Automaton, Streamer, raw::IndexedValue}; use hir_expand::name::Name; use itertools::Itertools; use rustc_hash::FxHashSet; use smallvec::SmallVec; use span::Edition; use stdx::format_to; use triomphe::Arc; use crate::{ ...
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-def/src/builtin_type.rs
src/tools/rust-analyzer/crates/hir-def/src/builtin_type.rs
//! This module defines built-in types. //! //! A peculiarity of built-in types is that they are always available and are //! not associated with any particular crate. use std::fmt; use hir_expand::name::{AsName, Name}; use intern::{Symbol, sym}; /// Different signed int types. #[derive(Copy, Clone, Debug, PartialEq,...
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-def/src/test_db.rs
src/tools/rust-analyzer/crates/hir-def/src/test_db.rs
//! Database used for testing `hir_def`. use std::{fmt, panic, sync::Mutex}; use base_db::{ Crate, CrateGraphBuilder, CratesMap, FileSourceRootInput, FileText, Nonce, RootQueryDb, SourceDatabase, SourceRoot, SourceRootId, SourceRootInput, }; use hir_expand::{InFile, files::FilePosition}; use salsa::Durability...
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-def/src/find_path.rs
src/tools/rust-analyzer/crates/hir-def/src/find_path.rs
//! An algorithm to find a path to refer to a certain item. use std::{cell::Cell, cmp::Ordering, iter}; use base_db::{Crate, CrateOrigin, LangCrateOrigin}; use hir_expand::{ Lookup, mod_path::{ModPath, PathKind}, name::{AsName, Name}, }; use intern::sym; use rustc_hash::FxHashSet; use crate::{ FindPa...
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-def/src/item_scope.rs
src/tools/rust-analyzer/crates/hir-def/src/item_scope.rs
//! Describes items defined or visible (ie, imported) in a certain scope. //! This is shared between modules and blocks. use std::{fmt, sync::LazyLock}; use base_db::Crate; use hir_expand::{AstId, MacroCallId, attrs::AttrId, name::Name}; use indexmap::map::Entry; use itertools::Itertools; use la_arena::Idx; use rustc...
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-def/src/resolver.rs
src/tools/rust-analyzer/crates/hir-def/src/resolver.rs
//! Name resolution façade. use std::{fmt, mem}; use base_db::Crate; use hir_expand::{ MacroDefId, mod_path::{ModPath, PathKind}, name::{AsName, Name}, }; use intern::{Symbol, sym}; use itertools::Itertools as _; use rustc_hash::FxHashSet; use smallvec::{SmallVec, smallvec}; use span::SyntaxContext; use sy...
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-def/src/nameres.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres.rs
//! This module implements import-resolution/macro expansion algorithm. //! //! The result of this module is `DefMap`: a data structure which contains: //! //! * a tree of modules for the crate //! * for each module, a set of items visible in the module (directly declared //! or imported) //! //! Note that `Def...
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-def/src/expr_store.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store.rs
//! Defines `ExpressionStore`: a lowered representation of functions, statics and //! consts. pub mod body; mod expander; pub mod lower; pub mod path; pub mod pretty; pub mod scope; #[cfg(test)] mod tests; use std::{ ops::{Deref, Index}, sync::LazyLock, }; use cfg::{CfgExpr, CfgOptions}; use either::Either; u...
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-def/src/lang_item.rs
src/tools/rust-analyzer/crates/hir-def/src/lang_item.rs
//! Collects lang items: items marked with `#[lang = "..."]` attribute. //! //! This attribute to tell the compiler about semi built-in std library //! features, such as Fn family of traits. use hir_expand::name::Name; use intern::{Symbol, sym}; use stdx::impl_from; use crate::{ AdtId, AssocItemId, AttrDefId, Crat...
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-def/src/builtin_derive.rs
src/tools/rust-analyzer/crates/hir-def/src/builtin_derive.rs
//! Definition of builtin derive impls. //! //! To save time and memory, builtin derives are not really expanded. Instead, we record them //! and create their impls based on lowered data, see crates/hir-ty/src/builtin_derive.rs. use hir_expand::{InFile, builtin::BuiltinDeriveExpander, name::Name}; use intern::{Symbol,...
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-def/src/item_tree.rs
src/tools/rust-analyzer/crates/hir-def/src/item_tree.rs
//! A simplified AST that only contains items. //! //! This is the primary IR used throughout `hir_def`. It is the input to the name resolution //! algorithm, as well as to the queries defined in `adt.rs`, `data.rs`, and most things in //! `attr.rs`. //! //! `ItemTree`s are built per `HirFileId`, from the syntax tree o...
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-def/src/item_tree/attrs.rs
src/tools/rust-analyzer/crates/hir-def/src/item_tree/attrs.rs
//! Defines attribute helpers for name resolution. //! //! Notice we don't preserve all attributes for name resolution, to save space: //! for example, we skip doc comments (desugared to `#[doc = "..."]` attributes) //! and `#[inline]`. The filtered attributes are listed in [`hir_expand::attrs`]. use std::{ borrow...
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-def/src/item_tree/tests.rs
src/tools/rust-analyzer/crates/hir-def/src/item_tree/tests.rs
use expect_test::{Expect, expect}; use span::Edition; use test_fixture::WithFixture; use crate::{db::DefDatabase, test_db::TestDB}; fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect) { let (db, file_id) = TestDB::with_single_file(ra_fixture); let item_tree = db.file_item_tree(file_id.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-def/src/item_tree/lower.rs
src/tools/rust-analyzer/crates/hir-def/src/item_tree/lower.rs
//! AST -> `ItemTree` lowering code. use std::cell::OnceCell; use base_db::FxIndexSet; use cfg::CfgOptions; use hir_expand::{ HirFileId, mod_path::PathKind, name::AsName, span_map::{SpanMap, SpanMapRef}, }; use la_arena::Arena; use span::{AstIdMap, FileAstId, SyntaxContext}; use syntax::{ AstNode,...
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-def/src/item_tree/pretty.rs
src/tools/rust-analyzer/crates/hir-def/src/item_tree/pretty.rs
//! `ItemTree` debug printer. use std::fmt::{self, Write}; use span::{Edition, ErasedFileAstId}; use crate::{ item_tree::{ Const, DefDatabase, Enum, ExternBlock, ExternCrate, FieldsShape, Function, Impl, ItemTree, Macro2, MacroCall, MacroRules, Mod, ModItemId, ModKind, RawVisibilityId, Static, St...
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-def/src/macro_expansion_tests/proc_macros.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/proc_macros.rs
//! Tests for user-defined procedural macros. //! //! Note `//- proc_macros: identity` fixture metas in tests -- we don't use real //! proc-macros here, as that would be slow. Instead, we use several hard-coded //! in-memory macros. use expect_test::expect; use crate::macro_expansion_tests::{check, check_errors}; #[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-def/src/macro_expansion_tests/mbe.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe.rs
//! Tests specific to declarative macros, aka macros by example. This covers //! both stable `macro_rules!` macros as well as unstable `macro` macros. mod matching; mod meta_syntax; mod metavar_expr; mod regression; mod tt_conversion; use expect_test::expect; use crate::macro_expansion_tests::check; #[test] fn toke...
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-def/src/macro_expansion_tests/builtin_derive_macro.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs
//! Tests for `builtin_derive_macro.rs` from `hir_expand`. use expect_test::expect; use crate::macro_expansion_tests::{check, check_errors}; #[test] fn test_copy_expand_simple() { check( r#" //- minicore: derive, copy #[derive(Copy)] struct Foo; "#, expect![[r#" #[derive(Copy)] struct Foo; impl ...
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-def/src/macro_expansion_tests/builtin_fn_macro.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs
//! Tests for `builtin_fn_macro.rs` from `hir_expand`. use expect_test::expect; use crate::macro_expansion_tests::check; #[test] fn test_column_expand() { check( r#" #[rustc_builtin_macro] macro_rules! column {() => {}} fn main() { column!(); } "#, expect![[r#" #[rustc_builtin_macro] macro_rules...
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-def/src/macro_expansion_tests/mod.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mod.rs
//! This module contains integration tests for macro expansion with name resolution. Effectively, it //! covers `tt`, `mbe`, `proc_macro_api` and `hir_expand` crates. This might seem like a wrong //! architecture at the first glance, but is intentional. //! //! Physically, macro expansion process is intertwined with 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-def/src/macro_expansion_tests/mbe/metavar_expr.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/metavar_expr.rs
//! Tests for RFC 3086 metavariable expressions. use expect_test::expect; use crate::macro_expansion_tests::check; #[test] fn test_dollar_dollar() { check( r#" macro_rules! register_struct { ($Struct:ident) => { macro_rules! register_methods { ($$($method:ident),*) => { macro_rules! implement...
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-def/src/macro_expansion_tests/mbe/matching.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/matching.rs
//! Test that `$var:expr` captures function correctly. use expect_test::expect; use crate::macro_expansion_tests::check; #[test] fn unary_minus_is_a_literal() { check( r#" macro_rules! m { ($x:literal) => (literal!();); ($x:tt) => (not_a_literal!();); } m!(92); m!(-92); m!(-9.2); m!(--92); "#, ex...
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-def/src/macro_expansion_tests/mbe/regression.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
//! Real world regressions and issues, not particularly minimized. //! //! While it's OK to just dump large macros here, it's preferable to come up //! with a minimal example for the program and put a specific test to the parent //! directory. use expect_test::expect; use crate::macro_expansion_tests::check; #[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-def/src/macro_expansion_tests/mbe/meta_syntax.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/meta_syntax.rs
//! Test for the syntax of macros themselves. use expect_test::expect; use crate::macro_expansion_tests::check; #[test] fn well_formed_macro_rules() { check( r#" macro_rules! m { ($i:ident) => (); ($(x),*) => (); ($(x)_*) => (); ($(x)i*) => (); ($(x)'a*) => (); ($(x)'_*) => (); ...
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-def/src/macro_expansion_tests/mbe/tt_conversion.rs
src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/tt_conversion.rs
//! Unlike rustc, rust-analyzer's syntax tree are not "made of" token trees. //! Rather, token trees are an explicit bridge between the parser and //! (procedural or declarative) macros. //! //! This module tests tt <-> syntax tree conversion specifically. In particular, //! it, among other things, check that we conver...
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-def/src/expr_store/path.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/path.rs
//! A desugared representation of paths like `crate::foo` or `<Type as Trait>::bar`. use std::iter; use crate::{ lang_item::LangItemTarget, type_ref::{ConstRef, LifetimeRefId, TypeBound, TypeRefId}, }; use hir_expand::{ mod_path::{ModPath, PathKind}, name::Name, }; use intern::Interned; #[derive(Debu...
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-def/src/expr_store/tests.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests.rs
mod body; mod signatures;
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-def/src/expr_store/lower.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs
//! Transforms `ast::Expr` into an equivalent `hir_def::expr::Expr` //! representation. mod asm; mod format_args; mod generics; mod path; use std::{cell::OnceCell, mem}; use base_db::FxIndexSet; use cfg::CfgOptions; use either::Either; use hir_expand::{ HirFileId, InFile, MacroDefId, name::{AsName, Name}, ...
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-def/src/expr_store/scope.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/scope.rs
//! Name resolution for expressions. use hir_expand::{MacroDefId, name::Name}; use la_arena::{Arena, ArenaMap, Idx, IdxRange, RawIdx}; use triomphe::Arc; use crate::{ BlockId, DefWithBodyId, db::DefDatabase, expr_store::{Body, ExpressionStore, HygieneId}, hir::{Binding, BindingId, Expr, ExprId, Item, L...
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-def/src/expr_store/body.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/body.rs
//! Defines `Body`: a lowered representation of functions, statics and //! consts. use std::ops; use hir_expand::{InFile, Lookup}; use span::Edition; use syntax::ast; use triomphe::Arc; use crate::{ DefWithBodyId, HasModule, db::DefDatabase, expr_store::{ ExpressionStore, ExpressionStoreSourceMap,...
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-def/src/expr_store/pretty.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/pretty.rs
//! A pretty-printer for HIR. #![allow(dead_code)] use std::{ fmt::{self, Write}, mem, }; use hir_expand::{Lookup, mod_path::PathKind}; use itertools::Itertools; use span::Edition; use syntax::ast::{HasName, RangeOp}; use crate::{ AdtId, DefWithBodyId, FunctionId, GenericDefId, StructId, TypeParamId, Var...
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-def/src/expr_store/expander.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/expander.rs
//! Macro expansion utilities. use std::mem; use base_db::Crate; use cfg::CfgOptions; use drop_bomb::DropBomb; use hir_expand::AstId; use hir_expand::span_map::SpanMapRef; use hir_expand::{ ExpandError, ExpandErrorKind, ExpandResult, HirFileId, InFile, Lookup, MacroCallId, eager::EagerCallBackFn, mod_path::Mo...
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-def/src/expr_store/tests/signatures.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests/signatures.rs
use crate::{ GenericDefId, ModuleDefId, expr_store::pretty::{print_function, print_struct}, nameres::crate_def_map, test_db::TestDB, }; use expect_test::{Expect, expect}; use test_fixture::WithFixture; use super::super::*; fn lower_and_print(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Exp...
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-def/src/expr_store/tests/body.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests/body.rs
mod block; use crate::{DefWithBodyId, ModuleDefId, hir::MatchArm, nameres::crate_def_map, test_db::TestDB}; use expect_test::{Expect, expect}; use la_arena::RawIdx; use test_fixture::WithFixture; use triomphe::Arc; use super::super::*; fn lower(#[rust_analyzer::rust_fixture] ra_fixture: &str) -> (TestDB, Arc<Body>, ...
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-def/src/expr_store/tests/body/block.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests/body/block.rs
use super::*; use expect_test::expect; #[test] fn inner_item_smoke() { check_at( r#" struct inner {} fn outer() { $0 fn inner() {} } "#, expect![[r#" (block scope) - inner : value crate - inner : type - outer : value "#]],...
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-def/src/expr_store/lower/path.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/path.rs
//! Transforms syntax into `Path` objects, ideally with accounting for hygiene #[cfg(test)] mod tests; use std::iter; use crate::expr_store::{ lower::{ExprCollector, generics::ImplTraitLowerFn}, path::NormalPath, }; use hir_expand::{ mod_path::{ModPath, PathKind, resolve_crate_root}, name::{AsName, ...
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-def/src/expr_store/lower/asm.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/asm.rs
//! Lowering of inline assembly. use hir_expand::name::Name; use intern::Symbol; use rustc_hash::{FxHashMap, FxHashSet}; use syntax::{ AstNode, AstPtr, AstToken, T, ast::{self, HasName, IsString}, }; use tt::TextRange; use crate::{ expr_store::lower::{ExprCollector, FxIndexSet}, hir::{AsmOperand, AsmOp...
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-def/src/expr_store/lower/format_args.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/format_args.rs
//! Lowering of `format_args!()`. use base_db::FxIndexSet; use hir_expand::name::Name; use intern::{Symbol, sym}; use syntax::{AstPtr, AstToken as _, ast}; use crate::{ builtin_type::BuiltinUint, expr_store::{HygieneId, lower::ExprCollector, path::Path}, hir::{ Array, BindingAnnotation, Expr, Expr...
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-def/src/expr_store/lower/generics.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/generics.rs
//! Many kinds of items or constructs can have generic parameters: functions, //! structs, impls, traits, etc. This module provides a common HIR for these //! generic parameters. See also the `Generics` type and the `generics_of` query //! in rustc. use std::sync::LazyLock; use either::Either; use hir_expand::name::{...
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-def/src/expr_store/lower/path/tests.rs
src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/path/tests.rs
use expect_test::{Expect, expect}; use span::Edition; use syntax::ast::{self, make}; use test_fixture::WithFixture; use crate::{ expr_store::{ ExpressionStore, lower::{ ExprCollector, path::{SEGMENT_LOWERING_MAP, hir_segment_to_ast_segment}, }, path::Path, ...
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-def/src/hir/format_args.rs
src/tools/rust-analyzer/crates/hir-def/src/hir/format_args.rs
//! Parses `format_args` input. use either::Either; use hir_expand::name::Name; use intern::Symbol; use rustc_parse_format as parse; use span::SyntaxContext; use stdx::TupleExt; use syntax::{ TextRange, ast::{self, IsString}, }; use crate::hir::ExprId; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Format...
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-def/src/hir/type_ref.rs
src/tools/rust-analyzer/crates/hir-def/src/hir/type_ref.rs
//! HIR for references to types. Paths in these are not yet resolved. They can //! be directly created from an ast::TypeRef, without further queries. use std::fmt::Write; use hir_expand::name::Name; use intern::Symbol; use la_arena::Idx; use thin_vec::ThinVec; use crate::{ LifetimeParamId, TypeParamId, built...
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-def/src/hir/generics.rs
src/tools/rust-analyzer/crates/hir-def/src/hir/generics.rs
//! Pre-type IR item generics use std::{ops, sync::LazyLock}; use hir_expand::name::Name; use la_arena::{Arena, Idx, RawIdx}; use stdx::impl_from; use thin_vec::ThinVec; use triomphe::Arc; use crate::{ AdtId, ConstParamId, GenericDefId, LifetimeParamId, TypeOrConstParamId, TypeParamId, db::DefDatabase, ex...
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-def/src/nameres/diagnostics.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/diagnostics.rs
//! Diagnostics emitted during DefMap construction. use std::ops::Not; use cfg::{CfgExpr, CfgOptions}; use hir_expand::{ErasedAstId, ExpandErrorKind, MacroCallKind, attrs::AttrId, mod_path::ModPath}; use la_arena::Idx; use syntax::ast; use crate::{AstId, nameres::ModuleId}; #[derive(Debug, PartialEq, Eq)] pub enum ...
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-def/src/nameres/tests.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/tests.rs
mod globs; mod incremental; mod macros; mod mod_resolution; mod primitives; use base_db::RootQueryDb; use expect_test::{Expect, expect}; use test_fixture::WithFixture; use crate::{ nameres::{DefMap, crate_def_map}, test_db::TestDB, }; fn compute_crate_def_map( #[rust_analyzer::rust_fixture] ra_fixture: &...
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-def/src/nameres/path_resolution.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/path_resolution.rs
//! This modules implements a function to resolve a path `foo::bar::baz` to a //! def, which is used within the name resolution. //! //! When name resolution is finished, the result of resolving a path is either //! `Some(def)` or `None`. However, when we are in process of resolving imports //! or macros, there's a thi...
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-def/src/nameres/assoc.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/assoc.rs
//! Expansion of associated items use std::mem; use cfg::CfgOptions; use hir_expand::{ AstId, AttrMacroAttrIds, ExpandTo, HirFileId, InFile, Intern, Lookup, MacroCallKind, MacroDefKind, mod_path::ModPath, name::{AsName, Name}, span_map::SpanMap, }; use intern::Interned; use span::AstIdMap; use syn...
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-def/src/nameres/collector.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/collector.rs
//! The core of the module-level name resolution algorithm. //! //! `DefCollector::collect` contains the fixed-point iteration loop which //! resolves imports and expands macros. use std::{iter, mem}; use base_db::{BuiltDependency, Crate, CrateOrigin, LangCrateOrigin}; use cfg::{CfgAtom, CfgExpr, CfgOptions}; use eit...
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-def/src/nameres/attr_resolution.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/attr_resolution.rs
//! Post-nameres attribute resolution. use base_db::Crate; use hir_expand::{ AttrMacroAttrIds, MacroCallId, MacroCallKind, MacroDefId, attrs::{Attr, AttrId, AttrInput}, inert_attr_macro::find_builtin_attr_idx, mod_path::{ModPath, PathKind}, }; use span::SyntaxContext; use syntax::ast; use triomphe::Arc...
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-def/src/nameres/mod_resolution.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/mod_resolution.rs
//! This module resolves `mod foo;` declaration to file. use arrayvec::ArrayVec; use base_db::{AnchoredPath, Crate}; use hir_expand::{EditionedFileId, name::Name}; use crate::{HirFileId, db::DefDatabase}; const MOD_DEPTH_LIMIT: usize = 32; #[derive(Clone, Debug)] pub(super) struct ModDir { /// `` for `mod.rs`, `...
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-def/src/nameres/proc_macro.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/proc_macro.rs
//! Nameres-specific procedural macro data and helpers. use hir_expand::name::{AsName, Name}; use intern::sym; use itertools::Itertools; use crate::{ item_tree::Attrs, tt::{Leaf, TopSubtree, TtElement}, }; #[derive(Debug, PartialEq, Eq)] pub struct ProcMacroDef { pub name: Name, pub kind: ProcMacroKi...
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-def/src/nameres/tests/primitives.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/tests/primitives.rs
use super::*; #[test] fn primitive_reexport() { check( r#" //- /lib.rs mod foo; use foo::int; //- /foo.rs pub use i32 as int; "#, expect![[r#" crate - foo : type - int : type (import) crate::foo - int : type (import) "#]], );...
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-def/src/nameres/tests/macros.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/tests/macros.rs
use expect_test::expect; use itertools::Itertools; use span::Edition; use super::*; #[test] fn macro_rules_are_globally_visible() { check( r#" //- /lib.rs macro_rules! structs { ($($i:ident),*) => { $(struct $i { field: u32 } )* } } structs!(Foo); mod nested; //- /nested.rs structs!(Bar,...
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-def/src/nameres/tests/globs.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/tests/globs.rs
use super::*; #[test] fn glob_1() { check( r#" //- /lib.rs mod foo; use foo::*; //- /foo/mod.rs pub mod bar; pub use self::bar::Baz; pub struct Foo; //- /foo/bar.rs pub struct Baz; "#, expect![[r#" crate - Baz : type (glob) value (glob) - Foo : type (glob) valu...
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-def/src/nameres/tests/mod_resolution.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/tests/mod_resolution.rs
use super::*; #[test] fn name_res_works_for_broken_modules() { cov_mark::check!(name_res_works_for_broken_modules); check( r" //- /lib.rs mod foo // no `;`, no body use self::foo::Baz; //- /foo/mod.rs pub mod bar; pub use self::bar::Baz; //- /foo/bar.rs pub struct Baz; ", expect![[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-def/src/nameres/tests/incremental.rs
src/tools/rust-analyzer/crates/hir-def/src/nameres/tests/incremental.rs
use base_db::{ CrateDisplayName, CrateGraphBuilder, CrateName, CrateOrigin, CrateWorkspaceData, DependencyBuilder, Env, RootQueryDb, SourceDatabase, }; use expect_test::{Expect, expect}; use intern::Symbol; use span::Edition; use test_fixture::WithFixture; use triomphe::Arc; use crate::{ db::DefDatabase, ...
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/parser/src/syntax_kind.rs
src/tools/rust-analyzer/crates/parser/src/syntax_kind.rs
//! Defines [`SyntaxKind`] -- a fieldless enum of all possible syntactic //! constructs of the Rust language. #[rustfmt::skip] mod generated; use crate::Edition; #[allow(unreachable_pub)] pub use self::generated::SyntaxKind; impl From<u16> for SyntaxKind { #[inline] fn from(d: u16) -> SyntaxKind { 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/parser/src/event.rs
src/tools/rust-analyzer/crates/parser/src/event.rs
//! This module provides a way to construct a `File`. //! It is intended to be completely decoupled from the //! parser, so as to allow to evolve the tree representation //! and the parser algorithm independently. use std::mem; use crate::{ SyntaxKind::{self, *}, output::Output, }; /// `Parser` produces a fla...
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/parser/src/grammar.rs
src/tools/rust-analyzer/crates/parser/src/grammar.rs
//! This is the actual "grammar" of the Rust language. //! //! Each function in this module and its children corresponds //! to a production of the formal grammar. Submodules roughly //! correspond to different *areas* of the grammar. By convention, //! each submodule starts with `use super::*` import and exports //! "...
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/parser/src/lib.rs
src/tools/rust-analyzer/crates/parser/src/lib.rs
//! The Rust parser. //! //! NOTE: The crate is undergoing refactors, don't believe everything the docs //! say :-) //! //! The parser doesn't know about concrete representation of tokens //! and syntax trees. Abstract [`Input`] and [`Output`] traits are //! used to provide tokens instead. As a consequence, this 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/parser/src/shortcuts.rs
src/tools/rust-analyzer/crates/parser/src/shortcuts.rs
//! Shortcuts that span lexer/parser abstraction. //! //! The way Rust works, parser doesn't necessary parse text, and you might //! tokenize text without parsing it further. So, it makes sense to keep //! abstract token parsing, and string tokenization as completely separate //! layers. //! //! However, often you do p...
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/parser/src/token_set.rs
src/tools/rust-analyzer/crates/parser/src/token_set.rs
//! A bit-set of `SyntaxKind`s. use crate::SyntaxKind; /// A bit-set of `SyntaxKind`s #[derive(Clone, Copy)] pub(crate) struct TokenSet([u64; 3]); /// `TokenSet`s should only include token `SyntaxKind`s, so the discriminant of any passed/included /// `SyntaxKind` must *not* be greater than that of the last token `Sy...
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/parser/src/tests.rs
src/tools/rust-analyzer/crates/parser/src/tests.rs
mod prefix_entries; mod top_entries; use std::{ fmt::Write, fs, path::{Path, PathBuf}, }; use expect_test::expect_file; use crate::{Edition, LexedStr, TopEntryPoint}; #[rustfmt::skip] #[path = "../test_data/generated/runner.rs"] mod runner; fn infer_edition(file_path: &Path) -> Edition { let file_c...
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/parser/src/parser.rs
src/tools/rust-analyzer/crates/parser/src/parser.rs
//! See [`Parser`]. use std::cell::Cell; use drop_bomb::DropBomb; use crate::{ Edition, SyntaxKind::{self, EOF, ERROR, TOMBSTONE}, T, TokenSet, event::Event, input::Input, }; /// `Parser` struct provides the low-level API for /// navigating through the stream of tokens and /// constructing the p...
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/parser/src/lexed_str.rs
src/tools/rust-analyzer/crates/parser/src/lexed_str.rs
//! Lexing `&str` into a sequence of Rust tokens. //! //! Note that strictly speaking the parser in this crate is not required to work //! on tokens which originated from text. Macros, eg, can synthesize tokens out //! of thin air. So, ideally, lexer should be an orthogonal crate. It is however //! convenient to includ...
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/parser/src/output.rs
src/tools/rust-analyzer/crates/parser/src/output.rs
//! See [`Output`] use crate::SyntaxKind; /// Output of the parser -- a DFS traversal of a concrete syntax tree. /// /// Use the [`Output::iter`] method to iterate over traversal steps and consume /// a syntax tree. /// /// In a sense, this is just a sequence of [`SyntaxKind`]-colored parenthesis /// interspersed int...
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/parser/src/frontmatter.rs
src/tools/rust-analyzer/crates/parser/src/frontmatter.rs
// Copied from https://github.com/rust-lang/cargo/blob/367fd9f213750cd40317803dd0a5a3ce3f0c676d/src/cargo/util/frontmatter.rs #![expect(dead_code)] // avoid editing #![expect(unreachable_pub)] // avoid editing #![expect(clippy::useless_format)] // avoid editing type Span = std::ops::Range<usize>; #[derive(Debug)] pub...
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/parser/src/input.rs
src/tools/rust-analyzer/crates/parser/src/input.rs
//! See [`Input`]. use edition::Edition; use crate::SyntaxKind; #[allow(non_camel_case_types)] type bits = u64; /// Input for the parser -- a sequence of tokens. /// /// As of now, parser doesn't have access to the *text* of the tokens, and makes /// decisions based solely on their classification. Unlike `LexerToke...
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/parser/src/grammar/generic_params.rs
src/tools/rust-analyzer/crates/parser/src/grammar/generic_params.rs
use crate::grammar::attributes::ATTRIBUTE_FIRST; use super::*; pub(super) fn opt_generic_param_list(p: &mut Parser<'_>) { if p.at(T![<]) { generic_param_list(p); } } // test generic_param_list // fn f<T: Clone>() {} // test_err generic_param_list_recover // fn f<T: Clone,, U:, V>() {} pub(super) fn ...
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/parser/src/grammar/items.rs
src/tools/rust-analyzer/crates/parser/src/grammar/items.rs
mod adt; mod consts; mod traits; mod use_item; pub(crate) use self::{ adt::{record_field_list, variant_list}, expressions::{match_arm_list, record_expr_field_list}, traits::assoc_item_list, use_item::use_tree_list, }; use super::*; // test mod_contents // fn foo() {} // macro_rules! foo {} // foo::bar...
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/parser/src/grammar/params.rs
src/tools/rust-analyzer/crates/parser/src/grammar/params.rs
use crate::grammar::attributes::ATTRIBUTE_FIRST; use super::*; // test param_list // fn a() {} // fn b(x: i32) {} // fn c(x: i32, ) {} // fn d(x: i32, y: ()) {} // test_err empty_param_slot // fn f(y: i32, ,t: i32) {} pub(super) fn param_list_fn_def(p: &mut Parser<'_>) { list_(p, Flavor::FnDef); } pub(super) fn...
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/parser/src/grammar/paths.rs
src/tools/rust-analyzer/crates/parser/src/grammar/paths.rs
use super::*; pub(super) const PATH_FIRST: TokenSet = TokenSet::new(&[IDENT, T![self], T![super], T![crate], T![Self], T![:], T![<]]); pub(super) fn is_path_start(p: &Parser<'_>) -> bool { is_use_path_start(p) || p.at(T![<]) || p.at(T![Self]) } pub(super) fn is_use_path_start(p: &Parser<'_>) -> bool { ma...
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/parser/src/grammar/types.rs
src/tools/rust-analyzer/crates/parser/src/grammar/types.rs
use super::*; pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(TokenSet::new(&[ T!['('], T!['['], T![<], T![!], T![*], T![&], T![_], T![fn], T![unsafe], T![extern], T![for], T![impl], T![dyn], T![Self], LIFETIME_IDENT, ])); pub(super) const TY...
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/parser/src/grammar/patterns.rs
src/tools/rust-analyzer/crates/parser/src/grammar/patterns.rs
use super::*; pub(super) const PATTERN_FIRST: TokenSet = expressions::LITERAL_FIRST.union(paths::PATH_FIRST).union(TokenSet::new(&[ T![box], T![ref], T![mut], T![const], T!['('], T!['['], T![&], T![_], T![-], T![.], ])); const PAT...
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/parser/src/grammar/attributes.rs
src/tools/rust-analyzer/crates/parser/src/grammar/attributes.rs
use super::*; pub(super) const ATTRIBUTE_FIRST: TokenSet = TokenSet::new(&[T![#]]); pub(super) fn inner_attrs(p: &mut Parser<'_>) { while p.at(T![#]) && p.nth(1) == T![!] { attr(p, true); } } pub(super) fn outer_attrs(p: &mut Parser<'_>) { while p.at(T![#]) { attr(p, false); } } fn 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/parser/src/grammar/generic_args.rs
src/tools/rust-analyzer/crates/parser/src/grammar/generic_args.rs
use super::*; // test_err generic_arg_list_recover_expr // const _: () = T::<0, ,T>; // const _: () = T::<0, ,T>(); pub(super) fn opt_generic_arg_list_expr(p: &mut Parser<'_>) { let m; if p.at(T![::]) && p.nth(2) == T![<] { m = p.start(); p.bump(T![::]); } else { return; } ...
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/parser/src/grammar/expressions.rs
src/tools/rust-analyzer/crates/parser/src/grammar/expressions.rs
mod atom; use crate::grammar::attributes::ATTRIBUTE_FIRST; use super::*; pub(super) use atom::{EXPR_RECOVERY_SET, LITERAL_FIRST, literal, parse_asm_expr}; pub(crate) use atom::{block_expr, match_arm_list}; #[derive(PartialEq, Eq)] pub(super) enum Semicolon { Required, Optional, Forbidden, } const EXPR_...
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/parser/src/grammar/items/consts.rs
src/tools/rust-analyzer/crates/parser/src/grammar/items/consts.rs
use super::*; // test const_item // const C: u32 = 92; pub(super) fn konst(p: &mut Parser<'_>, m: Marker) { p.bump(T![const]); const_or_static(p, m, true); } pub(super) fn static_(p: &mut Parser<'_>, m: Marker) { p.bump(T![static]); const_or_static(p, m, false); } fn const_or_static(p: &mut Parser<'_...
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/parser/src/grammar/items/use_item.rs
src/tools/rust-analyzer/crates/parser/src/grammar/items/use_item.rs
use super::*; // test use_item // use std::collections; pub(super) fn use_(p: &mut Parser<'_>, m: Marker) { p.bump(T![use]); use_tree(p, true); p.expect(T![;]); m.complete(p, USE); } // test use_tree // use outer::tree::{inner::tree}; fn use_tree(p: &mut Parser<'_>, top_level: bool) -> bool { let ...
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/parser/src/grammar/items/traits.rs
src/tools/rust-analyzer/crates/parser/src/grammar/items/traits.rs
use super::*; // test trait_item // trait T { fn new() -> Self; } pub(super) fn trait_(p: &mut Parser<'_>, m: Marker) { p.bump(T![trait]); name_r(p, ITEM_RECOVERY_SET); // test trait_item_generic_params // trait X<U: Debug + Display> {} generic_params::opt_generic_param_list(p); if p.eat(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/parser/src/grammar/items/adt.rs
src/tools/rust-analyzer/crates/parser/src/grammar/items/adt.rs
use crate::grammar::attributes::ATTRIBUTE_FIRST; use super::*; // test struct_item // struct S {} pub(super) fn strukt(p: &mut Parser<'_>, m: Marker) { p.bump(T![struct]); struct_or_union(p, m, true); } // test union_item // struct U { i: i32, f: f32 } pub(super) fn union(p: &mut Parser<'_>, m: Marker) { ...
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/parser/src/grammar/expressions/atom.rs
src/tools/rust-analyzer/crates/parser/src/grammar/expressions/atom.rs
use crate::grammar::types::type_; use super::*; // test expr_literals // fn foo() { // let _ = true; // let _ = false; // let _ = 1; // let _ = 2.0; // let _ = b'a'; // let _ = 'b'; // let _ = "c"; // let _ = r"d"; // let _ = b"e"; // let _ = br"f"; // let _ = c"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/parser/src/tests/top_entries.rs
src/tools/rust-analyzer/crates/parser/src/tests/top_entries.rs
use expect_test::expect; use crate::TopEntryPoint; #[test] fn source_file() { check( TopEntryPoint::SourceFile, "", expect![[r#" SOURCE_FILE "#]], ); check( TopEntryPoint::SourceFile, "struct S;", expect![[r#" SOURCE_FILE STRUC...
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/parser/src/tests/prefix_entries.rs
src/tools/rust-analyzer/crates/parser/src/tests/prefix_entries.rs
use crate::{Edition, LexedStr, PrefixEntryPoint, Step}; #[test] fn vis() { check(PrefixEntryPoint::Vis, "pub(crate) fn foo() {}", "pub(crate)"); check(PrefixEntryPoint::Vis, "fn foo() {}", ""); check(PrefixEntryPoint::Vis, "pub(fn foo() {}", "pub"); check(PrefixEntryPoint::Vis, "pub(crate fn foo() {}",...
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/parser/src/syntax_kind/generated.rs
src/tools/rust-analyzer/crates/parser/src/syntax_kind/generated.rs
//! Generated by `cargo xtask codegen grammar`, do not edit by hand. #![allow(bad_style, missing_docs, unreachable_pub)] use crate::Edition; #[doc = r" The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT`."] #[derive(Debug)] #[repr(u16)] pub enum SyntaxKind { #[doc(hidden)] TOMBSTONE, #[doc(hidden)...
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/parser/test_data/generated/runner.rs
src/tools/rust-analyzer/crates/parser/test_data/generated/runner.rs
mod ok { use crate::tests::*; #[test] fn anonymous_const() { run_and_expect_no_errors("test_data/parser/inline/ok/anonymous_const.rs"); } #[test] fn arb_self_types() { run_and_expect_no_errors("test_data/parser/inline/ok/arb_self_types.rs"); } #[test] fn arg_with_attr...
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/parser/test_data/parser/inline/err/comma_after_default_values_syntax.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/comma_after_default_values_syntax.rs
fn foo() { S { .., }; S { .., a: 0 } }
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/parser/test_data/parser/inline/err/missing_fn_param_type.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/missing_fn_param_type.rs
fn f(x y: i32, z, t: i32) {}
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/parser/test_data/parser/inline/err/gen_fn.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/gen_fn.rs
// 2021 gen fn gen_fn() {} async gen fn async_gen_fn() {}
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/parser/test_data/parser/inline/err/struct_field_recover.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/struct_field_recover.rs
struct S { f pub g: () } struct S { f: pub 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/parser/test_data/parser/inline/err/fn_ret_recovery.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/fn_ret_recovery.rs
fn foo() -> A>]) { let x = 1; } fn foo() -> A>]) where T: Copy { let x = 1; }
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/parser/test_data/parser/inline/err/comma_after_functional_update_syntax.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/comma_after_functional_update_syntax.rs
fn foo() { S { ..x, }; S { ..x, a: 0 } }
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/parser/test_data/parser/inline/err/path_item_without_excl.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/path_item_without_excl.rs
foo
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/parser/test_data/parser/inline/err/tuple_expr_leading_comma.rs
src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/tuple_expr_leading_comma.rs
fn foo() { (,); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false