# attilaadorjany/rust architecture

> Architecture diagram of the GitHub repository attilaadorjany/rust, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/attilaadorjany/rust
- Repository: https://github.com/attilaadorjany/rust

## Overview

Rust is a language toolchain repository centered on compiling Rust programs, with the standard library, documentation, and developer tools alongside the compiler. The principal workflow runs from source input through syntax and type analysis, MIR processing, and backend code generation. The excerpts show inference and trait-obligation behavior; many other compiler stages and product subsystems are identified only by the tree or README, so their links are marked dashed and unverified rather than asserted as observed calls.

Main entry points: [`compiler/rustc/src/main.rs`](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc/src/main.rs) (rustc driver), [`compiler/rustc_mir_transform/src/pass_manager.rs`](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_mir_transform/src/pass_manager.rs) (MIR transforms), [`compiler/rustc_infer/src/infer/mod.rs`](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_infer/src/infer/mod.rs) (Type inference), [`compiler/rustc_ast/src/ast.rs`](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_ast/src/ast.rs) (Syntax AST)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_compiler["Compiler Front End"]
  node_rustc["rustc driver<br/>[main.rs]"]
  node_ast["Syntax AST<br/>[ast.rs]"]
  node_lowering["AST lowering<br/>[lib.rs]"]
  node_mir["MIR transforms<br/>[pass_manager.rs]"]
end

subgraph group_analysis["Semantic Analysis"]
  node_typeck["Type inference<br/>[mod.rs]"]
  node_obligations["Trait obligations<br/>[engine.rs]"]
  node_fulfillment["Obligation fulfillment<br/>[engine.rs]"]
  node_query["Compiler queries<br/>[query_api.rs]"]
  node_borrowck["Borrow checking<br/>[lib.rs]"]
end

subgraph group_backend["Code Generation"]
  node_abi["ABI layout<br/>[layout.rs]"]
  node_codegen["LLVM codegen<br/>[lib.rs]"]
  node_clif["Cranelift codegen<br/>[lib.rs]"]
  node_gcc["GCC codegen<br/>[lib.rs]"]
end

subgraph group_products["Toolchain Products"]
  node_stdlib["Standard library"]
  node_rustdoc["Documentation tools<br/>[lib.rs]"]
  node_rustfmt["Formatter<br/>[main.rs]"]
  node_analyzer["Editor support<br/>[storage.rs]"]
end

node_user(("Rust developer"))

node_user -->|"compiles with"| node_rustc
node_rustc -.->|"parses source"| node_ast
node_ast -.->|"lowers syntax"| node_lowering
node_lowering -.->|"checks types"| node_typeck
node_typeck -.->|"registers goals"| node_obligations
node_obligations -->|"resolves goals"| node_fulfillment
node_fulfillment -->|"uses inference"| node_typeck
node_rustc -.->|"runs queries"| node_query
node_query -.->|"requests MIR passes"| node_mir
node_mir -.->|"checks borrows"| node_borrowck
node_mir -.->|"lowers for ABI"| node_abi
node_abi -.->|"provides ABI"| node_codegen
node_rustc -.->|"emits native code"| node_codegen
node_rustc -.->|"selects backend"| node_clif
node_rustc -.->|"selects backend"| node_gcc
node_user -->|"uses libraries"| node_stdlib
node_user -->|"generates docs"| node_rustdoc
node_user -->|"formats code"| node_rustfmt
node_user -->|"uses editor support"| node_analyzer

click node_rustc "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc/src/main.rs"
click node_ast "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_ast/src/ast.rs"
click node_lowering "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_ast_lowering/src/lib.rs"
click node_typeck "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_infer/src/infer/mod.rs"
click node_obligations "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_infer/src/traits/engine.rs"
click node_fulfillment "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_trait_selection/src/traits/engine.rs"
click node_query "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_middle/src/query/query_api.rs"
click node_mir "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_mir_transform/src/pass_manager.rs"
click node_borrowck "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_borrowck/src/lib.rs"
click node_abi "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_abi/src/layout.rs"
click node_codegen "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_codegen_llvm/src/lib.rs"
click node_clif "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_codegen_cranelift/src/lib.rs"
click node_gcc "https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_codegen_gcc/src/lib.rs"
click node_stdlib "https://github.com/attilaadorjany/rust/tree/main/library/std/src"
click node_rustdoc "https://github.com/attilaadorjany/rust/blob/main/src/librustdoc/lib.rs"
click node_rustfmt "https://github.com/attilaadorjany/rust/blob/main/src/tools/rustfmt/src/bin/main.rs"
click node_analyzer "https://github.com/attilaadorjany/rust/blob/main/src/tools/rust-analyzer/crates/tt/src/storage.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rustc,node_ast,node_lowering,node_mir toneBlue
class node_typeck,node_obligations,node_fulfillment,node_query,node_borrowck toneAmber
class node_abi,node_codegen,node_clif,node_gcc toneMint
class node_stdlib,node_rustdoc,node_rustfmt,node_analyzer toneRose
class node_user toneIndigo
```

## Components

### Compiler Front End

- [rustc driver](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc/src/main.rs): `compiler/rustc/src/main.rs`
- [Syntax AST](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_ast/src/ast.rs): `compiler/rustc_ast/src/ast.rs`
- [AST lowering](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_ast_lowering/src/lib.rs): `compiler/rustc_ast_lowering/src/lib.rs`
- [MIR transforms](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_mir_transform/src/pass_manager.rs): `compiler/rustc_mir_transform/src/pass_manager.rs`

### Semantic Analysis

- [Type inference](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_infer/src/infer/mod.rs): `compiler/rustc_infer/src/infer/mod.rs`
- [Trait obligations](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_infer/src/traits/engine.rs): `compiler/rustc_infer/src/traits/engine.rs`
- [Obligation fulfillment](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_trait_selection/src/traits/engine.rs): `compiler/rustc_trait_selection/src/traits/engine.rs`
- [Compiler queries](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_middle/src/query/query_api.rs): `compiler/rustc_middle/src/query/query_api.rs`
- [Borrow checking](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_borrowck/src/lib.rs): `compiler/rustc_borrowck/src/lib.rs`

### Code Generation

- [ABI layout](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_abi/src/layout.rs): `compiler/rustc_abi/src/layout.rs`
- [LLVM codegen](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_codegen_llvm/src/lib.rs): `compiler/rustc_codegen_llvm/src/lib.rs`
- [Cranelift codegen](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_codegen_cranelift/src/lib.rs): `compiler/rustc_codegen_cranelift/src/lib.rs`
- [GCC codegen](https://github.com/attilaadorjany/rust/blob/main/compiler/rustc_codegen_gcc/src/lib.rs): `compiler/rustc_codegen_gcc/src/lib.rs`

### Toolchain Products

- [Standard library](https://github.com/attilaadorjany/rust/tree/main/library/std/src): `library/std/src`
- [Documentation tools](https://github.com/attilaadorjany/rust/blob/main/src/librustdoc/lib.rs): `src/librustdoc/lib.rs`
- [Formatter](https://github.com/attilaadorjany/rust/blob/main/src/tools/rustfmt/src/bin/main.rs): `src/tools/rustfmt/src/bin/main.rs`
- [Editor support](https://github.com/attilaadorjany/rust/blob/main/src/tools/rust-analyzer/crates/tt/src/storage.rs): `src/tools/rust-analyzer/crates/tt/src/storage.rs`

### Other components

- **Rust developer**

## Connections

- Rust developer → rustc driver: compiles with (evidence: `README.md`)
- rustc driver → Syntax AST: parses source
- Syntax AST → AST lowering: lowers syntax
- AST lowering → Type inference: checks types
- Type inference → Trait obligations: registers goals (evidence: `compiler/rustc_infer/src/traits/engine.rs`)
- Trait obligations → Obligation fulfillment: resolves goals (evidence: `compiler/rustc_trait_selection/src/traits/engine.rs`)
- Obligation fulfillment → Type inference: uses inference (evidence: `compiler/rustc_trait_selection/src/traits/engine.rs`)
- rustc driver → Compiler queries: runs queries
- Compiler queries → MIR transforms: requests MIR passes
- MIR transforms → Borrow checking: checks borrows
- MIR transforms → ABI layout: lowers for ABI
- ABI layout → LLVM codegen: provides ABI
- rustc driver → LLVM codegen: emits native code
- rustc driver → Cranelift codegen: selects backend
- rustc driver → GCC codegen: selects backend
- Rust developer → Standard library: uses libraries (evidence: `README.md`)
- Rust developer → Documentation tools: generates docs (evidence: `README.md`)
- Rust developer → Formatter: formats code (evidence: `README.md`)
- Rust developer → Editor support: uses editor support (evidence: `README.md`)
