diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9081435..a69bf52 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,7 +36,8 @@ env:
RUST_BACKTRACE: short
RUSTFLAGS: -D warnings
# Crate publish order (dependencies first)
- CRATES: "masterror-template masterror-derive masterror"
+ # template → derive → knowledge → masterror → cli
+ CRATES: "masterror-template masterror-derive masterror-knowledge masterror masterror-cli"
jobs:
# ════════════════════════════════════════════════════════════════════════════
@@ -58,13 +59,160 @@ jobs:
echo "version=$MSRV" >> "$GITHUB_OUTPUT"
echo "MSRV: $MSRV"
+ # ════════════════════════════════════════════════════════════════════════════
+ # Detect changed crates (dependency-aware)
+ # ════════════════════════════════════════════════════════════════════════════
+
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ outputs:
+ # Individual crate changes
+ template: ${{ steps.filter.outputs.template }}
+ derive: ${{ steps.filter.outputs.derive }}
+ knowledge: ${{ steps.filter.outputs.knowledge }}
+ masterror: ${{ steps.filter.outputs.masterror }}
+ cli: ${{ steps.filter.outputs.cli }}
+ # Dependency-aware: need to rebuild these
+ need-template: ${{ steps.deps.outputs.need-template }}
+ need-derive: ${{ steps.deps.outputs.need-derive }}
+ need-knowledge: ${{ steps.deps.outputs.need-knowledge }}
+ need-masterror: ${{ steps.deps.outputs.need-masterror }}
+ need-cli: ${{ steps.deps.outputs.need-cli }}
+ # Any library changed (for full workspace checks)
+ any-lib: ${{ steps.deps.outputs.any-lib }}
+ # CI/config changed (force full rebuild)
+ ci: ${{ steps.filter.outputs.ci }}
+ steps:
+ - uses: actions/checkout@v5
+
+ - name: Detect file changes
+ uses: dorny/paths-filter@v3
+ id: filter
+ with:
+ filters: |
+ template:
+ - 'masterror-template/**'
+ derive:
+ - 'masterror-derive/**'
+ knowledge:
+ - 'masterror-knowledge/**'
+ masterror:
+ - 'src/**'
+ - 'Cargo.toml'
+ - 'build.rs'
+ cli:
+ - 'masterror-cli/**'
+ ci:
+ - '.github/workflows/**'
+ - 'Cargo.lock'
+ - 'deny.toml'
+ - 'cliff.toml'
+ - '.cargo/**'
+
+ - name: Compute dependency graph
+ id: deps
+ run: |
+ # Dependency graph:
+ # template ← derive ← masterror
+ # ↗
+ # knowledge ← cli
+ # ↘ masterror (optional feature)
+
+ TEMPLATE="${{ steps.filter.outputs.template }}"
+ DERIVE="${{ steps.filter.outputs.derive }}"
+ KNOWLEDGE="${{ steps.filter.outputs.knowledge }}"
+ MASTERROR="${{ steps.filter.outputs.masterror }}"
+ CLI="${{ steps.filter.outputs.cli }}"
+ CI="${{ steps.filter.outputs.ci }}"
+
+ # Force all if CI config changed or workflow_dispatch
+ if [[ "$CI" == "true" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "CI config changed or manual trigger - rebuilding all"
+ echo "need-template=true" >> "$GITHUB_OUTPUT"
+ echo "need-derive=true" >> "$GITHUB_OUTPUT"
+ echo "need-knowledge=true" >> "$GITHUB_OUTPUT"
+ echo "need-masterror=true" >> "$GITHUB_OUTPUT"
+ echo "need-cli=true" >> "$GITHUB_OUTPUT"
+ echo "any-lib=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ # template: standalone
+ NEED_TEMPLATE="$TEMPLATE"
+
+ # derive: depends on template
+ if [[ "$DERIVE" == "true" ]] || [[ "$TEMPLATE" == "true" ]]; then
+ NEED_DERIVE=true
+ else
+ NEED_DERIVE=false
+ fi
+
+ # knowledge: standalone
+ NEED_KNOWLEDGE="$KNOWLEDGE"
+
+ # masterror: depends on template, derive, optionally knowledge
+ if [[ "$MASTERROR" == "true" ]] || [[ "$TEMPLATE" == "true" ]] || \
+ [[ "$DERIVE" == "true" ]] || [[ "$KNOWLEDGE" == "true" ]]; then
+ NEED_MASTERROR=true
+ else
+ NEED_MASTERROR=false
+ fi
+
+ # cli: depends on knowledge
+ if [[ "$CLI" == "true" ]] || [[ "$KNOWLEDGE" == "true" ]]; then
+ NEED_CLI=true
+ else
+ NEED_CLI=false
+ fi
+
+ # Any library changed?
+ if [[ "$NEED_TEMPLATE" == "true" ]] || [[ "$NEED_DERIVE" == "true" ]] || \
+ [[ "$NEED_KNOWLEDGE" == "true" ]] || [[ "$NEED_MASTERROR" == "true" ]] || \
+ [[ "$NEED_CLI" == "true" ]]; then
+ ANY_LIB=true
+ else
+ ANY_LIB=false
+ fi
+
+ echo "need-template=$NEED_TEMPLATE" >> "$GITHUB_OUTPUT"
+ echo "need-derive=$NEED_DERIVE" >> "$GITHUB_OUTPUT"
+ echo "need-knowledge=$NEED_KNOWLEDGE" >> "$GITHUB_OUTPUT"
+ echo "need-masterror=$NEED_MASTERROR" >> "$GITHUB_OUTPUT"
+ echo "need-cli=$NEED_CLI" >> "$GITHUB_OUTPUT"
+ echo "any-lib=$ANY_LIB" >> "$GITHUB_OUTPUT"
+
+ echo "Summary:"
+ echo " template: $TEMPLATE → need: $NEED_TEMPLATE"
+ echo " derive: $DERIVE → need: $NEED_DERIVE"
+ echo " knowledge: $KNOWLEDGE → need: $NEED_KNOWLEDGE"
+ echo " masterror: $MASTERROR → need: $NEED_MASTERROR"
+ echo " cli: $CLI → need: $NEED_CLI"
+ echo " any-lib: $ANY_LIB"
+
+ # GitHub Step Summary
+ cat >> $GITHUB_STEP_SUMMARY << EOF
+ ## 🔍 Change Detection
+
+ | Crate | Changed | Rebuild |
+ |-------|---------|---------|
+ | masterror-template | $([[ "$TEMPLATE" == "true" ]] && echo "✅" || echo "—") | $([[ "$NEED_TEMPLATE" == "true" ]] && echo "🔨" || echo "⏭️") |
+ | masterror-derive | $([[ "$DERIVE" == "true" ]] && echo "✅" || echo "—") | $([[ "$NEED_DERIVE" == "true" ]] && echo "🔨" || echo "⏭️") |
+ | masterror-knowledge | $([[ "$KNOWLEDGE" == "true" ]] && echo "✅" || echo "—") | $([[ "$NEED_KNOWLEDGE" == "true" ]] && echo "🔨" || echo "⏭️") |
+ | masterror | $([[ "$MASTERROR" == "true" ]] && echo "✅" || echo "—") | $([[ "$NEED_MASTERROR" == "true" ]] && echo "🔨" || echo "⏭️") |
+ | masterror-cli | $([[ "$CLI" == "true" ]] && echo "✅" || echo "—") | $([[ "$NEED_CLI" == "true" ]] && echo "🔨" || echo "⏭️") |
+
+ **Legend:** ✅ = changed, 🔨 = will rebuild, ⏭️ = skipped, — = no changes
+ EOF
+
# ════════════════════════════════════════════════════════════════════════════
# STAGE 1: CHECKS (parallel matrix)
# ════════════════════════════════════════════════════════════════════════════
check:
name: Check (${{ matrix.rust }} / ${{ matrix.os }})
- needs: msrv
+ needs: [msrv, changes]
+ if: needs.changes.outputs.any-lib == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -124,6 +272,8 @@ jobs:
fmt:
name: Format
+ needs: changes
+ if: needs.changes.outputs.any-lib == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
@@ -138,6 +288,8 @@ jobs:
docs:
name: Documentation
+ needs: changes
+ if: needs.changes.outputs.any-lib == 'true'
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
@@ -155,6 +307,8 @@ jobs:
no-std:
name: no_std (${{ matrix.name }})
+ needs: changes
+ if: needs.changes.outputs.need-masterror == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -185,7 +339,7 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check ${{ matrix.name }}
- run: cargo check ${{ matrix.args }}
+ run: cargo check -p masterror ${{ matrix.args }}
security:
name: Security Audit
@@ -225,8 +379,16 @@ jobs:
test:
name: Test Suite
- needs: [check, fmt, no-std, security, reuse]
- if: ${{ !inputs.skip_tests }}
+ needs: [changes, check, fmt, no-std, security, reuse]
+ if: |
+ always() &&
+ !inputs.skip_tests &&
+ needs.changes.outputs.any-lib == 'true' &&
+ (needs.check.result == 'success' || needs.check.result == 'skipped') &&
+ (needs.fmt.result == 'success' || needs.fmt.result == 'skipped') &&
+ (needs['no-std'].result == 'success' || needs['no-std'].result == 'skipped') &&
+ needs.security.result == 'success' &&
+ needs.reuse.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
@@ -262,7 +424,11 @@ jobs:
coverage:
name: Coverage
- needs: test
+ needs: [changes, test]
+ if: |
+ always() &&
+ needs.changes.outputs.any-lib == 'true' &&
+ needs.test.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
@@ -309,9 +475,13 @@ jobs:
benchmarks:
name: Benchmarks
- needs: test
+ needs: [changes, test]
runs-on: ubuntu-latest
- if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
+ if: |
+ always() &&
+ needs.changes.outputs.need-masterror == 'true' &&
+ needs.test.result == 'success' &&
+ (github.event_name == 'pull_request' || github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v5
@@ -340,12 +510,18 @@ jobs:
changelog:
name: Update Changelog
- needs: [check, fmt, no-std, security, reuse]
+ needs: [changes, check, fmt, no-std, security, reuse]
runs-on: ubuntu-latest
if: |
+ always() &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
github.ref == 'refs/heads/main' &&
- !contains(github.event.head_commit.message || '', '[skip ci]')
+ !contains(github.event.head_commit.message || '', '[skip ci]') &&
+ (needs.check.result == 'success' || needs.check.result == 'skipped') &&
+ (needs.fmt.result == 'success' || needs.fmt.result == 'skipped') &&
+ (needs['no-std'].result == 'success' || needs['no-std'].result == 'skipped') &&
+ needs.security.result == 'success' &&
+ needs.reuse.result == 'success'
steps:
- uses: actions/checkout@v5
with:
@@ -412,10 +588,12 @@ jobs:
release:
name: Release
- needs: [test, changelog]
+ needs: [changes, test, changelog]
if: |
always() &&
+ needs.changes.outputs.any-lib == 'true' &&
(needs.test.result == 'success' || needs.test.result == 'skipped') &&
+ (needs.changelog.result == 'success' || needs.changelog.result == 'skipped') &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
github.ref == 'refs/heads/main' &&
!contains(github.event.head_commit.message || '', '[skip ci]')
@@ -508,7 +686,7 @@ jobs:
declare -A LOCAL REMOTE NEEDS_PUBLISH
PUBLISHED_ANY=false
- for crate in masterror-template masterror-derive masterror; do
+ for crate in $CRATES; do
LOCAL[$crate]=$(get_local_version "$crate")
REMOTE[$crate]=$(get_remote_version "$crate")
@@ -527,16 +705,21 @@ jobs:
# Dependency-aware publishing
# ══════════════════════════════════════════════════════════════════
- # If derive changes, masterror should also be republished
- # (it depends on derive, users need consistent versions)
+ # Dependency consistency warnings
if [[ "${NEEDS_PUBLISH[masterror-derive]}" == "true" ]] && \
[[ "${NEEDS_PUBLISH[masterror]}" == "false" ]]; then
warn "masterror-derive changed but masterror version unchanged"
warn "Consider bumping masterror version for dependency consistency"
fi
- # Publish in order: template → derive → masterror
- for crate in masterror-template masterror-derive masterror; do
+ if [[ "${NEEDS_PUBLISH[masterror-knowledge]}" == "true" ]] && \
+ [[ "${NEEDS_PUBLISH[masterror-cli]}" == "false" ]]; then
+ warn "masterror-knowledge changed but masterror-cli version unchanged"
+ warn "Consider bumping masterror-cli version for dependency consistency"
+ fi
+
+ # Publish in order: template → derive → knowledge → masterror → cli
+ for crate in $CRATES; do
if [[ "${NEEDS_PUBLISH[$crate]}" == "true" ]]; then
if publish_crate "$crate"; then
PUBLISHED_ANY=true
@@ -605,7 +788,9 @@ jobs:
|-------|--------|
| masterror-template | ${{ steps.publish.outputs.published == 'true' && '✅ Published' || '⏭️ Skipped' }} |
| masterror-derive | ${{ steps.publish.outputs.published == 'true' && '✅ Published' || '⏭️ Skipped' }} |
+ | masterror-knowledge | ${{ steps.publish.outputs.published == 'true' && '✅ Published' || '⏭️ Skipped' }} |
| masterror | ${{ steps.publish.outputs.published == 'true' && '✅ Published' || '⏭️ Skipped' }} |
+ | masterror-cli | ${{ steps.publish.outputs.published == 'true' && '✅ Published' || '⏭️ Skipped' }} |
**Version:** `${{ steps.publish.outputs.version }}`
EOF
@@ -681,19 +866,48 @@ jobs:
ci-success:
name: CI Success
- needs: [check, fmt, docs, no-std, security, reuse, test]
+ needs: [changes, check, fmt, docs, no-std, security, reuse, test]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check all jobs
run: |
- results="${{ needs.check.result }} ${{ needs.fmt.result }} ${{ needs.docs.result }} ${{ needs.no-std.result }} ${{ needs.security.result }} ${{ needs.reuse.result }} ${{ needs.test.result }}"
-
- for r in $results; do
- if [[ "$r" == "failure" ]]; then
- echo "::error::One or more required jobs failed"
- exit 1
- fi
- done
+ echo "Job results:"
+ echo " changes: ${{ needs.changes.result }}"
+ echo " check: ${{ needs.check.result }}"
+ echo " fmt: ${{ needs.fmt.result }}"
+ echo " docs: ${{ needs.docs.result }}"
+ echo " no-std: ${{ needs['no-std'].result }}"
+ echo " security: ${{ needs.security.result }}"
+ echo " reuse: ${{ needs.reuse.result }}"
+ echo " test: ${{ needs.test.result }}"
+
+ FAILED=false
+
+ # Changes detection must succeed
+ [[ "${{ needs.changes.result }}" != "success" ]] && \
+ echo "::error::Changes detection failed" && FAILED=true
+
+ # Security and REUSE must always pass
+ [[ "${{ needs.security.result }}" == "failure" ]] && \
+ echo "::error::Security audit failed" && FAILED=true
+ [[ "${{ needs.reuse.result }}" == "failure" ]] && \
+ echo "::error::REUSE compliance failed" && FAILED=true
+
+ # Other jobs: failure is not OK (skipped is fine)
+ [[ "${{ needs.check.result }}" == "failure" ]] && \
+ echo "::error::Check job failed" && FAILED=true
+ [[ "${{ needs.fmt.result }}" == "failure" ]] && \
+ echo "::error::Format job failed" && FAILED=true
+ [[ "${{ needs.docs.result }}" == "failure" ]] && \
+ echo "::error::Docs job failed" && FAILED=true
+ [[ "${{ needs['no-std'].result }}" == "failure" ]] && \
+ echo "::error::no-std job failed" && FAILED=true
+ [[ "${{ needs.test.result }}" == "failure" ]] && \
+ echo "::error::Test job failed" && FAILED=true
+
+ if [[ "$FAILED" == "true" ]]; then
+ exit 1
+ fi
- echo "✅ All CI checks passed!"
+ echo "✅ All CI checks passed (some may have been skipped due to no changes)"
diff --git a/.hooks/pre-commit b/.hooks/pre-commit
index eeacd39..ccc498a 100755
--- a/.hooks/pre-commit
+++ b/.hooks/pre-commit
@@ -20,6 +20,25 @@ else
echo " - pip: pip install reuse"
fi
+echo "🔧 Linting GitHub Actions..."
+if command -v actionlint &> /dev/null; then
+ actionlint
+else
+ echo "⚠️ Warning: actionlint not installed, skipping Actions linting"
+ echo " Install with:"
+ echo " - Arch Linux: paru -S actionlint"
+ echo " - Go: go install github.com/rhysd/actionlint/cmd/actionlint@latest"
+ echo " - Homebrew: brew install actionlint"
+fi
+
+echo "🔒 Checking no_std compatibility..."
+cargo check --no-default-features -q
+cargo check --features std -q
+cargo check --no-default-features --features tracing -q
+cargo check --no-default-features --features metrics -q
+cargo check --no-default-features --features colored -q
+cargo check --all-features -q
+
echo "🔍 Running clippy (all features, all targets)..."
cargo clippy --workspace --all-targets --all-features -- -D warnings
diff --git a/Cargo.lock b/Cargo.lock
index 2bb2db3..d2f553b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -156,7 +156,7 @@ dependencies = [
"serde_json",
"serde_urlencoded",
"smallvec",
- "socket2 0.6.1",
+ "socket2 0.6.2",
"time",
"tracing",
"url",
@@ -225,12 +225,56 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
+[[package]]
+name = "anstream"
+version = "0.6.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a"
+dependencies = [
+ "anstyle",
+ "anstyle-parse",
+ "anstyle-query",
+ "anstyle-wincon",
+ "colorchoice",
+ "is_terminal_polyfill",
+ "utf8parse",
+]
+
[[package]]
name = "anstyle"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"
+[[package]]
+name = "anstyle-parse"
+version = "0.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2"
+dependencies = [
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle-query"
+version = "1.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
+dependencies = [
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "anstyle-wincon"
+version = "3.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
+dependencies = [
+ "anstyle",
+ "once_cell_polyfill",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "anyhow"
version = "1.0.100"
@@ -258,6 +302,27 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236"
+[[package]]
+name = "arrayvec"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
+
+[[package]]
+name = "assert_cmd"
+version = "2.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c5bcfa8749ac45dd12cb11055aeeb6b27a3895560d60d71e3c23bf979e60514"
+dependencies = [
+ "anstyle",
+ "bstr",
+ "libc",
+ "predicates",
+ "predicates-core",
+ "predicates-tree",
+ "wait-timeout",
+]
+
[[package]]
name = "async-trait"
version = "0.1.89"
@@ -435,6 +500,17 @@ dependencies = [
"hybrid-array",
]
+[[package]]
+name = "bstr"
+version = "1.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab"
+dependencies = [
+ "memchr",
+ "regex-automata",
+ "serde",
+]
+
[[package]]
name = "bumpalo"
version = "3.19.1"
@@ -482,9 +558,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
-version = "1.2.53"
+version = "1.2.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
+checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583"
dependencies = [
"find-msvc-tools",
"shlex",
@@ -544,6 +620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394"
dependencies = [
"clap_builder",
+ "clap_derive",
]
[[package]]
@@ -552,8 +629,23 @@ version = "4.5.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00"
dependencies = [
+ "anstream",
"anstyle",
"clap_lex",
+ "strsim",
+ "terminal_size",
+]
+
+[[package]]
+name = "clap_derive"
+version = "4.5.49"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -562,6 +654,12 @@ version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32"
+[[package]]
+name = "colorchoice"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
+
[[package]]
name = "combine"
version = "4.6.7"
@@ -972,6 +1070,12 @@ version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
+[[package]]
+name = "difflib"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
+
[[package]]
name = "digest"
version = "0.10.7"
@@ -996,6 +1100,27 @@ dependencies = [
"subtle",
]
+[[package]]
+name = "dirs"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"
+dependencies = [
+ "dirs-sys",
+]
+
+[[package]]
+name = "dirs-sys"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
+dependencies = [
+ "libc",
+ "option-ext",
+ "redox_users",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "displaydoc"
version = "0.2.5"
@@ -1185,6 +1310,15 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
+[[package]]
+name = "float-cmp"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "flume"
version = "0.11.1"
@@ -1551,9 +1685,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hybrid-array"
-version = "0.4.5"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f471e0a81b2f90ffc0cb2f951ae04da57de8baa46fa99112b062a5173a5088d0"
+checksum = "b41fb3dc24fe72c2e3a4685eed55917c2fb228851257f4a8f2d985da9443c3e5"
dependencies = [
"typenum",
]
@@ -1612,7 +1746,7 @@ dependencies = [
"libc",
"percent-encoding",
"pin-project-lite",
- "socket2 0.5.10",
+ "socket2 0.6.2",
"tokio",
"tower-service",
"tracing",
@@ -1838,6 +1972,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45"
+[[package]]
+name = "is_terminal_polyfill"
+version = "1.70.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
+
[[package]]
name = "itertools"
version = "0.13.0"
@@ -1897,9 +2037,9 @@ checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
[[package]]
name = "libm"
-version = "0.2.15"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]]
name = "libredox"
@@ -1964,7 +2104,7 @@ checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7"
[[package]]
name = "masterror"
-version = "0.27.2"
+version = "0.28.0"
dependencies = [
"actix-web",
"anyhow",
@@ -1978,9 +2118,11 @@ dependencies = [
"log",
"log-mdc",
"masterror-derive",
+ "masterror-knowledge",
"masterror-template",
"metrics",
"owo-colors",
+ "phf",
"redis",
"reqwest",
"ryu",
@@ -2005,6 +2147,21 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "masterror-cli"
+version = "0.1.0"
+dependencies = [
+ "assert_cmd",
+ "clap",
+ "dirs",
+ "masterror-knowledge",
+ "owo-colors",
+ "predicates",
+ "serde",
+ "serde_json",
+ "toml",
+]
+
[[package]]
name = "masterror-derive"
version = "0.11.2"
@@ -2015,6 +2172,24 @@ dependencies = [
"syn",
]
+[[package]]
+name = "masterror-knowledge"
+version = "0.1.0"
+dependencies = [
+ "aho-corasick",
+ "arrayvec",
+]
+
+[[package]]
+name = "masterror-rustc"
+version = "0.1.0"
+dependencies = [
+ "libc",
+ "masterror-knowledge",
+ "owo-colors",
+ "windows-sys 0.59.0",
+]
+
[[package]]
name = "masterror-template"
version = "0.4.1"
@@ -2122,6 +2297,12 @@ dependencies = [
"tempfile",
]
+[[package]]
+name = "normalize-line-endings"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
+
[[package]]
name = "nu-ansi-term"
version = "0.50.3"
@@ -2182,9 +2363,9 @@ dependencies = [
[[package]]
name = "num-conv"
-version = "0.1.0"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
+checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
[[package]]
name = "num-integer"
@@ -2242,6 +2423,12 @@ version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
+[[package]]
+name = "once_cell_polyfill"
+version = "1.70.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
+
[[package]]
name = "oorandom"
version = "11.1.5"
@@ -2292,6 +2479,12 @@ dependencies = [
"vcpkg",
]
+[[package]]
+name = "option-ext"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
+
[[package]]
name = "ordered-multimap"
version = "0.7.3"
@@ -2415,6 +2608,48 @@ dependencies = [
"sha2 0.10.9",
]
+[[package]]
+name = "phf"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
+dependencies = [
+ "phf_macros",
+ "phf_shared",
+]
+
+[[package]]
+name = "phf_generator"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
+dependencies = [
+ "phf_shared",
+ "rand 0.8.5",
+]
+
+[[package]]
+name = "phf_macros"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216"
+dependencies = [
+ "phf_generator",
+ "phf_shared",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
+dependencies = [
+ "siphasher",
+]
+
[[package]]
name = "pin-project"
version = "1.1.10"
@@ -2532,6 +2767,36 @@ dependencies = [
"zerocopy",
]
+[[package]]
+name = "predicates"
+version = "3.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573"
+dependencies = [
+ "anstyle",
+ "difflib",
+ "float-cmp",
+ "normalize-line-endings",
+ "predicates-core",
+ "regex",
+]
+
+[[package]]
+name = "predicates-core"
+version = "1.0.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa"
+
+[[package]]
+name = "predicates-tree"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c"
+dependencies = [
+ "predicates-core",
+ "termtree",
+]
+
[[package]]
name = "pretty_assertions"
version = "1.4.1"
@@ -2697,7 +2962,7 @@ dependencies = [
"itoa",
"percent-encoding",
"ryu",
- "socket2 0.6.1",
+ "socket2 0.6.2",
"url",
"xxhash-rust",
]
@@ -2720,6 +2985,17 @@ dependencies = [
"bitflags",
]
+[[package]]
+name = "redox_users"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
+dependencies = [
+ "getrandom 0.2.17",
+ "libredox",
+ "thiserror",
+]
+
[[package]]
name = "ref-cast"
version = "1.0.25"
@@ -3196,6 +3472,12 @@ dependencies = [
"rand_core 0.6.4",
]
+[[package]]
+name = "siphasher"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
+
[[package]]
name = "slab"
version = "0.4.11"
@@ -3223,9 +3505,9 @@ dependencies = [
[[package]]
name = "socket2"
-version = "0.6.1"
+version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
+checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0"
dependencies = [
"libc",
"windows-sys 0.60.2",
@@ -3612,6 +3894,22 @@ dependencies = [
"winapi-util",
]
+[[package]]
+name = "terminal_size"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0"
+dependencies = [
+ "rustix",
+ "windows-sys 0.60.2",
+]
+
+[[package]]
+name = "termtree"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683"
+
[[package]]
name = "thiserror"
version = "2.0.18"
@@ -3643,9 +3941,9 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.45"
+version = "0.3.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd"
+checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5"
dependencies = [
"deranged",
"itoa",
@@ -3658,15 +3956,15 @@ dependencies = [
[[package]]
name = "time-core"
-version = "0.1.7"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca"
+checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
[[package]]
name = "time-macros"
-version = "0.2.25"
+version = "0.2.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd"
+checksum = "78cc610bac2dcee56805c99642447d4c5dbde4d01f752ffea0199aee1f601dc4"
dependencies = [
"num-conv",
"time-core",
@@ -3728,7 +4026,7 @@ dependencies = [
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
- "socket2 0.6.1",
+ "socket2 0.6.2",
"tokio-macros",
"windows-sys 0.61.2",
]
@@ -3826,7 +4124,7 @@ dependencies = [
"hyper-util",
"percent-encoding",
"pin-project",
- "socket2 0.6.1",
+ "socket2 0.6.2",
"sync_wrapper",
"tokio",
"tokio-stream",
@@ -4074,6 +4372,12 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
+[[package]]
+name = "utf8parse"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
+
[[package]]
name = "utoipa"
version = "5.4.0"
@@ -4157,6 +4461,15 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+[[package]]
+name = "wait-timeout"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "walkdir"
version = "2.5.0"
diff --git a/Cargo.toml b/Cargo.toml
index 3b7d835..ab0e5cd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@
[package]
name = "masterror"
-version = "0.27.2"
+version = "0.28.0"
rust-version = "1.92"
edition = "2024"
license = "MIT"
@@ -42,6 +42,9 @@ include = [
members = [
"masterror-derive",
"masterror-template",
+ "masterror-knowledge",
+ "masterror-cli",
+ "masterror-rustc",
"examples/axum-rest-api",
"examples/custom-domain-errors",
"examples/sqlx-database",
@@ -60,8 +63,9 @@ readme = "README.md"
[features]
-default = ["std"]
+default = ["std", "derive"]
std = ["uuid/std", "serde/std"]
+derive = ["dep:masterror-derive", "dep:masterror-template"]
tracing = ["dep:tracing", "dep:log", "dep:log-mdc", "std"]
metrics = ["dep:metrics", "std"]
backtrace = ["std"]
@@ -82,19 +86,22 @@ tokio = ["dep:tokio", "std"]
reqwest = ["dep:reqwest", "std"]
teloxide = ["dep:teloxide-core", "std"]
init-data = ["dep:init-data-rs", "std"]
+phf = ["dep:phf"]
frontend = ["dep:wasm-bindgen", "dep:js-sys", "dep:serde-wasm-bindgen", "std"]
turnkey = ["std"]
tonic = ["dep:tonic", "std"]
openapi = ["dep:utoipa", "std"]
benchmarks = ["std"]
+knowledge = ["dep:masterror-knowledge"]
[workspace.dependencies]
masterror-derive = { version = "0.11" }
masterror-template = { version = "0.4" }
+masterror-knowledge = { version = "0.1" }
[dependencies]
-masterror-derive = { version = "0.11" }
-masterror-template = { workspace = true }
+masterror-derive = { version = "0.11", optional = true }
+masterror-template = { workspace = true, optional = true }
tracing = { version = "0.1", optional = true, default-features = false, features = [
"attributes",
"std",
@@ -147,6 +154,8 @@ tonic = { version = "0.14", optional = true }
owo-colors = { version = "4", optional = true, default-features = false, features = [
"supports-colors",
] }
+masterror-knowledge = { path = "masterror-knowledge", optional = true }
+phf = { version = "0.11", optional = true, features = ["macros"] }
[dev-dependencies]
anyhow = { version = "1", default-features = false, features = ["std"] }
@@ -158,6 +167,7 @@ tokio = { version = "1", features = [
"rt-multi-thread",
"net",
"time",
+ "io-util",
], default-features = false }
trybuild = "1"
toml = "0.9"
@@ -179,6 +189,7 @@ toml = "0.9"
[package.metadata.masterror.readme]
feature_order = [
"std",
+ "derive",
"axum",
"actix",
"openapi",
@@ -189,6 +200,7 @@ feature_order = [
"colored",
"sqlx",
"sqlx-migrate",
+ "phf",
"reqwest",
"redis",
"validator",
@@ -200,6 +212,7 @@ feature_order = [
"tonic",
"frontend",
"turnkey",
+ "knowledge",
"benchmarks",
]
feature_snippet_group = 4
@@ -226,6 +239,9 @@ description = "Actix Web ResponseError and Responder implementations"
[package.metadata.masterror.readme.features.std]
description = "Enable std support (default); required for runtime integrations"
+[package.metadata.masterror.readme.features.derive]
+description = "Enable #[derive(Error, Masterror)] proc-macros (default)"
+
[package.metadata.masterror.readme.features.openapi]
description = "Generate utoipa OpenAPI schema for ErrorResponse"
@@ -283,6 +299,12 @@ description = "Log to the browser console and convert to JsValue on WASM"
[package.metadata.masterror.readme.features.turnkey]
description = "Ship Turnkey-specific error taxonomy and conversions"
+[package.metadata.masterror.readme.features.knowledge]
+description = "Rust compiler error explanations and best practices (en/ru/ko)"
+
+[package.metadata.masterror.readme.features.phf]
+description = "Use compile-time perfect hash maps for O(1) SQLSTATE lookups"
+
[package.metadata.masterror.readme.features.benchmarks]
description = "Enable Criterion benchmarks and CI baseline tooling"
extra = ["Primarily used for local profiling and continuous benchmarking runs"]
diff --git a/README.ko.md b/README.ko.md
index 0fe7d7d..72f2008 100644
--- a/README.ko.md
+++ b/README.ko.md
@@ -25,6 +25,8 @@ SPDX-License-Identifier: MIT
> 🇬🇧 [Read README in English](README.md)
> 🇷🇺 [Читайте README на русском языке](README.ru.md)
+ **참고:** [masterror-cli](https://github.com/RAprogramm/masterror-cli) — Rust 컴파일러 오류를 상세한 해결책, 모범 사례 및 다국어 지원과 함께 설명하는 CLI 도구입니다. `cargo install masterror-cli` 또는 [AUR](https://aur.archlinux.org/packages/masterror-cli)에서 설치하세요.
+
> [!IMPORTANT]
@@ -584,25 +586,60 @@ let error = AppError::not_found("사용자를 찾을 수 없음")
println!("{}", error);
~~~
-**프로덕션 vs 개발 출력:**
+**오류 출력:**
-`colored` 기능 없이 오류는 `AppErrorKind` 레이블을 표시합니다:
-~~~
-NotFound
~~~
-
-`colored` 기능 사용 시 컨텍스트가 포함된 전체 여러 줄 형식:
-~~~
-Error: NotFound
+Not found
Code: NOT_FOUND
Message: 사용자를 찾을 수 없음
Context:
user_id: 12345
request_id: abc-def
+
+Backtrace:
+ → divide at src/main.rs:16
+ → main at src/main.rs:4
~~~
-이러한 구분은 프로덕션 로그를 깔끔하게 유지하면서 로컬 디버깅 세션 중에 개발자에게 풍부한 컨텍스트를 제공합니다.
+- `colored` — 터미널에서 구문 강조
+- `backtrace` — 자동 스택 추적 (사용자 코드만 필터링, 지원되는 터미널에서 클릭 가능한 링크)
+
+
+WezTerm: 클릭 가능한 backtrace 링크
+
+`$EDITOR`에서 파일을 열려면 `~/.wezterm.lua`에 추가하세요:
+
+~~~lua
+wezterm.on('open-uri', function(window, pane, uri)
+ if uri:find('^editor://') then
+ local path = uri:match('path=([^&]+)')
+ local line = uri:match('line=(%d+)')
+ local editor = os.getenv('EDITOR') or 'hx'
+ local args = { editor }
+
+ if path then
+ if line and (editor:find('hx') or editor:find('helix')) then
+ table.insert(args, path .. ':' .. line)
+ elseif line and (editor:find('vim') or editor:find('nvim')) then
+ table.insert(args, '+' .. line)
+ table.insert(args, path)
+ else
+ table.insert(args, path)
+ end
+
+ window:perform_action(
+ wezterm.action.SpawnCommandInNewTab { args = args },
+ pane
+ )
+ end
+ return false
+ end
+ return true
+end)
+~~~
+
+
diff --git a/README.md b/README.md
index bcafb01..fdb1193 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,8 @@ SPDX-License-Identifier: MIT
> 🇷🇺 [Читайте README на русском языке](README.ru.md)
> 🇰🇷 [한국어 README](README.ko.md)
+ **See also:** [masterror-cli](https://github.com/RAprogramm/masterror-cli) — CLI tool that explains Rust compiler errors with detailed solutions, best practices, and multi-language support. Install via `cargo install masterror-cli` or from [AUR](https://aur.archlinux.org/packages/masterror-cli).
+
---
@@ -113,6 +115,7 @@ of redaction and metadata.
| [`masterror`](https://crates.io/crates/masterror) | Core error types, metadata builders, transports, integrations and the prelude. | Application crates, services and libraries that want a stable error surface. |
| [`masterror-derive`](masterror-derive/README.md) | Proc-macros backing `#[derive(Error)]`, `#[derive(Masterror)]`, `#[app_error]` and `#[provide]`. | Brought in automatically via `masterror`; depend directly only for macro hacking. |
| [`masterror-template`](masterror-template/README.md) | Shared template parser used by the derive macros for formatter analysis. | Internal dependency; reuse when you need the template parser elsewhere. |
+| [`masterror-knowledge`](masterror-knowledge/README.md) | Knowledge base with 31+ error explanations and 15 best practices in 3 languages. | Used by [masterror-cli](https://github.com/RAprogramm/masterror-cli); depend directly for custom tooling. |
@@ -135,6 +138,7 @@ Pick only what you need; everything is off by default.
colored terminal output.
- **Async & IO integrations:** `tokio`, `reqwest`, `sqlx`, `sqlx-migrate`,
`redis`, `validator`, `config`.
+- **Performance:** `phf` for O(1) compile-time perfect hash SQLSTATE lookups.
- **Messaging & bots:** `teloxide`, `telegram-webapp-sdk`.
- **Front-end tooling:** `frontend` for WASM/browser console logging.
- **gRPC:** `tonic` to emit `tonic::Status` responses.
@@ -159,15 +163,16 @@ The build script keeps the full feature snippet below in sync with
~~~toml
[dependencies]
-masterror = { version = "0.27.2", default-features = false }
+masterror = { version = "0.28.0", default-features = false }
# or with features:
-# masterror = { version = "0.27.2", features = [
-# "std", "axum", "actix", "openapi",
-# "serde_json", "tracing", "metrics", "backtrace",
-# "colored", "sqlx", "sqlx-migrate", "reqwest",
-# "redis", "validator", "config", "tokio",
-# "multipart", "teloxide", "init-data", "tonic",
-# "frontend", "turnkey", "benchmarks"
+# masterror = { version = "0.28.0", features = [
+# "std", "derive", "axum", "actix",
+# "openapi", "serde_json", "tracing", "metrics",
+# "backtrace", "colored", "sqlx", "sqlx-migrate",
+# "phf", "reqwest", "redis", "validator",
+# "config", "tokio", "multipart", "teloxide",
+# "init-data", "tonic", "frontend", "turnkey",
+# "knowledge", "benchmarks"
# ] }
~~~
@@ -640,7 +645,7 @@ Enable the `colored` feature for enhanced terminal output in local mode:
~~~toml
[dependencies]
-masterror = { version = "0.27.2", features = ["colored"] }
+masterror = { version = "0.28.0", features = ["colored"] }
~~~
With `colored` enabled, errors display with syntax highlighting:
@@ -656,31 +661,63 @@ let error = AppError::not_found("User not found")
.with_field(field::str("user_id", "12345"))
.with_field(field::str("request_id", "abc-def"));
-// Without 'colored': plain text
-// With 'colored': color-coded output in terminals
println!("{}", error);
~~~
-**Production vs Development Output:**
+**Error Output:**
-Without `colored` feature, errors display their `AppErrorKind` label:
-~~~
-NotFound
~~~
-
-With `colored` feature, full multi-line format with context:
-~~~
-Error: NotFound
+Not found
Code: NOT_FOUND
Message: User not found
Context:
user_id: 12345
request_id: abc-def
+
+Backtrace:
+ → divide at src/main.rs:16
+ → main at src/main.rs:4
~~~
-This separation keeps production logs clean while giving developers rich context
-during local debugging sessions.
+- `colored` — syntax highlighting in terminal
+- `backtrace` — automatic stack trace (filtered to your code only, clickable links in supported terminals)
+
+
+WezTerm: clickable backtrace links
+
+Add to `~/.wezterm.lua` to open files in your `$EDITOR`:
+
+~~~lua
+wezterm.on('open-uri', function(window, pane, uri)
+ if uri:find('^editor://') then
+ local path = uri:match('path=([^&]+)')
+ local line = uri:match('line=(%d+)')
+ local editor = os.getenv('EDITOR') or 'hx'
+ local args = { editor }
+
+ if path then
+ if line and (editor:find('hx') or editor:find('helix')) then
+ table.insert(args, path .. ':' .. line)
+ elseif line and (editor:find('vim') or editor:find('nvim')) then
+ table.insert(args, '+' .. line)
+ table.insert(args, path)
+ else
+ table.insert(args, path)
+ end
+
+ window:perform_action(
+ wezterm.action.SpawnCommandInNewTab { args = args },
+ pane
+ )
+ end
+ return false
+ end
+ return true
+end)
+~~~
+
+
diff --git a/README.ru.md b/README.ru.md
index a1c46b9..be448d7 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -25,6 +25,8 @@ SPDX-License-Identifier: MIT
> 🇬🇧 [Read README in English](README.md)
> 🇰🇷 [한국어 README](README.ko.md)
+ **См. также:** [masterror-cli](https://github.com/RAprogramm/masterror-cli) — CLI-инструмент для объяснения ошибок компилятора Rust с подробными решениями, лучшими практиками и поддержкой нескольких языков. Установка: `cargo install masterror-cli` или из [AUR](https://aur.archlinux.org/packages/masterror-cli).
+
> [!IMPORTANT]
@@ -585,25 +587,60 @@ let error = AppError::not_found("Пользователь не найден")
println!("{}", error);
~~~
-**Вывод в Production vs Development:**
+**Вывод ошибок:**
-Без функции `colored` ошибки отображают метку `AppErrorKind`:
-~~~
-NotFound
~~~
-
-С функцией `colored` полный многострочный формат с контекстом:
-~~~
-Error: NotFound
+Not found
Code: NOT_FOUND
Message: Пользователь не найден
Context:
user_id: 12345
request_id: abc-def
+
+Backtrace:
+ → divide at src/main.rs:16
+ → main at src/main.rs:4
~~~
-Такое разделение сохраняет production логи чистыми, предоставляя разработчикам богатый контекст во время локальных сессий отладки.
+- `colored` — подсветка синтаксиса в терминале
+- `backtrace` — автоматический стек вызовов (фильтруется до вашего кода, кликабельные ссылки в поддерживаемых терминалах)
+
+
+WezTerm: кликабельные ссылки в backtrace
+
+Добавьте в `~/.wezterm.lua` для открытия файлов в `$EDITOR`:
+
+~~~lua
+wezterm.on('open-uri', function(window, pane, uri)
+ if uri:find('^editor://') then
+ local path = uri:match('path=([^&]+)')
+ local line = uri:match('line=(%d+)')
+ local editor = os.getenv('EDITOR') or 'hx'
+ local args = { editor }
+
+ if path then
+ if line and (editor:find('hx') or editor:find('helix')) then
+ table.insert(args, path .. ':' .. line)
+ elseif line and (editor:find('vim') or editor:find('nvim')) then
+ table.insert(args, '+' .. line)
+ table.insert(args, path)
+ else
+ table.insert(args, path)
+ end
+
+ window:perform_action(
+ wezterm.action.SpawnCommandInNewTab { args = args },
+ pane
+ )
+ end
+ return false
+ end
+ return true
+end)
+~~~
+
+
diff --git a/README.template.md b/README.template.md
index 381a842..e3ab140 100644
--- a/README.template.md
+++ b/README.template.md
@@ -26,6 +26,8 @@ SPDX-License-Identifier: MIT
> 🇷🇺 [Читайте README на русском языке](README.ru.md)
> 🇰🇷 [한국어 README](README.ko.md)
+ **See also:** [masterror-cli](https://github.com/RAprogramm/masterror-cli) — CLI tool that explains Rust compiler errors with detailed solutions, best practices, and multi-language support. Install via `cargo install masterror-cli` or from [AUR](https://aur.archlinux.org/packages/masterror-cli).
+
---
@@ -113,6 +115,7 @@ of redaction and metadata.
| [`masterror`](https://crates.io/crates/masterror) | Core error types, metadata builders, transports, integrations and the prelude. | Application crates, services and libraries that want a stable error surface. |
| [`masterror-derive`](masterror-derive/README.md) | Proc-macros backing `#[derive(Error)]`, `#[derive(Masterror)]`, `#[app_error]` and `#[provide]`. | Brought in automatically via `masterror`; depend directly only for macro hacking. |
| [`masterror-template`](masterror-template/README.md) | Shared template parser used by the derive macros for formatter analysis. | Internal dependency; reuse when you need the template parser elsewhere. |
+| [`masterror-knowledge`](masterror-knowledge/README.md) | Knowledge base with 31+ error explanations and 15 best practices in 3 languages. | Used by [masterror-cli](https://github.com/RAprogramm/masterror-cli); depend directly for custom tooling. |
@@ -135,6 +138,7 @@ Pick only what you need; everything is off by default.
colored terminal output.
- **Async & IO integrations:** `tokio`, `reqwest`, `sqlx`, `sqlx-migrate`,
`redis`, `validator`, `config`.
+- **Performance:** `phf` for O(1) compile-time perfect hash SQLSTATE lookups.
- **Messaging & bots:** `teloxide`, `telegram-webapp-sdk`.
- **Front-end tooling:** `frontend` for WASM/browser console logging.
- **gRPC:** `tonic` to emit `tonic::Status` responses.
@@ -651,31 +655,63 @@ let error = AppError::not_found("User not found")
.with_field(field::str("user_id", "12345"))
.with_field(field::str("request_id", "abc-def"));
-// Without 'colored': plain text
-// With 'colored': color-coded output in terminals
println!("{}", error);
~~~
-**Production vs Development Output:**
+**Error Output:**
-Without `colored` feature, errors display their `AppErrorKind` label:
-~~~
-NotFound
~~~
-
-With `colored` feature, full multi-line format with context:
-~~~
-Error: NotFound
+Not found
Code: NOT_FOUND
Message: User not found
Context:
user_id: 12345
request_id: abc-def
+
+Backtrace:
+ → divide at src/main.rs:16
+ → main at src/main.rs:4
~~~
-This separation keeps production logs clean while giving developers rich context
-during local debugging sessions.
+- `colored` — syntax highlighting in terminal
+- `backtrace` — automatic stack trace (filtered to your code only, clickable links in supported terminals)
+
+
+WezTerm: clickable backtrace links
+
+Add to `~/.wezterm.lua` to open files in your `$EDITOR`:
+
+~~~lua
+wezterm.on('open-uri', function(window, pane, uri)
+ if uri:find('^editor://') then
+ local path = uri:match('path=([^&]+)')
+ local line = uri:match('line=(%d+)')
+ local editor = os.getenv('EDITOR') or 'hx'
+ local args = { editor }
+
+ if path then
+ if line and (editor:find('hx') or editor:find('helix')) then
+ table.insert(args, path .. ':' .. line)
+ elseif line and (editor:find('vim') or editor:find('nvim')) then
+ table.insert(args, '+' .. line)
+ table.insert(args, path)
+ else
+ table.insert(args, path)
+ end
+
+ window:perform_action(
+ wezterm.action.SpawnCommandInNewTab { args = args },
+ pane
+ )
+ end
+ return false
+ end
+ return true
+end)
+~~~
+
+
diff --git a/REUSE.toml b/REUSE.toml
new file mode 100644
index 0000000..aa45311
--- /dev/null
+++ b/REUSE.toml
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2025-2026 RAprogramm
+#
+# SPDX-License-Identifier: MIT
+
+version = 1
+
+[[annotations]]
+path = ["**/Cargo.lock", "pkg/aur/.SRCINFO", "**/.cargo/config.toml"]
+SPDX-FileCopyrightText = "2025-2026 RAprogramm "
+SPDX-License-Identifier = "MIT"
+
+[[annotations]]
+path = ["masterror-knowledge/src/errors/**"]
+SPDX-FileCopyrightText = "2025-2026 RAprogramm "
+SPDX-License-Identifier = "MIT"
diff --git a/images/masterror-knowledge.png b/images/masterror-knowledge.png
new file mode 100644
index 0000000..31baba7
Binary files /dev/null and b/images/masterror-knowledge.png differ
diff --git a/images/masterror-knowledge.png.license b/images/masterror-knowledge.png.license
new file mode 100644
index 0000000..c6d90e7
--- /dev/null
+++ b/images/masterror-knowledge.png.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2025-2026 RAprogramm
+
+SPDX-License-Identifier: MIT
diff --git a/masterror-cli/Cargo.toml b/masterror-cli/Cargo.toml
new file mode 100644
index 0000000..9b0b998
--- /dev/null
+++ b/masterror-cli/Cargo.toml
@@ -0,0 +1,55 @@
+# SPDX-FileCopyrightText: 2025-2026 RAprogramm
+#
+# SPDX-License-Identifier: MIT
+
+[package]
+name = "masterror-cli"
+version = "0.1.0"
+edition.workspace = true
+rust-version.workspace = true
+license.workspace = true
+repository.workspace = true
+description = "CLI tool for explaining Rust compiler errors in human-friendly language"
+keywords = ["rust", "compiler", "errors", "explain", "cli"]
+categories = ["command-line-utilities", "development-tools"]
+
+[[bin]]
+name = "masterror"
+path = "src/main.rs"
+
+[[bin]]
+name = "cargo-masterror"
+path = "src/main.rs"
+
+[features]
+default = ["show-why", "show-fix", "show-link", "show-translation"]
+
+# Display sections
+show-why = []
+show-fix = []
+show-link = []
+show-translation = []
+
+# Show original compiler output before masterror block
+show-original = []
+
+[dependencies]
+masterror-knowledge = { version = "0.1", path = "../masterror-knowledge" }
+
+# CLI framework
+clap = { version = "4", features = ["derive", "env", "wrap_help"] }
+
+# Colored output
+owo-colors = { version = "4", features = ["supports-colors"] }
+
+# Serialization
+serde = { version = "1", features = ["derive"] }
+serde_json = "1"
+toml = "0.9"
+
+# Config paths
+dirs = "6"
+
+[dev-dependencies]
+assert_cmd = "2"
+predicates = "3"
diff --git a/masterror-cli/src/commands.rs b/masterror-cli/src/commands.rs
new file mode 100644
index 0000000..7f2c260
--- /dev/null
+++ b/masterror-cli/src/commands.rs
@@ -0,0 +1,16 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! CLI commands.
+
+mod check;
+mod explain;
+pub mod init;
+mod list;
+pub mod practice;
+
+pub use check::run as check;
+pub use explain::run as explain;
+pub use init::run as init;
+pub use list::run as list;
diff --git a/masterror-cli/src/commands/check.rs b/masterror-cli/src/commands/check.rs
new file mode 100644
index 0000000..d84bbb3
--- /dev/null
+++ b/masterror-cli/src/commands/check.rs
@@ -0,0 +1,126 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Check command - run cargo check and explain errors.
+
+use std::{
+ io::{BufRead, BufReader},
+ process::{Command, Stdio}
+};
+
+use masterror_knowledge::Lang;
+
+use crate::{
+ error::{AppError, Result},
+ options::DisplayOptions,
+ output,
+ parser::CargoMessage
+};
+
+/// Allowed cargo arguments whitelist.
+const ALLOWED_ARGS: &[&str] = &[
+ "--release",
+ "--all-targets",
+ "--all-features",
+ "--no-default-features",
+ "-p",
+ "--package",
+ "--workspace",
+ "--lib",
+ "--bins",
+ "--bin",
+ "--examples",
+ "--example",
+ "--tests",
+ "--test",
+ "--benches",
+ "--bench",
+ "--features",
+ "-F",
+ "--target",
+ "--profile",
+ "-j",
+ "--jobs",
+ "-v",
+ "--verbose",
+ "-q",
+ "--quiet",
+ "--locked",
+ "--frozen",
+ "--offline"
+];
+
+/// Validate cargo arguments against whitelist.
+fn validate_args(args: &[String]) -> Result<()> {
+ for arg in args {
+ if arg.starts_with('-') {
+ let is_allowed = ALLOWED_ARGS
+ .iter()
+ .any(|allowed| arg == *allowed || arg.starts_with(&format!("{allowed}=")));
+ if !is_allowed {
+ return Err(AppError::InvalidArgument {
+ arg: arg.clone()
+ });
+ }
+ }
+ }
+ Ok(())
+}
+
+/// Run cargo check and explain errors.
+pub fn run(lang: Lang, args: &[String], opts: &DisplayOptions) -> Result<()> {
+ validate_args(args)?;
+
+ let msg_format = if opts.colored {
+ "--message-format=json-diagnostic-rendered-ansi"
+ } else {
+ "--message-format=json"
+ };
+
+ let mut cmd = Command::new("cargo")
+ .arg("check")
+ .arg(msg_format)
+ .args(args)
+ .stdout(Stdio::piped())
+ .stderr(Stdio::inherit())
+ .spawn()?;
+
+ let stdout = cmd
+ .stdout
+ .take()
+ .ok_or_else(|| AppError::Io(std::io::Error::other("failed to capture stdout")))?;
+ let reader = BufReader::new(stdout);
+
+ let mut error_count = 0;
+
+ for line in reader.lines() {
+ let line = line?;
+ if let Ok(msg) = serde_json::from_str::(&line)
+ && msg.is_error()
+ {
+ error_count += 1;
+ output::print_error(lang, &msg, opts);
+ println!();
+ }
+ }
+
+ let status = cmd.wait()?;
+
+ if error_count > 0 {
+ println!("Found {error_count} error(s). Run `masterror explain ` for details.");
+ }
+
+ if !status.success() {
+ match status.code() {
+ Some(code) => {
+ return Err(AppError::CargoFailed {
+ code
+ });
+ }
+ None => return Err(AppError::CargoSignaled)
+ }
+ }
+
+ Ok(())
+}
diff --git a/masterror-cli/src/commands/explain.rs b/masterror-cli/src/commands/explain.rs
new file mode 100644
index 0000000..0a6dcf7
--- /dev/null
+++ b/masterror-cli/src/commands/explain.rs
@@ -0,0 +1,174 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Explain command - explain a specific error code or best practice.
+
+use masterror_knowledge::{
+ BestPractice, ErrorEntry, ErrorRegistry, Lang, PracticeRegistry, UiMsg
+};
+use owo_colors::OwoColorize;
+
+use crate::{
+ error::{AppError, Result},
+ options::DisplayOptions
+};
+
+/// Explain a specific error code (E0382) or best practice (RA001).
+pub fn run(lang: Lang, code: &str, opts: &DisplayOptions) -> Result<()> {
+ let upper = code.to_uppercase();
+
+ if upper.starts_with("RA") {
+ let registry = PracticeRegistry::new();
+ if let Some(practice) = registry.find(&upper) {
+ print_practice(lang, practice, opts);
+ return Ok(());
+ }
+ }
+
+ let registry = ErrorRegistry::new();
+ if let Some(entry) = registry.find(code) {
+ print_error(lang, entry, opts);
+ return Ok(());
+ }
+
+ Err(AppError::UnknownErrorCode {
+ code: code.to_string()
+ })
+}
+
+fn print_error(lang: Lang, entry: &ErrorEntry, opts: &DisplayOptions) {
+ println!();
+
+ let title = entry.title.get(lang.code());
+ if opts.colored {
+ println!("{} - {}", entry.code.yellow().bold(), title.bold());
+ } else {
+ println!("{} - {title}", entry.code);
+ }
+
+ let category = entry.category.name(lang.code());
+ if opts.colored {
+ println!("{}: {}", UiMsg::Category.get(lang), category.dimmed());
+ } else {
+ println!("{}: {category}", UiMsg::Category.get(lang));
+ }
+
+ println!();
+ let why_label = UiMsg::LabelWhy.get(lang);
+ if opts.colored {
+ println!("{}", why_label.green().bold());
+ } else {
+ println!("{why_label}");
+ }
+ println!("{}", entry.explanation.get(lang.code()));
+
+ if !entry.fixes.is_empty() {
+ println!();
+ let fix_label = UiMsg::LabelFix.get(lang);
+ if opts.colored {
+ println!("{}", fix_label.green().bold());
+ } else {
+ println!("{fix_label}");
+ }
+ for (i, fix) in entry.fixes.iter().enumerate() {
+ println!();
+ println!("{}. {}", i + 1, fix.description.get(lang.code()));
+ println!("```rust");
+ println!("{}", fix.code);
+ println!("```");
+ }
+ }
+
+ if !entry.links.is_empty() {
+ println!();
+ let link_label = UiMsg::LabelLink.get(lang);
+ if opts.colored {
+ println!("{}", link_label.cyan().bold());
+ } else {
+ println!("{link_label}");
+ }
+ for link in entry.links {
+ if opts.colored {
+ println!(" - {} {}", link.title, link.url.dimmed());
+ } else {
+ println!(" - {} {}", link.title, link.url);
+ }
+ }
+ }
+
+ println!();
+}
+
+/// Print best practice details.
+pub fn print_practice(lang: Lang, practice: &BestPractice, opts: &DisplayOptions) {
+ println!();
+
+ let title = practice.title.get(lang.code());
+ if opts.colored {
+ println!("{} - {}", practice.code.yellow().bold(), title.bold());
+ } else {
+ println!("{} - {title}", practice.code);
+ }
+
+ let category = practice.category.name(lang.code());
+ if opts.colored {
+ println!("{}: {}", UiMsg::Category.get(lang), category.dimmed());
+ } else {
+ println!("{}: {category}", UiMsg::Category.get(lang));
+ }
+
+ println!();
+ let why_label = UiMsg::LabelWhyMatters.get(lang);
+ if opts.colored {
+ println!("{}", why_label.green().bold());
+ } else {
+ println!("{why_label}");
+ }
+ println!("{}", practice.explanation.get(lang.code()));
+
+ println!();
+ let how_label = UiMsg::LabelHowToApply.get(lang);
+ if opts.colored {
+ println!("{}", how_label.green().bold());
+ } else {
+ println!("{how_label}");
+ }
+
+ println!();
+ let avoid_label = UiMsg::LabelAvoid.get(lang);
+ if opts.colored {
+ println!("{}. {}", "1".cyan(), avoid_label.red());
+ } else {
+ println!("1. {avoid_label}");
+ }
+ println!("```rust");
+ println!("{}", practice.bad_example);
+ println!("```");
+
+ println!();
+ let prefer_label = UiMsg::LabelPrefer.get(lang);
+ if opts.colored {
+ println!("{}. {}", "2".cyan(), prefer_label.green());
+ } else {
+ println!("2. {prefer_label}");
+ }
+ println!("```rust");
+ println!("{}", practice.good_example);
+ println!("```");
+
+ println!();
+ let link_label = UiMsg::LabelLink.get(lang);
+ if opts.colored {
+ println!("{}", link_label.cyan().bold());
+ } else {
+ println!("{link_label}");
+ }
+ if opts.colored {
+ println!(" - RustManifest {}", practice.source.dimmed());
+ } else {
+ println!(" - RustManifest {}", practice.source);
+ }
+
+ println!();
+}
diff --git a/masterror-cli/src/commands/init.rs b/masterror-cli/src/commands/init.rs
new file mode 100644
index 0000000..59d9d0e
--- /dev/null
+++ b/masterror-cli/src/commands/init.rs
@@ -0,0 +1,295 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Init command - create configuration file interactively.
+
+use std::io::{self, Write};
+
+use masterror_knowledge::{Lang, UiMsg};
+use owo_colors::OwoColorize;
+
+use crate::{
+ config::{Config, DisplayConfig, GeneralConfig},
+ error::Result
+};
+
+/// Run init command - create configuration interactively.
+pub fn run(_lang: Lang, colored: bool) -> Result<()> {
+ println!();
+ print_welcome(colored);
+ println!();
+
+ // First ask language - this affects all subsequent prompts
+ let lang_value = prompt_language(colored)?;
+ let lang = masterror_knowledge::Lang::from_code(&lang_value);
+
+ let color_value = prompt_colors(lang, colored)?;
+ let display = prompt_display(lang, colored)?;
+ let save_location = prompt_save_location(lang, colored)?;
+
+ let config = Config {
+ general: GeneralConfig {
+ lang: lang_value,
+ colored: color_value
+ },
+ display,
+ aliases: default_aliases()
+ };
+
+ let saved_path = match save_location {
+ SaveLocation::Global => {
+ config.save()?;
+ Config::path()
+ .map(|p| p.display().to_string())
+ .unwrap_or_else(|| "~/.config/masterror/config.toml".to_string())
+ }
+ SaveLocation::Local => {
+ let path = config.save_local()?;
+ path.display().to_string()
+ }
+ };
+
+ println!();
+ print_success(lang, colored, &saved_path);
+ print_tips(lang, colored, &save_location);
+
+ Ok(())
+}
+
+/// Check if first run and prompt for setup.
+pub fn check_first_run(colored: bool) -> Result {
+ if !Config::is_first_run() {
+ return Ok(false);
+ }
+
+ println!();
+ if colored {
+ println!(
+ "{}",
+ "Welcome to masterror! Let's set up your preferences.".cyan()
+ );
+ println!(
+ "{}",
+ "(This only happens once. Run `masterror init` to reconfigure later.)".dimmed()
+ );
+ } else {
+ println!("Welcome to masterror! Let's set up your preferences.");
+ println!("(This only happens once. Run `masterror init` to reconfigure later.)");
+ }
+ println!();
+
+ run(Lang::En, colored)?;
+ Ok(true)
+}
+
+#[derive(Clone, Copy)]
+enum SaveLocation {
+ Global,
+ Local
+}
+
+fn print_welcome(colored: bool) {
+ let title = "masterror - Rust compiler error explainer";
+ let subtitle = "Let's configure your preferences";
+
+ if colored {
+ println!("{}", title.bold().cyan());
+ println!("{}", subtitle.dimmed());
+ } else {
+ println!("{title}");
+ println!("{subtitle}");
+ }
+}
+
+fn prompt_language(colored: bool) -> Result {
+ println!();
+ if colored {
+ println!(
+ "{}",
+ "Select your language / Выберите язык / 언어 선택".bold()
+ );
+ println!(" {} - English", "en".cyan());
+ println!(" {} - Русский", "ru".cyan());
+ println!(" {} - 한국어", "ko".cyan());
+ } else {
+ println!("Select your language / Выберите язык / 언어 선택");
+ println!(" en - English");
+ println!(" ru - Русский");
+ println!(" ko - 한국어");
+ }
+
+ if colored {
+ print!("{} [en/ru/ko] ({}): ", "Choice".bold(), "en".dimmed());
+ } else {
+ print!("Choice [en/ru/ko] (en): ");
+ }
+ io::stdout().flush()?;
+
+ let mut input = String::new();
+ io::stdin().read_line(&mut input)?;
+ let choice = input.trim().to_lowercase();
+
+ Ok(
+ if choice.is_empty() || !["en", "ru", "ko"].contains(&choice.as_str()) {
+ "en".to_string()
+ } else {
+ choice
+ }
+ )
+}
+
+fn prompt_colors(lang: Lang, colored: bool) -> Result {
+ let prompt = UiMsg::InitColorPrompt.get(lang);
+
+ if colored {
+ print!("{} [y/n] ({}): ", prompt.bold(), "y".dimmed());
+ } else {
+ print!("{prompt} [y/n] (y): ");
+ }
+ io::stdout().flush()?;
+
+ let mut input = String::new();
+ io::stdin().read_line(&mut input)?;
+ Ok(!matches!(input.trim().to_lowercase().as_str(), "n" | "no"))
+}
+
+fn prompt_display(lang: Lang, colored: bool) -> Result {
+ let prompt = UiMsg::InitDisplayPrompt.get(lang);
+ println!();
+ if colored {
+ println!("{}", prompt.bold());
+ } else {
+ println!("{prompt}");
+ }
+
+ let translation = prompt_bool(lang, colored, UiMsg::InitShowTranslation, true)?;
+ let why = prompt_bool(lang, colored, UiMsg::InitShowWhy, true)?;
+ let fix = prompt_bool(lang, colored, UiMsg::InitShowFix, true)?;
+ let links = prompt_bool(lang, colored, UiMsg::InitShowLinks, true)?;
+ let original = prompt_bool(lang, colored, UiMsg::InitShowOriginal, false)?;
+
+ Ok(DisplayConfig {
+ translation,
+ why,
+ fix,
+ links,
+ original
+ })
+}
+
+fn prompt_save_location(lang: Lang, colored: bool) -> Result {
+ println!();
+ let global_label = UiMsg::InitSaveGlobal.get(lang);
+ let local_label = UiMsg::InitSaveLocal.get(lang);
+
+ if colored {
+ println!("{}", UiMsg::InitSavePrompt.get(lang).bold());
+ println!(" {} - {}", "1".cyan(), global_label);
+ println!(" {} - {}", "2".cyan(), local_label);
+ } else {
+ println!("{}", UiMsg::InitSavePrompt.get(lang));
+ println!(" 1 - {global_label}");
+ println!(" 2 - {local_label}");
+ }
+
+ if colored {
+ print!("{} [1/2] ({}): ", "Choice".bold(), "1".dimmed());
+ } else {
+ print!("Choice [1/2] (1): ");
+ }
+ io::stdout().flush()?;
+
+ let mut input = String::new();
+ io::stdin().read_line(&mut input)?;
+
+ Ok(match input.trim() {
+ "2" => SaveLocation::Local,
+ _ => SaveLocation::Global
+ })
+}
+
+fn prompt_bool(lang: Lang, colored: bool, msg: UiMsg, default: bool) -> Result {
+ let label = msg.get(lang);
+ let default_str = if default { "y" } else { "n" };
+
+ if colored {
+ print!(" {} [y/n] ({}): ", label, default_str.dimmed());
+ } else {
+ print!(" {label} [y/n] ({default_str}): ");
+ }
+ io::stdout().flush()?;
+
+ let mut input = String::new();
+ io::stdin().read_line(&mut input)?;
+ let trimmed = input.trim().to_lowercase();
+
+ Ok(if trimmed.is_empty() {
+ default
+ } else {
+ matches!(trimmed.as_str(), "y" | "yes" | "д" | "да")
+ })
+}
+
+fn print_success(lang: Lang, colored: bool, path: &str) {
+ let msg = UiMsg::InitSuccess.get(lang);
+
+ if colored {
+ println!("{} {}", msg.green(), path.dimmed());
+ } else {
+ println!("{msg} {path}");
+ }
+}
+
+fn print_tips(lang: Lang, colored: bool, location: &SaveLocation) {
+ println!();
+ let tip = UiMsg::InitTip.get(lang);
+
+ if colored {
+ println!("{}", tip.dimmed());
+ } else {
+ println!("{tip}");
+ }
+
+ match location {
+ SaveLocation::Global => {
+ let global_path = Config::path()
+ .map(|p| p.display().to_string())
+ .unwrap_or_else(|| "~/.config/masterror/config.toml".to_string());
+ if colored {
+ println!(" {} {}", "Global:".dimmed(), global_path.dimmed());
+ } else {
+ println!(" Global: {global_path}");
+ }
+ }
+ SaveLocation::Local => {
+ if colored {
+ println!(" {} .masterror.toml", "Local:".dimmed());
+ } else {
+ println!(" Local: .masterror.toml");
+ }
+ }
+ }
+
+ println!();
+ let usage = UiMsg::InitUsage.get(lang);
+ if colored {
+ println!("{}", usage.cyan());
+ println!(" {} cargo masterror check", "$".dimmed());
+ println!(" {} masterror explain E0382", "$".dimmed());
+ } else {
+ println!("{usage}");
+ println!(" $ cargo masterror check");
+ println!(" $ masterror explain E0382");
+ }
+ println!();
+}
+
+fn default_aliases() -> std::collections::HashMap {
+ let mut aliases = std::collections::HashMap::new();
+ aliases.insert("c".to_string(), "check".to_string());
+ aliases.insert("e".to_string(), "explain".to_string());
+ aliases.insert("l".to_string(), "list".to_string());
+ aliases.insert("p".to_string(), "practice".to_string());
+ aliases
+}
diff --git a/masterror-cli/src/commands/list.rs b/masterror-cli/src/commands/list.rs
new file mode 100644
index 0000000..3d67f53
--- /dev/null
+++ b/masterror-cli/src/commands/list.rs
@@ -0,0 +1,74 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! List command - list all known error codes.
+
+use masterror_knowledge::{Category, ErrorRegistry, Lang};
+
+use crate::{
+ error::{AppError, Result},
+ options::DisplayOptions,
+ output::{print_category_header, print_code_title, print_title}
+};
+
+/// List all known error codes.
+pub fn run(lang: Lang, category: Option<&str>, opts: &DisplayOptions) -> Result<()> {
+ let registry = ErrorRegistry::new();
+
+ println!();
+ print_title("Known Rust Compiler Errors", opts.colored);
+ println!();
+
+ let mut entries: Vec<_> = if let Some(cat) = category {
+ let cat = parse_category(cat);
+ if let Some(c) = cat {
+ registry.by_category(c)
+ } else {
+ return Err(AppError::InvalidCategory {
+ name: category.unwrap_or("").to_string()
+ });
+ }
+ } else {
+ registry.all().collect()
+ };
+
+ if entries.is_empty() {
+ println!(" No errors found.");
+ return Ok(());
+ }
+
+ entries.sort_by_key(|e| e.code);
+
+ let mut current_cat: Option = None;
+ for entry in &entries {
+ if current_cat != Some(entry.category) {
+ current_cat = Some(entry.category);
+ println!();
+ print_category_header(entry.category.name(lang.code()), opts.colored);
+ println!();
+ }
+ print_code_title(entry.code, entry.title.get(lang.code()), opts.colored);
+ }
+
+ println!();
+ println!("Total: {} errors", entries.len());
+ println!();
+ println!("Use `masterror explain ` to see details.");
+ println!("Use `masterror practice` to see best practices.");
+ println!();
+
+ Ok(())
+}
+
+fn parse_category(s: &str) -> Option {
+ match s.to_lowercase().as_str() {
+ "ownership" | "own" => Some(Category::Ownership),
+ "borrowing" | "borrow" => Some(Category::Borrowing),
+ "lifetimes" | "lifetime" | "life" => Some(Category::Lifetimes),
+ "types" | "type" => Some(Category::Types),
+ "traits" | "trait" => Some(Category::Traits),
+ "resolution" | "resolve" | "names" => Some(Category::Resolution),
+ _ => None
+ }
+}
diff --git a/masterror-cli/src/commands/practice.rs b/masterror-cli/src/commands/practice.rs
new file mode 100644
index 0000000..b651b04
--- /dev/null
+++ b/masterror-cli/src/commands/practice.rs
@@ -0,0 +1,92 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Practice command - show best practices from RustManifest.
+
+use masterror_knowledge::{Lang, PracticeCategory, PracticeRegistry};
+
+use super::explain::print_practice;
+use crate::{
+ error::{AppError, Result},
+ options::DisplayOptions,
+ output::{print_category_header, print_code_title, print_title}
+};
+
+/// List all best practices or filter by category.
+pub fn list(lang: Lang, category: Option<&str>, opts: &DisplayOptions) -> Result<()> {
+ let registry = PracticeRegistry::new();
+
+ println!();
+ print_title("RustManifest Best Practices", opts.colored);
+ println!();
+
+ let practices: Vec<_> = if let Some(cat) = category {
+ let cat = parse_category(cat);
+ if let Some(c) = cat {
+ registry.by_category(c)
+ } else {
+ return Err(AppError::InvalidCategory {
+ name: category.unwrap_or("").to_string()
+ });
+ }
+ } else {
+ registry.all().collect()
+ };
+
+ if practices.is_empty() {
+ println!(" No practices found.");
+ return Ok(());
+ }
+
+ let mut sorted = practices;
+ sorted.sort_by_key(|p| p.code);
+
+ let mut current_cat: Option = None;
+ for practice in &sorted {
+ if current_cat != Some(practice.category) {
+ current_cat = Some(practice.category);
+ println!();
+ print_category_header(practice.category.name(lang.code()), opts.colored);
+ println!();
+ }
+ print_code_title(practice.code, practice.title.get(lang.code()), opts.colored);
+ }
+
+ println!();
+ println!("Total: {} practices", sorted.len());
+ println!();
+ println!("Use `masterror practice ` to see details.");
+ println!();
+
+ Ok(())
+}
+
+/// Show a specific best practice.
+pub fn show(lang: Lang, code: &str, opts: &DisplayOptions) -> Result<()> {
+ let registry = PracticeRegistry::new();
+
+ let Some(practice) = registry.find(code) else {
+ return Err(AppError::UnknownPracticeCode {
+ code: code.to_string()
+ });
+ };
+
+ print_practice(lang, practice, opts);
+ Ok(())
+}
+
+fn parse_category(s: &str) -> Option {
+ match s.to_lowercase().as_str() {
+ "error-handling" | "error_handling" | "errorhandling" | "errors" => {
+ Some(PracticeCategory::ErrorHandling)
+ }
+ "performance" | "perf" => Some(PracticeCategory::Performance),
+ "naming" | "names" => Some(PracticeCategory::Naming),
+ "documentation" | "docs" | "doc" => Some(PracticeCategory::Documentation),
+ "design" | "architecture" | "arch" => Some(PracticeCategory::Design),
+ "testing" | "tests" | "test" => Some(PracticeCategory::Testing),
+ "security" | "sec" => Some(PracticeCategory::Security),
+ _ => None
+ }
+}
diff --git a/masterror-cli/src/config.rs b/masterror-cli/src/config.rs
new file mode 100644
index 0000000..b9b0cb0
--- /dev/null
+++ b/masterror-cli/src/config.rs
@@ -0,0 +1,203 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Configuration management for masterror-cli.
+//!
+//! Supports layered configuration (highest priority first):
+//! 1. CLI arguments
+//! 2. Environment variables
+//! 3. Local project config (.masterror.toml in current directory)
+//! 4. Global config (~/.config/masterror/config.toml)
+//! 5. Default values
+
+use std::{collections::HashMap, env, fs, path::PathBuf};
+
+use serde::{Deserialize, Serialize};
+
+use crate::error::{AppError, Result};
+
+/// Global config file name.
+const CONFIG_FILE: &str = "config.toml";
+
+/// Local project config file name.
+const LOCAL_CONFIG_FILE: &str = ".masterror.toml";
+
+/// Config directory name.
+const CONFIG_DIR: &str = "masterror";
+
+/// Application configuration.
+#[derive(Debug, Clone, Default, Serialize, Deserialize)]
+#[serde(default)]
+pub struct Config {
+ /// General settings.
+ pub general: GeneralConfig,
+ /// Display settings.
+ pub display: DisplayConfig,
+ /// Command aliases.
+ pub aliases: HashMap
+}
+
+/// General configuration options.
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(default)]
+pub struct GeneralConfig {
+ /// Language code (en, ru, ko).
+ pub lang: String,
+ /// Enable colored output.
+ pub colored: bool
+}
+
+/// Display section toggles.
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(default)]
+pub struct DisplayConfig {
+ /// Show translated error message.
+ pub translation: bool,
+ /// Show "why this happens" explanation.
+ pub why: bool,
+ /// Show fix suggestions.
+ pub fix: bool,
+ /// Show documentation links.
+ pub links: bool,
+ /// Show original compiler output.
+ pub original: bool
+}
+
+impl Default for GeneralConfig {
+ fn default() -> Self {
+ Self {
+ lang: "en".to_string(),
+ colored: true
+ }
+ }
+}
+
+impl Default for DisplayConfig {
+ fn default() -> Self {
+ Self {
+ translation: true,
+ why: true,
+ fix: true,
+ links: true,
+ original: false
+ }
+ }
+}
+
+impl Config {
+ /// Get global config directory path.
+ pub fn dir() -> Option {
+ dirs::config_dir().map(|p| p.join(CONFIG_DIR))
+ }
+
+ /// Get global config file path.
+ pub fn path() -> Option {
+ Self::dir().map(|p| p.join(CONFIG_FILE))
+ }
+
+ /// Get local project config path (.masterror.toml in current directory).
+ pub fn local_path() -> Option {
+ env::current_dir().ok().map(|p| p.join(LOCAL_CONFIG_FILE))
+ }
+
+ /// Check if this is the first run (no global config exists).
+ pub fn is_first_run() -> bool {
+ Self::path().is_none_or(|p| !p.exists())
+ }
+
+ /// Load config with layered priority:
+ /// 1. Local .masterror.toml (if exists)
+ /// 2. Global ~/.config/masterror/config.toml
+ /// 3. Defaults
+ pub fn load() -> Result {
+ // Try local config first
+ if let Some(local_path) = Self::local_path()
+ && local_path.exists()
+ {
+ let content = fs::read_to_string(&local_path)?;
+ let config: Config = toml::from_str(&content).map_err(|e| AppError::ConfigParse {
+ path: local_path.clone(),
+ message: e.message().to_string()
+ })?;
+ return Ok(config);
+ }
+
+ // Try global config
+ let Some(path) = Self::path() else {
+ return Ok(Self::default());
+ };
+
+ if !path.exists() {
+ return Ok(Self::default());
+ }
+
+ let content = fs::read_to_string(&path)?;
+ let config: Config = toml::from_str(&content).map_err(|e| AppError::ConfigParse {
+ path: path.clone(),
+ message: e.message().to_string()
+ })?;
+
+ Ok(config)
+ }
+
+ /// Save config to global file.
+ pub fn save(&self) -> Result<()> {
+ let Some(dir) = Self::dir() else {
+ return Err(AppError::Io(std::io::Error::other(
+ "could not determine config directory"
+ )));
+ };
+
+ fs::create_dir_all(&dir)?;
+
+ let path = dir.join(CONFIG_FILE);
+ let content = toml::to_string_pretty(self).map_err(|e| AppError::ConfigParse {
+ path: path.clone(),
+ message: e.to_string()
+ })?;
+
+ fs::write(&path, content)?;
+ Ok(())
+ }
+
+ /// Save config to local project file (.masterror.toml).
+ pub fn save_local(&self) -> Result {
+ let path = env::current_dir()?.join(LOCAL_CONFIG_FILE);
+ let content = toml::to_string_pretty(self).map_err(|e| AppError::ConfigParse {
+ path: path.clone(),
+ message: e.to_string()
+ })?;
+
+ fs::write(&path, &content)?;
+ Ok(path)
+ }
+
+ /// Resolve command alias.
+ #[allow(dead_code)]
+ pub fn resolve_alias<'a>(&'a self, cmd: &'a str) -> &'a str {
+ self.aliases.get(cmd).map(String::as_str).unwrap_or(cmd)
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_default_config() {
+ let config = Config::default();
+ assert_eq!(config.general.lang, "en");
+ assert!(config.general.colored);
+ assert!(config.display.why);
+ assert!(config.display.fix);
+ }
+
+ #[test]
+ fn test_toml_roundtrip() {
+ let config = Config::default();
+ let toml = toml::to_string_pretty(&config).unwrap();
+ let parsed: Config = toml::from_str(&toml).unwrap();
+ assert_eq!(parsed.general.lang, config.general.lang);
+ }
+}
diff --git a/masterror-cli/src/error.rs b/masterror-cli/src/error.rs
new file mode 100644
index 0000000..bfeb345
--- /dev/null
+++ b/masterror-cli/src/error.rs
@@ -0,0 +1,169 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Application error types for masterror-cli.
+
+use std::{fmt, io, path::PathBuf};
+
+/// Application-wide error type.
+#[derive(Debug)]
+pub enum AppError {
+ /// I/O error (file operations, process spawning).
+ Io(io::Error),
+ /// JSON parsing error from cargo output.
+ Json(serde_json::Error),
+ /// Cargo check process failed with exit code.
+ CargoFailed {
+ /// Exit code from cargo process.
+ code: i32
+ },
+ /// Cargo check process was terminated by signal.
+ CargoSignaled,
+ /// Unknown error code requested.
+ UnknownErrorCode {
+ /// The requested error code.
+ code: String
+ },
+ /// Unknown practice code requested.
+ UnknownPracticeCode {
+ /// The requested practice code.
+ code: String
+ },
+ /// Invalid category name.
+ InvalidCategory {
+ /// The invalid category name.
+ name: String
+ },
+ /// Invalid command-line argument.
+ InvalidArgument {
+ /// The invalid argument.
+ arg: String
+ },
+ /// Config file parse error.
+ ConfigParse {
+ /// Path to config file.
+ path: PathBuf,
+ /// Error message.
+ message: String
+ },
+ /// Error with additional context.
+ #[allow(dead_code)]
+ WithContext {
+ /// Context message.
+ context: String,
+ /// Original error.
+ source: Box
+ }
+}
+
+impl fmt::Display for AppError {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ Self::Io(e) => write!(f, "I/O error: {e}"),
+ Self::Json(e) => write!(f, "JSON parse error: {e}"),
+ Self::CargoFailed {
+ code
+ } => write!(f, "cargo check failed with exit code {code}"),
+ Self::CargoSignaled => write!(f, "cargo check was terminated by signal"),
+ Self::UnknownErrorCode {
+ code
+ } => write!(f, "unknown error code: {code}"),
+ Self::UnknownPracticeCode {
+ code
+ } => write!(f, "unknown practice code: {code}"),
+ Self::InvalidCategory {
+ name
+ } => write!(f, "invalid category: {name}"),
+ Self::InvalidArgument {
+ arg
+ } => write!(f, "invalid argument: {arg}"),
+ Self::ConfigParse {
+ path,
+ message
+ } => write!(f, "config error in {}: {message}", path.display()),
+ Self::WithContext {
+ context,
+ source
+ } => write!(f, "{context}: {source}")
+ }
+ }
+}
+
+impl std::error::Error for AppError {
+ fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
+ match self {
+ Self::Io(e) => Some(e),
+ Self::Json(e) => Some(e),
+ Self::WithContext {
+ source, ..
+ } => Some(source.as_ref()),
+ _ => None
+ }
+ }
+}
+
+impl From for AppError {
+ fn from(err: io::Error) -> Self {
+ Self::Io(err)
+ }
+}
+
+impl From for AppError {
+ fn from(err: serde_json::Error) -> Self {
+ Self::Json(err)
+ }
+}
+
+/// Result type alias for AppError.
+pub type Result = std::result::Result;
+
+/// Extension trait for adding context to Results.
+///
+/// # Example
+///
+/// ```ignore
+/// use masterror::error::ResultExt;
+///
+/// fs::read_to_string(path).context("reading config")?;
+/// ```
+#[allow(dead_code)]
+pub trait ResultExt {
+ /// Add static context to an error.
+ fn context(self, ctx: &'static str) -> Result;
+
+ /// Add dynamic context to an error.
+ fn with_context(self, f: F) -> Result
+ where
+ F: FnOnce() -> S,
+ S: Into;
+}
+
+impl ResultExt for std::result::Result
+where
+ E: Into
+{
+ fn context(self, ctx: &'static str) -> Result {
+ self.map_err(|e| {
+ let inner = e.into();
+ AppError::WithContext {
+ context: ctx.to_string(),
+ source: Box::new(inner)
+ }
+ })
+ }
+
+ fn with_context(self, f: F) -> Result
+ where
+ F: FnOnce() -> S,
+ S: Into
+ {
+ self.map_err(|e| {
+ let inner = e.into();
+ AppError::WithContext {
+ context: f().into(),
+ source: Box::new(inner)
+ }
+ })
+ }
+}
diff --git a/masterror-cli/src/main.rs b/masterror-cli/src/main.rs
new file mode 100644
index 0000000..47b006a
--- /dev/null
+++ b/masterror-cli/src/main.rs
@@ -0,0 +1,131 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! masterror CLI - Rust compiler error explainer.
+
+mod commands;
+mod config;
+mod error;
+mod options;
+mod output;
+mod parser;
+mod sections;
+
+use clap::{Parser, Subcommand};
+use masterror_knowledge::Lang;
+
+use crate::{config::Config, options::DisplayOptions};
+
+#[derive(Parser)]
+#[command(name = "masterror")]
+#[command(author, version, about = "Rust compiler error explainer")]
+struct Cli {
+ /// Language for explanations (en, ru, ko)
+ #[arg(short, long, env = "MASTERROR_LANG")]
+ lang: Option,
+
+ /// Disable colored output
+ #[arg(long, env = "NO_COLOR")]
+ no_color: bool,
+
+ #[command(subcommand)]
+ command: Commands
+}
+
+#[derive(Subcommand)]
+enum Commands {
+ /// Initialize configuration file
+ Init,
+ /// Run cargo check and explain errors
+ #[command(visible_alias = "c")]
+ Check {
+ #[arg(trailing_var_arg = true)]
+ args: Vec
+ },
+ /// Explain a specific error code (E0382) or best practice (RA001)
+ #[command(visible_alias = "e")]
+ Explain { code: String },
+ /// List all known error codes
+ #[command(visible_alias = "l")]
+ List {
+ #[arg(short, long)]
+ category: Option
+ },
+ /// Show RustManifest best practices
+ #[command(visible_alias = "p")]
+ Practice {
+ /// Practice code (RA001-RA015) or empty for list
+ code: Option,
+ /// Filter by category
+ #[arg(short, long)]
+ category: Option
+ }
+}
+
+fn main() {
+ let args: Vec = std::env::args().collect();
+ let cli = if args.get(1).is_some_and(|a| a == "masterror") {
+ Cli::parse_from(
+ args.into_iter()
+ .enumerate()
+ .filter_map(|(i, a)| if i == 1 { None } else { Some(a) })
+ )
+ } else {
+ Cli::parse()
+ };
+
+ // Check for first run and run setup if needed (except for init command)
+ if !matches!(cli.command, Commands::Init)
+ && let Err(e) = commands::init::check_first_run(true)
+ {
+ eprintln!("Setup failed: {e}");
+ std::process::exit(1);
+ }
+
+ let config = Config::load().unwrap_or_default();
+ let lang_str = cli.lang.as_deref().unwrap_or(&config.general.lang);
+ let lang = Lang::from_code(lang_str);
+ let colored = if cli.no_color {
+ false
+ } else {
+ config.general.colored
+ };
+
+ let opts = DisplayOptions {
+ colored,
+ show_translation: config.display.translation,
+ show_why: config.display.why,
+ show_fix: config.display.fix,
+ show_links: config.display.links,
+ show_original: config.display.original
+ };
+
+ let result = match &cli.command {
+ Commands::Init => commands::init(lang, opts.colored),
+ Commands::Check {
+ args
+ } => commands::check(lang, args, &opts),
+ Commands::Explain {
+ code
+ } => commands::explain(lang, code, &opts),
+ Commands::List {
+ category
+ } => commands::list(lang, category.as_deref(), &opts),
+ Commands::Practice {
+ code,
+ category
+ } => {
+ if let Some(c) = code {
+ commands::practice::show(lang, c, &opts)
+ } else {
+ commands::practice::list(lang, category.as_deref(), &opts)
+ }
+ }
+ };
+
+ if let Err(e) = result {
+ eprintln!("Error: {e}");
+ std::process::exit(1);
+ }
+}
diff --git a/masterror-cli/src/options.rs b/masterror-cli/src/options.rs
new file mode 100644
index 0000000..8256a87
--- /dev/null
+++ b/masterror-cli/src/options.rs
@@ -0,0 +1,138 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Display options for masterror output.
+
+/// What sections to show in masterror block.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub struct DisplayOptions {
+ /// Enable colored output.
+ pub colored: bool,
+ /// Show translated error message.
+ pub show_translation: bool,
+ /// Show "why this happens" explanation.
+ pub show_why: bool,
+ /// Show fix suggestions.
+ pub show_fix: bool,
+ /// Show documentation links.
+ pub show_links: bool,
+ /// Show original compiler output.
+ pub show_original: bool
+}
+
+impl DisplayOptions {
+ /// Default options as const value.
+ pub const DEFAULT: Self = Self {
+ colored: true,
+ show_translation: true,
+ show_why: true,
+ show_fix: true,
+ show_links: true,
+ show_original: false
+ };
+
+ /// Create new builder for constructing DisplayOptions.
+ #[allow(dead_code)]
+ pub const fn builder() -> DisplayOptionsBuilder {
+ DisplayOptionsBuilder::new()
+ }
+}
+
+impl Default for DisplayOptions {
+ fn default() -> Self {
+ Self::DEFAULT
+ }
+}
+
+/// Builder for constructing DisplayOptions with const support.
+///
+/// # Example
+///
+/// ```ignore
+/// use masterror_cli::options::DisplayOptions;
+///
+/// const OPTS: DisplayOptions = DisplayOptions::builder()
+/// .colored(false)
+/// .show_original(true)
+/// .build();
+/// ```
+#[derive(Clone, Copy, Debug)]
+#[allow(dead_code)]
+pub struct DisplayOptionsBuilder {
+ colored: bool,
+ show_translation: bool,
+ show_why: bool,
+ show_fix: bool,
+ show_links: bool,
+ show_original: bool
+}
+
+#[allow(dead_code)]
+impl DisplayOptionsBuilder {
+ /// Create new builder with default values.
+ pub const fn new() -> Self {
+ Self {
+ colored: true,
+ show_translation: true,
+ show_why: true,
+ show_fix: true,
+ show_links: true,
+ show_original: false
+ }
+ }
+
+ /// Set colored output.
+ pub const fn colored(mut self, value: bool) -> Self {
+ self.colored = value;
+ self
+ }
+
+ /// Set show translation.
+ pub const fn show_translation(mut self, value: bool) -> Self {
+ self.show_translation = value;
+ self
+ }
+
+ /// Set show why explanation.
+ pub const fn show_why(mut self, value: bool) -> Self {
+ self.show_why = value;
+ self
+ }
+
+ /// Set show fix suggestions.
+ pub const fn show_fix(mut self, value: bool) -> Self {
+ self.show_fix = value;
+ self
+ }
+
+ /// Set show documentation links.
+ pub const fn show_links(mut self, value: bool) -> Self {
+ self.show_links = value;
+ self
+ }
+
+ /// Set show original compiler output.
+ pub const fn show_original(mut self, value: bool) -> Self {
+ self.show_original = value;
+ self
+ }
+
+ /// Build the DisplayOptions.
+ pub const fn build(self) -> DisplayOptions {
+ DisplayOptions {
+ colored: self.colored,
+ show_translation: self.show_translation,
+ show_why: self.show_why,
+ show_fix: self.show_fix,
+ show_links: self.show_links,
+ show_original: self.show_original
+ }
+ }
+}
+
+impl Default for DisplayOptionsBuilder {
+ fn default() -> Self {
+ Self::new()
+ }
+}
diff --git a/masterror-cli/src/output.rs b/masterror-cli/src/output.rs
new file mode 100644
index 0000000..55f9c58
--- /dev/null
+++ b/masterror-cli/src/output.rs
@@ -0,0 +1,114 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Terminal output formatting for errors.
+
+use masterror_knowledge::{ErrorEntry, ErrorRegistry, Lang, UiMsg};
+use owo_colors::OwoColorize;
+
+use crate::{options::DisplayOptions, parser::CargoMessage, sections};
+
+// ─────────────────────────────────────────────────────────────────────────────
+// Colored output helpers
+// ─────────────────────────────────────────────────────────────────────────────
+
+/// Print text as bold title.
+pub fn print_title(text: &str, colored: bool) {
+ if colored {
+ println!("{}", text.bold());
+ } else {
+ println!("{text}");
+ }
+}
+
+/// Print category header (yellow bold).
+pub fn print_category_header(text: &str, colored: bool) {
+ if colored {
+ println!(" {}", text.yellow().bold());
+ } else {
+ println!(" {text}");
+ }
+}
+
+/// Print code with title (code in cyan).
+pub fn print_code_title(code: &str, title: &str, colored: bool) {
+ if colored {
+ println!(" {} - {title}", code.cyan());
+ } else {
+ println!(" {code} - {title}");
+ }
+}
+
+/// Print section label (green bold).
+pub fn print_label(label: &str, colored: bool) {
+ if colored {
+ println!("{}", label.green().bold());
+ } else {
+ println!("{label}");
+ }
+}
+
+/// Print dimmed text.
+pub fn print_dimmed(text: &str, colored: bool) {
+ if colored {
+ println!("{}", text.dimmed());
+ } else {
+ println!("{text}");
+ }
+}
+
+const SEPARATOR: &str = "--- masterror ----------------------------------------";
+const SEPARATOR_END: &str = "------------------------------------------------------";
+
+/// Print error with masterror explanation.
+pub fn print_error(lang: Lang, msg: &CargoMessage, opts: &DisplayOptions) {
+ let rendered = msg.rendered_output();
+
+ if opts.show_original
+ && let Some(r) = rendered
+ {
+ print!("{}", r.trim_end());
+ }
+
+ let Some(code) = msg.error_code() else {
+ if opts.show_original {
+ println!();
+ }
+ return;
+ };
+
+ let registry = ErrorRegistry::new();
+ let Some(entry) = registry.find(code) else {
+ if opts.show_original {
+ println!();
+ }
+ return;
+ };
+
+ println!();
+ print_block(lang, entry, rendered, opts);
+}
+
+fn print_block(lang: Lang, entry: &ErrorEntry, rendered: Option<&str>, opts: &DisplayOptions) {
+ print_dimmed(SEPARATOR, opts.colored);
+
+ if opts.show_translation {
+ sections::translation::print(lang, rendered, opts.colored);
+ }
+
+ if opts.show_why {
+ print_label(UiMsg::LabelWhy.get(lang), opts.colored);
+ println!("{}", entry.explanation.get(lang.code()));
+ }
+
+ if opts.show_fix {
+ sections::fix::print(lang, entry.fixes, opts.colored);
+ }
+
+ if opts.show_links {
+ sections::link::print(lang, entry.links, opts.colored);
+ }
+
+ print_dimmed(SEPARATOR_END, opts.colored);
+}
diff --git a/masterror-cli/src/parser.rs b/masterror-cli/src/parser.rs
new file mode 100644
index 0000000..6b25c8f
--- /dev/null
+++ b/masterror-cli/src/parser.rs
@@ -0,0 +1,62 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Cargo JSON output parser.
+
+use serde::Deserialize;
+
+/// Top-level cargo message.
+#[derive(Deserialize)]
+pub struct CargoMessage {
+ pub reason: String,
+ pub message: Option,
+ /// Full rendered compiler output.
+ pub rendered: Option
+}
+
+/// Compiler diagnostic message.
+#[derive(Deserialize)]
+pub struct DiagnosticMessage {
+ pub level: String,
+ #[allow(dead_code)]
+ pub message: String,
+ pub code: Option,
+ pub rendered: Option
+}
+
+/// Error code info.
+#[derive(Deserialize)]
+pub struct DiagnosticCode {
+ pub code: String
+}
+
+impl CargoMessage {
+ /// Check if this is a compiler error message.
+ pub fn is_error(&self) -> bool {
+ self.reason == "compiler-message"
+ && self.message.as_ref().is_some_and(|m| m.level == "error")
+ }
+
+ /// Get the error code if present.
+ pub fn error_code(&self) -> Option<&str> {
+ self.message
+ .as_ref()
+ .and_then(|m| m.code.as_ref())
+ .map(|c| c.code.as_str())
+ }
+
+ /// Get the error message.
+ #[allow(dead_code)]
+ pub fn error_message(&self) -> Option<&str> {
+ self.message.as_ref().map(|m| m.message.as_str())
+ }
+
+ /// Get rendered output (from message or top-level).
+ pub fn rendered_output(&self) -> Option<&str> {
+ self.message
+ .as_ref()
+ .and_then(|m| m.rendered.as_deref())
+ .or(self.rendered.as_deref())
+ }
+}
diff --git a/masterror-cli/src/sections.rs b/masterror-cli/src/sections.rs
new file mode 100644
index 0000000..82c32d3
--- /dev/null
+++ b/masterror-cli/src/sections.rs
@@ -0,0 +1,9 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Output sections for masterror block.
+
+pub mod fix;
+pub mod link;
+pub mod translation;
diff --git a/masterror-cli/src/sections/fix.rs b/masterror-cli/src/sections/fix.rs
new file mode 100644
index 0000000..113c62d
--- /dev/null
+++ b/masterror-cli/src/sections/fix.rs
@@ -0,0 +1,35 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Fix section - shows fix suggestions with code examples.
+
+use masterror_knowledge::{FixSuggestion, Lang, UiMsg};
+use owo_colors::OwoColorize;
+
+/// Print fix suggestions with code examples.
+pub fn print(lang: Lang, fixes: &[FixSuggestion], colored: bool) {
+ if fixes.is_empty() {
+ return;
+ }
+
+ let label = UiMsg::LabelFix.get(lang);
+
+ if colored {
+ println!("{}", label.green().bold());
+ } else {
+ println!("{label}");
+ }
+
+ for (i, fix) in fixes.iter().enumerate() {
+ let desc = fix.description.get(lang.code());
+ let num = i + 1;
+ if colored {
+ println!(" {}. {}", num.cyan(), desc);
+ println!(" {}", fix.code.dimmed());
+ } else {
+ println!(" {num}. {desc}");
+ println!(" {}", fix.code);
+ }
+ }
+}
diff --git a/masterror-cli/src/sections/link.rs b/masterror-cli/src/sections/link.rs
new file mode 100644
index 0000000..d8e8843
--- /dev/null
+++ b/masterror-cli/src/sections/link.rs
@@ -0,0 +1,31 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Link section - shows documentation URLs.
+
+use masterror_knowledge::{DocLink, Lang, UiMsg};
+use owo_colors::OwoColorize;
+
+/// Print documentation links with titles.
+pub fn print(lang: Lang, links: &[DocLink], colored: bool) {
+ if links.is_empty() {
+ return;
+ }
+
+ let label = UiMsg::LabelLink.get(lang);
+
+ if colored {
+ println!("{}", label.blue().bold());
+ } else {
+ println!("{label}");
+ }
+
+ for link in links {
+ if colored {
+ println!(" {} {}", link.title.cyan(), link.url.underline().dimmed());
+ } else {
+ println!(" {} {}", link.title, link.url);
+ }
+ }
+}
diff --git a/masterror-cli/src/sections/translation.rs b/masterror-cli/src/sections/translation.rs
new file mode 100644
index 0000000..c9a4758
--- /dev/null
+++ b/masterror-cli/src/sections/translation.rs
@@ -0,0 +1,33 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Translation section - shows full translated compiler error.
+
+use masterror_knowledge::{Lang, UiMsg, phrases::translate_rendered};
+use owo_colors::OwoColorize;
+
+/// Print full translated copy of compiler error.
+pub fn print(lang: Lang, rendered: Option<&str>, colored: bool) {
+ if matches!(lang, Lang::En) {
+ return;
+ }
+
+ let Some(rendered) = rendered else {
+ return;
+ };
+
+ let translated = translate_rendered(rendered, lang);
+
+ let label = UiMsg::LabelTranslation.get(lang);
+
+ if colored {
+ println!("{}", label.cyan().bold());
+ } else {
+ println!("{label}");
+ }
+
+ for line in translated.lines() {
+ println!(" {line}");
+ }
+}
diff --git a/masterror-derive/src/app_error_impl.rs b/masterror-derive/src/app_error_impl.rs
index c9a944c..b5f7b49 100644
--- a/masterror-derive/src/app_error_impl.rs
+++ b/masterror-derive/src/app_error_impl.rs
@@ -170,20 +170,26 @@ fn enum_app_code_impl(input: &ErrorInput, variants: &[VariantData]) -> TokenStre
}
}
-fn variant_app_error_pattern(enum_ident: &syn::Ident, variant: &VariantData) -> TokenStream {
+fn variant_pattern(
+ enum_ident: &syn::Ident,
+ variant: &VariantData,
+ with_binding: bool
+) -> TokenStream {
let ident = &variant.ident;
- match &variant.fields {
- Fields::Unit => quote! { err @ #enum_ident::#ident },
- Fields::Named(_) => quote! { err @ #enum_ident::#ident { .. } },
- Fields::Unnamed(_) => quote! { err @ #enum_ident::#ident(..) }
+ match (&variant.fields, with_binding) {
+ (Fields::Unit, true) => quote! { err @ #enum_ident::#ident },
+ (Fields::Unit, false) => quote! { #enum_ident::#ident },
+ (Fields::Named(_), true) => quote! { err @ #enum_ident::#ident { .. } },
+ (Fields::Named(_), false) => quote! { #enum_ident::#ident { .. } },
+ (Fields::Unnamed(_), true) => quote! { err @ #enum_ident::#ident(..) },
+ (Fields::Unnamed(_), false) => quote! { #enum_ident::#ident(..) }
}
}
+fn variant_app_error_pattern(enum_ident: &syn::Ident, variant: &VariantData) -> TokenStream {
+ variant_pattern(enum_ident, variant, true)
+}
+
fn variant_app_code_pattern(enum_ident: &syn::Ident, variant: &VariantData) -> TokenStream {
- let ident = &variant.ident;
- match &variant.fields {
- Fields::Unit => quote! { #enum_ident::#ident },
- Fields::Named(_) => quote! { #enum_ident::#ident { .. } },
- Fields::Unnamed(_) => quote! { #enum_ident::#ident(..) }
- }
+ variant_pattern(enum_ident, variant, false)
}
diff --git a/masterror-derive/src/input/parse_attr.rs b/masterror-derive/src/input/parse_attr.rs
index 6e2f53a..6fa9094 100644
--- a/masterror-derive/src/input/parse_attr.rs
+++ b/masterror-derive/src/input/parse_attr.rs
@@ -25,26 +25,28 @@ use super::{
};
use crate::template_support::parse_display_template;
-/// Extracts masterror specification from attributes.
-pub(crate) fn extract_masterror_spec(
+/// Generic attribute extraction with duplicate detection.
+fn extract_single_attr(
attrs: &[Attribute],
+ attr_name: &str,
+ parse_fn: impl Fn(&Attribute) -> syn::Result,
errors: &mut Vec
-) -> Result, ()> {
+) -> Result , ()> {
let mut spec = None;
let mut had_error = false;
for attr in attrs {
- if !path_is(attr, "masterror") {
+ if !path_is(attr, attr_name) {
continue;
}
if spec.is_some() {
errors.push(Error::new_spanned(
attr,
- "duplicate #[masterror(...)] attribute"
+ format!("duplicate #[{attr_name}(...)] attribute")
));
had_error = true;
continue;
}
- match parse_masterror_attribute(attr) {
+ match parse_fn(attr) {
Ok(parsed) => spec = Some(parsed),
Err(err) => {
errors.push(err);
@@ -55,34 +57,20 @@ pub(crate) fn extract_masterror_spec(
if had_error { Err(()) } else { Ok(spec) }
}
+/// Extracts masterror specification from attributes.
+pub(crate) fn extract_masterror_spec(
+ attrs: &[Attribute],
+ errors: &mut Vec
+) -> Result, ()> {
+ extract_single_attr(attrs, "masterror", parse_masterror_attribute, errors)
+}
+
/// Extracts app_error specification from attributes.
pub(crate) fn extract_app_error_spec(
attrs: &[Attribute],
errors: &mut Vec
) -> Result, ()> {
- let mut spec = None;
- let mut had_error = false;
- for attr in attrs {
- if !path_is(attr, "app_error") {
- continue;
- }
- if spec.is_some() {
- errors.push(Error::new_spanned(
- attr,
- "duplicate #[app_error(...)] attribute"
- ));
- had_error = true;
- continue;
- }
- match parse_app_error_attribute(attr) {
- Ok(parsed) => spec = Some(parsed),
- Err(err) => {
- errors.push(err);
- had_error = true;
- }
- }
- }
- if had_error { Err(()) } else { Ok(spec) }
+ extract_single_attr(attrs, "app_error", parse_app_error_attribute, errors)
}
/// Extracts display specification from error attributes.
diff --git a/masterror-knowledge/Cargo.toml b/masterror-knowledge/Cargo.toml
new file mode 100644
index 0000000..fce37d1
--- /dev/null
+++ b/masterror-knowledge/Cargo.toml
@@ -0,0 +1,25 @@
+# SPDX-FileCopyrightText: 2025-2026 RAprogramm
+#
+# SPDX-License-Identifier: MIT
+
+[package]
+name = "masterror-knowledge"
+version = "0.1.0"
+edition.workspace = true
+rust-version.workspace = true
+license.workspace = true
+repository.workspace = true
+description = "Knowledge base for Rust compiler errors and best practices"
+keywords = ["rust", "compiler", "errors", "explain", "learning"]
+categories = ["development-tools", "command-line-utilities"]
+
+[features]
+default = ["lang-ru", "lang-ko"]
+
+# Languages
+lang-ru = []
+lang-ko = []
+
+[dependencies]
+arrayvec = "0.7"
+aho-corasick = "1"
diff --git a/masterror-knowledge/README.md b/masterror-knowledge/README.md
new file mode 100644
index 0000000..bf83138
--- /dev/null
+++ b/masterror-knowledge/README.md
@@ -0,0 +1,88 @@
+
+
+
+
+
+
masterror-knowledge
+
Knowledge base for Rust compiler errors and best practices
+
+ [](https://crates.io/crates/masterror-knowledge)
+ [](https://docs.rs/masterror-knowledge)
+ 
+
+
+---
+
+## Overview
+
+`masterror-knowledge` provides a comprehensive knowledge base of Rust compiler error explanations and best practices. It powers the [masterror-cli](https://github.com/RAprogramm/masterror-cli) tool, enabling developers to quickly understand and fix compiler errors.
+
+## Features
+
+- **31+ Error Explanations** — Detailed explanations for common Rust compiler errors (E0001-E0792)
+- **15 RustManifest Best Practices** — Guidelines for writing idiomatic Rust code
+- **Multi-language Support** — Available in English, Russian, and Korean
+- **Zero Dependencies** — Lightweight, no runtime overhead
+- **Compile-time Lookup** — Fast pattern matching using Aho-Corasick algorithm
+
+## Supported Languages
+
+| Feature | Language |
+|---------|----------|
+| (default) | English |
+| `lang-ru` | Russian |
+| `lang-ko` | Korean |
+
+## Installation
+
+```toml
+[dependencies]
+masterror-knowledge = "0.1"
+```
+
+With additional languages:
+
+```toml
+[dependencies]
+masterror-knowledge = { version = "0.1", features = ["lang-ru", "lang-ko"] }
+```
+
+## Usage
+
+```rust
+use masterror_knowledge::{Lang, lookup_error, lookup_practice};
+
+// Get explanation for error E0382 (borrow of moved value)
+if let Some(explanation) = lookup_error("E0382", Lang::En) {
+ println!("{}", explanation);
+}
+
+// Get best practice by ID
+if let Some(practice) = lookup_practice("RM001", Lang::En) {
+ println!("{}", practice);
+}
+```
+
+## Error Codes Covered
+
+The knowledge base includes explanations for errors related to:
+
+- **Ownership & Borrowing** — E0382, E0499, E0502, E0505, E0507
+- **Lifetimes** — E0106, E0621, E0759, E0792
+- **Type System** — E0277, E0308, E0412, E0425
+- **Traits** — E0046, E0119, E0277
+- **Patterns** — E0004, E0005, E0026, E0027
+- **And more...**
+
+## Related
+
+- [masterror](https://github.com/RAprogramm/masterror) — Framework-agnostic application error types
+- [masterror-cli](https://github.com/RAprogramm/masterror-cli) — CLI tool using this knowledge base
+
+## License
+
+MIT
diff --git a/masterror-knowledge/src/errors.rs b/masterror-knowledge/src/errors.rs
new file mode 100644
index 0000000..1e1deed
--- /dev/null
+++ b/masterror-knowledge/src/errors.rs
@@ -0,0 +1,325 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Rust compiler error explanations organized by category.
+
+pub mod abi;
+pub mod attributes;
+pub mod borrowing;
+pub mod const_eval;
+pub mod consts;
+pub mod features;
+pub mod generics;
+pub mod lifetimes;
+pub mod linking;
+pub mod ownership;
+pub mod patterns;
+pub mod raprogramm;
+pub mod resolution;
+pub mod simd;
+pub mod structs;
+pub mod syntax;
+pub mod traits;
+pub mod types;
+pub mod unsafe_code;
+pub mod visibility;
+
+use std::{collections::HashMap, sync::LazyLock};
+
+use arrayvec::ArrayString;
+
+/// Global error registry singleton.
+static ERROR_REGISTRY: LazyLock = LazyLock::new(ErrorRegistry::build);
+
+/// Link with title for documentation.
+#[derive(Debug, Clone, Copy)]
+pub struct DocLink {
+ /// Link display title.
+ pub title: &'static str,
+ /// URL to documentation.
+ pub url: &'static str
+}
+
+/// Fix suggestion with code example.
+#[derive(Debug, Clone, Copy)]
+pub struct FixSuggestion {
+ /// Description of the fix approach.
+ pub description: LocalizedText,
+ /// Code example showing the fix.
+ pub code: &'static str
+}
+
+/// Localized text with translations.
+///
+/// All fields are `&'static str` for zero-copy access.
+#[derive(Debug, Clone, Copy)]
+pub struct LocalizedText {
+ /// English text (always present).
+ pub en: &'static str,
+ /// Russian translation.
+ pub ru: &'static str,
+ /// Korean translation.
+ pub ko: &'static str
+}
+
+impl LocalizedText {
+ pub const fn new(en: &'static str, ru: &'static str, ko: &'static str) -> Self {
+ Self {
+ en,
+ ru,
+ ko
+ }
+ }
+
+ pub fn get(&self, lang: &str) -> &'static str {
+ match lang {
+ "ru" => self.ru,
+ "ko" => self.ko,
+ _ => self.en
+ }
+ }
+}
+
+/// Error category.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
+pub enum Category {
+ Ownership,
+ Borrowing,
+ Lifetimes,
+ Types,
+ Traits,
+ Resolution,
+ Generics,
+ Syntax,
+ Patterns,
+ UnsafeCode,
+ Abi,
+ Structs,
+ Simd,
+ Consts,
+ Attributes,
+ ConstEval,
+ Linking,
+ Visibility
+}
+
+impl Category {
+ pub fn name(&self, lang: &str) -> &'static str {
+ match (self, lang) {
+ (Self::Ownership, "ru") => "Владение",
+ (Self::Ownership, "ko") => "소유권",
+ (Self::Ownership, _) => "Ownership",
+
+ (Self::Borrowing, "ru") => "Заимствование",
+ (Self::Borrowing, "ko") => "빌림",
+ (Self::Borrowing, _) => "Borrowing",
+
+ (Self::Lifetimes, "ru") => "Времена жизни",
+ (Self::Lifetimes, "ko") => "라이프타임",
+ (Self::Lifetimes, _) => "Lifetimes",
+
+ (Self::Types, "ru") => "Типы",
+ (Self::Types, "ko") => "타입",
+ (Self::Types, _) => "Types",
+
+ (Self::Traits, "ru") => "Трейты",
+ (Self::Traits, "ko") => "트레이트",
+ (Self::Traits, _) => "Traits",
+
+ (Self::Resolution, "ru") => "Разрешение имён",
+ (Self::Resolution, "ko") => "이름 확인",
+ (Self::Resolution, _) => "Name Resolution",
+
+ (Self::Generics, "ru") => "Обобщения",
+ (Self::Generics, "ko") => "제네릭",
+ (Self::Generics, _) => "Generics",
+
+ (Self::Syntax, "ru") => "Синтаксис",
+ (Self::Syntax, "ko") => "문법",
+ (Self::Syntax, _) => "Syntax",
+
+ (Self::Patterns, "ru") => "Паттерны",
+ (Self::Patterns, "ko") => "패턴",
+ (Self::Patterns, _) => "Patterns",
+
+ (Self::UnsafeCode, "ru") => "Небезопасный код",
+ (Self::UnsafeCode, "ko") => "unsafe 코드",
+ (Self::UnsafeCode, _) => "Unsafe Code",
+
+ (Self::Abi, "ru") => "ABI",
+ (Self::Abi, "ko") => "ABI",
+ (Self::Abi, _) => "ABI",
+
+ (Self::Structs, "ru") => "Структуры",
+ (Self::Structs, "ko") => "구조체",
+ (Self::Structs, _) => "Structs",
+
+ (Self::Simd, "ru") => "SIMD",
+ (Self::Simd, "ko") => "SIMD",
+ (Self::Simd, _) => "SIMD",
+
+ (Self::Consts, "ru") => "Константы",
+ (Self::Consts, "ko") => "상수",
+ (Self::Consts, _) => "Constants",
+
+ (Self::Attributes, "ru") => "Атрибуты",
+ (Self::Attributes, "ko") => "속성",
+ (Self::Attributes, _) => "Attributes",
+
+ (Self::ConstEval, "ru") => "Вычисление констант",
+ (Self::ConstEval, "ko") => "상수 평가",
+ (Self::ConstEval, _) => "Const Evaluation",
+
+ (Self::Linking, "ru") => "Связывание",
+ (Self::Linking, "ko") => "링킹",
+ (Self::Linking, _) => "Linking",
+
+ (Self::Visibility, "ru") => "Видимость",
+ (Self::Visibility, "ko") => "가시성",
+ (Self::Visibility, _) => "Visibility"
+ }
+ }
+}
+
+/// Complete error entry.
+///
+/// Fields ordered by size (largest first) to minimize padding.
+#[derive(Debug, Clone)]
+pub struct ErrorEntry {
+ /// Error explanation text.
+ pub explanation: LocalizedText,
+ /// Short error title.
+ pub title: LocalizedText,
+ /// Suggested fixes.
+ pub fixes: &'static [FixSuggestion],
+ /// Documentation links.
+ pub links: &'static [DocLink],
+ /// Error code (E0382).
+ pub code: &'static str,
+ /// Error category.
+ pub category: Category
+}
+
+/// Registry of all known errors.
+pub struct ErrorRegistry {
+ errors: HashMap<&'static str, &'static ErrorEntry>
+}
+
+impl ErrorRegistry {
+ /// Get the global registry instance.
+ pub fn new() -> &'static Self {
+ &ERROR_REGISTRY
+ }
+
+ /// Build registry from all modules.
+ fn build() -> Self {
+ let mut errors = HashMap::with_capacity(400);
+
+ for entry in abi::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in borrowing::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in consts::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in features::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in generics::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in lifetimes::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in ownership::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in patterns::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in resolution::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in simd::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in structs::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in syntax::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in traits::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in types::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in unsafe_code::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in attributes::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in const_eval::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in linking::entries() {
+ errors.insert(entry.code, *entry);
+ }
+ for entry in visibility::entries() {
+ errors.insert(entry.code, *entry);
+ }
+
+ Self {
+ errors
+ }
+ }
+
+ /// Find error by code.
+ ///
+ /// Accepts formats: "E0382", "e0382", "0382".
+ /// Uses stack-allocated buffer to avoid heap allocation.
+ pub fn find(&self, code: &str) -> Option<&'static ErrorEntry> {
+ // Fast path: try exact match first (covers "E0382" case)
+ if let Some(entry) = self.errors.get(code) {
+ return Some(*entry);
+ }
+
+ // Normalize to uppercase with 'E' prefix using stack buffer
+ let mut buf: ArrayString<8> = ArrayString::new();
+
+ if !code.starts_with('E') && !code.starts_with('e') {
+ buf.push('E');
+ }
+
+ for c in code.chars().take(7) {
+ buf.push(c.to_ascii_uppercase());
+ }
+
+ self.errors.get(buf.as_str()).copied()
+ }
+
+ /// Get all errors.
+ pub fn all(&self) -> impl Iterator- + '_ {
+ self.errors.values().copied()
+ }
+
+ /// Get errors by category.
+ pub fn by_category(&self, cat: Category) -> Vec<&'static ErrorEntry> {
+ self.errors
+ .values()
+ .filter(|e| e.category == cat)
+ .copied()
+ .collect()
+ }
+}
+
+impl Default for &'static ErrorRegistry {
+ fn default() -> Self {
+ ErrorRegistry::new()
+ }
+}
diff --git a/masterror-knowledge/src/errors/abi.rs b/masterror-knowledge/src/errors/abi.rs
new file mode 100644
index 0000000..17eca72
--- /dev/null
+++ b/masterror-knowledge/src/errors/abi.rs
@@ -0,0 +1,18 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! ABI and FFI related errors.
+
+mod e0044;
+mod e0045;
+mod e0060;
+mod e0130;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[&e0044::ENTRY, &e0045::ENTRY, &e0060::ENTRY, &e0130::ENTRY];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/abi/e0044.rs b/masterror-knowledge/src/errors/abi/e0044.rs
new file mode 100644
index 0000000..a221a09
--- /dev/null
+++ b/masterror-knowledge/src/errors/abi/e0044.rs
@@ -0,0 +1,50 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0044: foreign items cannot have type/const parameters
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0044",
+ title: LocalizedText::new(
+ "Foreign items cannot have type parameters",
+ "Внешние элементы не могут иметь параметры типа",
+ "외부 항목은 타입 매개변수를 가질 수 없음"
+ ),
+ category: Category::Abi,
+ explanation: LocalizedText::new(
+ "\
+Foreign items declared in `extern` blocks cannot have generic type or const
+parameters. Foreign functions (from C libraries) have concrete signatures.
+
+Example:
+ extern \"C\" {
+ fn some_func(x: T); // Error: generic not allowed
+ }",
+ "\
+Внешние элементы, объявленные в блоках `extern`, не могут иметь обобщённые
+параметры типа или константы. Внешние функции имеют конкретные сигнатуры.",
+ "\
+`extern` 블록에 선언된 외부 항목은 제네릭 타입이나 const 매개변수를 가질 수 없습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Create separate declarations for each type",
+ "Создать отдельные объявления для каждого типа",
+ "각 타입에 대해 별도의 선언 생성"
+ ),
+ code: "extern \"C\" {\n fn some_func_i32(x: i32);\n fn some_func_i64(x: i64);\n}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Reference: External blocks",
+ url: "https://doc.rust-lang.org/reference/items/external-blocks.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0044.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/abi/e0045.rs b/masterror-knowledge/src/errors/abi/e0045.rs
new file mode 100644
index 0000000..95d8005
--- /dev/null
+++ b/masterror-knowledge/src/errors/abi/e0045.rs
@@ -0,0 +1,45 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0045: variadic parameters on non-C ABI function
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0045",
+ title: LocalizedText::new(
+ "Variadic parameters on non-C ABI",
+ "Вариативные параметры с не-C ABI",
+ "비 C ABI에서 가변 매개변수"
+ ),
+ category: Category::Abi,
+ explanation: LocalizedText::new(
+ "\
+Variadic parameters (`...`) can only be used with functions using the C ABI.
+Rust only supports variadic parameters for FFI interoperability with C.
+
+Example:
+ extern \"Rust\" {
+ fn foo(x: u8, ...); // Error: variadic not allowed
+ }",
+ "\
+Вариативные параметры (`...`) можно использовать только с функциями,
+использующими C ABI. Rust поддерживает вариативные параметры только для
+взаимодействия с C через FFI.",
+ "\
+가변 매개변수(`...`)는 C ABI를 사용하는 함수에서만 사용할 수 있습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use extern \"C\" for variadic functions",
+ "Использовать extern \"C\" для вариативных функций",
+ "가변 함수에 extern \"C\" 사용"
+ ),
+ code: "extern \"C\" {\n fn foo(x: u8, ...);\n}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0045.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/abi/e0060.rs b/masterror-knowledge/src/errors/abi/e0060.rs
new file mode 100644
index 0000000..189b030
--- /dev/null
+++ b/masterror-knowledge/src/errors/abi/e0060.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0060: variadic function called with insufficient arguments
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0060",
+ title: LocalizedText::new(
+ "Variadic function called with insufficient arguments",
+ "Вариативная функция вызвана с недостаточным количеством аргументов",
+ "가변 함수가 불충분한 인수로 호출됨"
+ ),
+ category: Category::Abi,
+ explanation: LocalizedText::new(
+ "\
+Variadic external C functions still require their minimum fixed arguments.
+You cannot call a variadic function with fewer arguments than the non-variadic
+part requires.
+
+Example:
+ extern \"C\" {
+ fn printf(fmt: *const c_char, ...) -> c_int;
+ }
+ unsafe { printf(); } // Error: missing format string argument",
+ "\
+Вариативные внешние C функции по-прежнему требуют минимальные фиксированные
+аргументы. Нельзя вызвать вариативную функцию с меньшим количеством аргументов,
+чем требует невариативная часть.",
+ "\
+가변 외부 C 함수는 여전히 최소한의 고정 인수가 필요합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Provide required arguments",
+ "Предоставить обязательные аргументы",
+ "필수 인수 제공"
+ ),
+ code: "unsafe {\n printf(c\"test\\n\".as_ptr());\n printf(c\"%d\\n\".as_ptr(), 42);\n}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0060.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/abi/e0130.rs b/masterror-knowledge/src/errors/abi/e0130.rs
new file mode 100644
index 0000000..e42e8a6
--- /dev/null
+++ b/masterror-knowledge/src/errors/abi/e0130.rs
@@ -0,0 +1,59 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0130: patterns aren't allowed in foreign function declarations
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0130",
+ title: LocalizedText::new(
+ "Patterns aren't allowed in foreign function declarations",
+ "Паттерны не разрешены в объявлениях внешних функций",
+ "외부 함수 선언에서 패턴이 허용되지 않음"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+A pattern (like tuple destructuring) was used as an argument in a foreign
+function declaration. Foreign functions (declared with extern \"C\") must
+use simple identifiers with explicit type annotations rather than patterns.",
+ "\
+Паттерн (например, деструктуризация кортежа) был использован как аргумент
+в объявлении внешней функции. Внешние функции (объявленные с extern \"C\")
+должны использовать простые идентификаторы с явными аннотациями типов.",
+ "\
+외부 함수 선언에서 패턴(튜플 구조 분해 등)이 인수로 사용되었습니다.
+외부 함수(extern \"C\"로 선언)는 패턴 대신 명시적 타입 주석이 있는
+간단한 식별자를 사용해야 합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use a struct instead of tuple destructuring",
+ "Использовать структуру вместо деструктуризации кортежа",
+ "튜플 구조 분해 대신 구조체 사용"
+ ),
+ code: "struct SomeStruct {\n a: u32,\n b: u32,\n}\n\nextern \"C\" {\n fn foo(s: SomeStruct);\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use a simple identifier with the tuple type",
+ "Использовать простой идентификатор с типом кортежа",
+ "튜플 타입과 함께 간단한 식별자 사용"
+ ),
+ code: "extern \"C\" {\n fn foo(a: (u32, u32));\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: FFI",
+ url: "https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0130.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0706.rs b/masterror-knowledge/src/errors/async/e0706.rs
new file mode 100644
index 0000000..59109e5
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0706.rs
@@ -0,0 +1,59 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0706: async fn in trait (no longer emitted)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0706",
+ title: LocalizedText::new(
+ "Async fn not supported in traits",
+ "Async fn не поддерживается в трейтах",
+ "트레이트에서 async fn 지원되지 않음"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+Note: This error code is no longer emitted by the compiler.
+
+Previously, `async fn`s were not supported in traits because they return
+`impl Future`, which requires Generic Associated Types (GATs).
+
+Modern Rust now supports async functions in traits natively.",
+ "\
+Примечание: Эта ошибка больше не выдаётся компилятором.
+
+Ранее `async fn` не поддерживались в трейтах, так как они возвращают
+`impl Future`, что требовало GATs. Современный Rust поддерживает это.",
+ "\
+참고: 이 오류 코드는 더 이상 컴파일러에서 발생하지 않습니다.
+
+이전에는 `async fn`이 트레이트에서 지원되지 않았습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use native async trait (modern Rust)",
+ "Используйте встроенную поддержку async trait",
+ "네이티브 async 트레이트 사용"
+ ),
+ code: "trait MyTrait {\n async fn foo(&self);\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use async-trait crate (legacy)",
+ "Используйте крейт async-trait",
+ "async-trait 크레이트 사용"
+ ),
+ code: "#[async_trait]\ntrait MyTrait {\n async fn foo(&self);\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0706.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0708.rs b/masterror-knowledge/src/errors/async/e0708.rs
new file mode 100644
index 0000000..c50855d
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0708.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0708: async non-move closure with parameters (no longer emitted)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0708",
+ title: LocalizedText::new(
+ "Async non-move closure with parameters",
+ "Async замыкание без move с параметрами",
+ "매개변수가 있는 async non-move 클로저"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+Note: This error code is no longer emitted by the compiler.
+
+Previously, `async` closures with parameters required the `move` keyword.
+Modern Rust has relaxed this restriction.",
+ "\
+Примечание: Эта ошибка больше не выдаётся компилятором.
+
+Ранее `async` замыкания с параметрами требовали ключевое слово `move`.",
+ "\
+참고: 이 오류 코드는 더 이상 컴파일러에서 발생하지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Add move keyword (legacy fix)",
+ "Добавьте ключевое слово move",
+ "move 키워드 추가"
+ ),
+ code: "let add_one = async move |num: u8| {\n num + 1\n};"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0708.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0727.rs b/masterror-knowledge/src/errors/async/e0727.rs
new file mode 100644
index 0000000..e3d7682
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0727.rs
@@ -0,0 +1,48 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0727: `yield` used in async context
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0727",
+ title: LocalizedText::new(
+ "yield clause used in async context",
+ "yield используется в асинхронном контексте",
+ "async 컨텍스트에서 yield 사용됨"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+A `yield` clause was used in an `async` context. The `yield` keyword is used
+for coroutines/generators, but mixing it with async blocks is not supported.
+
+The async machinery handles its own suspension points via `.await`, and
+coroutine yields are a separate mechanism that cannot be mixed.",
+ "\
+Ключевое слово `yield` было использовано в `async` контексте.
+`yield` используется для корутин/генераторов, но смешивание с async блоками
+не поддерживается.",
+ "\
+`async` 컨텍스트에서 `yield` 절이 사용되었습니다. `yield` 키워드는
+코루틴/제너레이터용이며 async 블록과 혼합할 수 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Move yield outside async block",
+ "Переместите yield за пределы async блока",
+ "yield를 async 블록 밖으로 이동"
+ ),
+ code: "#[coroutine] || {\n yield;\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0727.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0728.rs b/masterror-knowledge/src/errors/async/e0728.rs
new file mode 100644
index 0000000..84dd171
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0728.rs
@@ -0,0 +1,58 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0728: await used outside async context
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0728",
+ title: LocalizedText::new(
+ "await used outside async context",
+ "await используется вне асинхронного контекста",
+ "async 컨텍스트 외부에서 await 사용"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+The `await` keyword was used outside of an `async` function or `async` block.
+
+The `await` keyword is used to suspend the current computation until the
+given future is ready to produce a value. It is only legal within an async
+context, such as an `async fn` or an `async` block.",
+ "\
+Ключевое слово `await` используется вне `async` функции или `async` блока.
+
+`await` приостанавливает текущее вычисление до готовности future.
+Оно допустимо только в async контексте.",
+ "\
+`await` 키워드가 `async` 함수나 `async` 블록 외부에서 사용되었습니다.
+
+`await`는 현재 계산을 일시 중지하며 async 컨텍스트 내에서만 유효합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use await inside async function",
+ "Используйте await внутри async функции",
+ "async 함수 내에서 await 사용"
+ ),
+ code: "async fn foo() {\n some_future().await;\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use await inside async block",
+ "Используйте await внутри async блока",
+ "async 블록 내에서 await 사용"
+ ),
+ code: "fn bar() -> impl Future {\n async {\n some_future().await\n }\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0728.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0733.rs b/masterror-knowledge/src/errors/async/e0733.rs
new file mode 100644
index 0000000..3705968
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0733.rs
@@ -0,0 +1,58 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0733: async recursion without boxing
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0733",
+ title: LocalizedText::new(
+ "Async recursion without boxing",
+ "Асинхронная рекурсия без упаковки",
+ "박싱 없는 async 재귀"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+An `async` function called itself recursively without boxing.
+
+When an async function calls itself recursively, the compiler cannot determine
+the size of the future at compile time, because each recursive call creates
+a new future. Without boxing, the compiler cannot allocate the necessary memory.",
+ "\
+Асинхронная функция вызывает себя рекурсивно без упаковки.
+
+Компилятор не может определить размер future во время компиляции,
+так как каждый рекурсивный вызов создаёт новый future.",
+ "\
+`async` 함수가 박싱 없이 자신을 재귀적으로 호출했습니다.
+
+컴파일러가 컴파일 시점에 future 크기를 결정할 수 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Box the recursive call",
+ "Упакуйте рекурсивный вызов",
+ "재귀 호출을 박싱"
+ ),
+ code: "async fn foo(n: usize) {\n if n > 0 {\n Box::pin(foo(n - 1)).await;\n }\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Return boxed future",
+ "Верните упакованный future",
+ "박싱된 future 반환"
+ ),
+ code: "fn foo(n: usize) -> Pin>> {\n Box::pin(async move {\n if n > 0 { foo(n - 1).await; }\n })\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0733.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0744.rs b/masterror-knowledge/src/errors/async/e0744.rs
new file mode 100644
index 0000000..94d6e2b
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0744.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0744: await in const context (no longer emitted)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0744",
+ title: LocalizedText::new(
+ "Await used in const context",
+ "Await используется в const контексте",
+ "const 컨텍스트에서 await 사용"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+Note: This error code is no longer emitted by the compiler.
+
+Previously, `.await` was forbidden inside a `const`, `static`, or `const fn`.
+This restriction may be lifted in future Rust versions.",
+ "\
+Примечание: Эта ошибка больше не выдаётся компилятором.
+
+Ранее `.await` был запрещён внутри `const`, `static` или `const fn`.",
+ "\
+참고: 이 오류 코드는 더 이상 컴파일러에서 발생하지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Move async code outside const context",
+ "Переместите async код за пределы const контекста",
+ "async 코드를 const 컨텍스트 밖으로 이동"
+ ),
+ code: "async fn compute() -> i32 {\n async { 0 }.await\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0744.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0752.rs b/masterror-knowledge/src/errors/async/e0752.rs
new file mode 100644
index 0000000..35fcdf1
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0752.rs
@@ -0,0 +1,57 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0752: async entry point not allowed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0752",
+ title: LocalizedText::new(
+ "Async entry point not allowed",
+ "Асинхронная точка входа не допускается",
+ "async 진입점 허용되지 않음"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+The entry point of the program was marked as `async`. The `fn main()` function
+or the specified start function is not allowed to be `async`.
+
+The program entry point must be synchronous. To use async code, you need an
+async runtime (like tokio or async-std) that will manage the async execution.",
+ "\
+Точка входа программы была помечена как `async`. Функция `fn main()`
+не может быть асинхронной.
+
+Для использования async кода нужен runtime (tokio, async-std).",
+ "\
+프로그램 진입점이 `async`로 표시되었습니다. `fn main()` 함수는
+`async`일 수 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove async from main",
+ "Удалите async из main",
+ "main에서 async 제거"
+ ),
+ code: "fn main() -> Result<(), ()> {\n Ok(())\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use async runtime macro",
+ "Используйте макрос async runtime",
+ "async 런타임 매크로 사용"
+ ),
+ code: "#[tokio::main]\nasync fn main() {\n // async code\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0752.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/async/e0760.rs b/masterror-knowledge/src/errors/async/e0760.rs
new file mode 100644
index 0000000..24dc87c
--- /dev/null
+++ b/masterror-knowledge/src/errors/async/e0760.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0760: async fn return type with Self referencing parent lifetime (no longer emitted)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0760",
+ title: LocalizedText::new(
+ "Async fn return type references parent lifetime via Self",
+ "Возвращаемый тип async fn ссылается на родительское время жизни через Self",
+ "async fn 반환 타입이 Self를 통해 부모 수명 참조"
+ ),
+ category: Category::Async,
+ explanation: LocalizedText::new(
+ "\
+Note: This error code is no longer emitted by the compiler.
+
+Previously, an `async fn` or `impl Trait` return type could not contain
+a projection or `Self` that references lifetimes from a parent scope.",
+ "\
+Примечание: Эта ошибка больше не выдаётся компилятором.
+
+Ранее возвращаемый тип `async fn` не мог содержать проекцию или `Self`,
+ссылающиеся на времена жизни из родительской области.",
+ "\
+참고: 이 오류 코드는 더 이상 컴파일러에서 발생하지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Spell out Self explicitly (legacy fix)",
+ "Явно укажите Self",
+ "Self를 명시적으로 작성"
+ ),
+ code: "impl<'a> S<'a> {\n async fn new(i: &'a i32) -> S<'a> {\n S(&22)\n }\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0760.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes.rs b/masterror-knowledge/src/errors/attributes.rs
new file mode 100644
index 0000000..9f00f8c
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes.rs
@@ -0,0 +1,69 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Attribute and linking related errors.
+
+mod e0452;
+mod e0453;
+mod e0454;
+mod e0455;
+mod e0457;
+mod e0458;
+mod e0459;
+mod e0466;
+mod e0468;
+mod e0469;
+mod e0517;
+mod e0518;
+mod e0522;
+mod e0536;
+mod e0537;
+mod e0538;
+mod e0539;
+mod e0541;
+mod e0552;
+mod e0554;
+mod e0556;
+mod e0557;
+mod e0565;
+mod e0566;
+mod e0587;
+mod e0588;
+mod e0589;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[
+ &e0452::ENTRY,
+ &e0453::ENTRY,
+ &e0454::ENTRY,
+ &e0455::ENTRY,
+ &e0457::ENTRY,
+ &e0458::ENTRY,
+ &e0459::ENTRY,
+ &e0466::ENTRY,
+ &e0468::ENTRY,
+ &e0469::ENTRY,
+ &e0517::ENTRY,
+ &e0518::ENTRY,
+ &e0522::ENTRY,
+ &e0536::ENTRY,
+ &e0537::ENTRY,
+ &e0538::ENTRY,
+ &e0539::ENTRY,
+ &e0541::ENTRY,
+ &e0552::ENTRY,
+ &e0554::ENTRY,
+ &e0556::ENTRY,
+ &e0557::ENTRY,
+ &e0565::ENTRY,
+ &e0566::ENTRY,
+ &e0587::ENTRY,
+ &e0588::ENTRY,
+ &e0589::ENTRY
+];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/attributes/e0452.rs b/masterror-knowledge/src/errors/attributes/e0452.rs
new file mode 100644
index 0000000..c00fc66
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0452.rs
@@ -0,0 +1,43 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0452: malformed lint attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0452",
+ title: LocalizedText::new(
+ "Malformed lint attribute",
+ "Неправильный атрибут линта",
+ "잘못된 형식의 린트 속성"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+An invalid lint attribute has been given. Lint attributes must follow a
+specific format and only accept a list of identifiers (lint names).
+Assignments or string values are not allowed.",
+ "\
+Задан недопустимый атрибут линта. Атрибуты линтов должны следовать
+определённому формату и принимают только список идентификаторов
+(имён линтов). Присваивания или строковые значения не допускаются.",
+ "\
+유효하지 않은 린트 속성이 제공되었습니다. 린트 속성은 특정 형식을
+따라야 하며 식별자(린트 이름) 목록만 허용합니다. 할당이나 문자열
+값은 허용되지 않습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use comma-separated lint identifiers",
+ "Использовать идентификаторы линтов через запятую",
+ "쉼표로 구분된 린트 식별자 사용"
+ ),
+ code: "#![allow(unused, dead_code)]"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0452.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0453.rs b/masterror-knowledge/src/errors/attributes/e0453.rs
new file mode 100644
index 0000000..18590f2
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0453.rs
@@ -0,0 +1,59 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0453: forbid overruled by allow
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0453",
+ title: LocalizedText::new(
+ "Lint forbid overruled by inner attribute",
+ "Запрет линта нарушен внутренним атрибутом",
+ "내부 속성에 의해 린트 금지가 무시됨"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+An attempt was made to override a forbid lint directive using an inner
+attribute like #[allow(...)]. The forbid lint setting is stricter than deny
+because it prevents itself from being overridden by any inner attributes.
+
+- forbid: turns warning into error AND prevents overriding
+- deny: turns warning into error BUT allows overriding",
+ "\
+Попытка переопределить директиву forbid с помощью внутреннего атрибута
+#[allow(...)]. Настройка forbid строже чем deny, так как она запрещает
+переопределение внутренними атрибутами.
+
+- forbid: превращает предупреждение в ошибку И запрещает переопределение
+- deny: превращает предупреждение в ошибку НО позволяет переопределение",
+ "\
+#[allow(...)]와 같은 내부 속성을 사용하여 forbid 린트 지시문을
+재정의하려고 시도했습니다. forbid 린트 설정은 내부 속성에 의한
+재정의를 방지하므로 deny보다 엄격합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Replace forbid with deny to allow overriding",
+ "Заменить forbid на deny для разрешения переопределения",
+ "재정의를 허용하려면 forbid를 deny로 교체"
+ ),
+ code: "#![deny(non_snake_case)]\n\n#[allow(non_snake_case)]\nfn main() {\n let MyNumber = 2; // ok!\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Fix the code to comply with the lint",
+ "Исправить код для соответствия линту",
+ "린트에 맞게 코드 수정"
+ ),
+ code: "#![forbid(non_snake_case)]\n\nfn main() {\n let my_number = 2;\n}"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0453.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0454.rs b/masterror-knowledge/src/errors/attributes/e0454.rs
new file mode 100644
index 0000000..4d5535c
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0454.rs
@@ -0,0 +1,42 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0454: link with empty name
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0454",
+ title: LocalizedText::new(
+ "Link name given with empty name",
+ "Имя ссылки указано как пустая строка",
+ "링크 이름이 빈 문자열로 제공됨"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A link name was specified with an empty string. The Rust compiler requires
+an actual library name to link to external C libraries. An empty name string
+provides no valid target for the linker.",
+ "\
+Имя ссылки указано как пустая строка. Компилятор Rust требует реальное
+имя библиотеки для связывания с внешними C библиотеками. Пустая строка
+не предоставляет допустимую цель для компоновщика.",
+ "\
+링크 이름이 빈 문자열로 지정되었습니다. Rust 컴파일러는 외부 C
+라이브러리에 연결하기 위해 실제 라이브러리 이름이 필요합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Provide a valid library name",
+ "Указать допустимое имя библиотеки",
+ "유효한 라이브러리 이름 제공"
+ ),
+ code: "#[link(name = \"some_lib\")] extern \"C\" {}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0454.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0455.rs b/masterror-knowledge/src/errors/attributes/e0455.rs
new file mode 100644
index 0000000..9a17206
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0455.rs
@@ -0,0 +1,53 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0455: platform-specific link kind
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0455",
+ title: LocalizedText::new(
+ "Platform-specific link kind not supported on this target",
+ "Специфичный для платформы тип ссылки не поддерживается",
+ "이 타겟에서 플랫폼별 링크 종류가 지원되지 않음"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+Some linking kinds are target-specific and not supported on all platforms:
+- kind=framework: only supported on macOS
+- kind=raw-dylib: only supported on Windows-like platforms
+
+Using these on unsupported platforms will cause this error.",
+ "\
+Некоторые типы связывания специфичны для платформы:
+- kind=framework: поддерживается только на macOS
+- kind=raw-dylib: поддерживается только на Windows-подобных платформах
+
+Использование их на неподдерживаемых платформах вызовет эту ошибку.",
+ "\
+일부 링크 종류는 플랫폼별로 특정됩니다:
+- kind=framework: macOS에서만 지원
+- kind=raw-dylib: Windows 유사 플랫폼에서만 지원"
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use conditional compilation",
+ "Использовать условную компиляцию",
+ "조건부 컴파일 사용"
+ ),
+ code: "#[cfg_attr(target_os = \"macos\", link(name = \"CoreServices\", kind = \"framework\"))]\nextern \"C\" {}"
+ }],
+ links: &[
+ DocLink {
+ title: "Conditional Compilation",
+ url: "https://doc.rust-lang.org/reference/attributes.html#conditional-compilation"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0455.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0457.rs b/masterror-knowledge/src/errors/attributes/e0457.rs
new file mode 100644
index 0000000..7350b6d
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0457.rs
@@ -0,0 +1,48 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0457: plugin only in rlib format
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0457",
+ title: LocalizedText::new(
+ "Plugin only found in rlib format, dylib required",
+ "Плагин найден только в формате rlib, требуется dylib",
+ "플러그인이 rlib 형식으로만 발견됨, dylib 필요"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A plugin crate was compiled to the statically-linked rlib format instead
+of the required dynamically-linked dylib format. The Rust compiler's plugin
+interface requires plugins to be compiled as dynamically-linked libraries.
+
+Note: This error is no longer emitted by modern compilers as the plugin
+system has been deprecated in favor of procedural macros.",
+ "\
+Крейт плагина скомпилирован в статически связываемый формат rlib вместо
+требуемого динамически связываемого формата dylib. Интерфейс плагинов
+компилятора Rust требует компиляции плагинов как динамических библиотек.
+
+Примечание: эта ошибка больше не выдаётся, так как система плагинов
+устарела в пользу процедурных макросов.",
+ "\
+플러그인 크레이트가 필요한 동적 링크 dylib 형식 대신 정적 링크
+rlib 형식으로 컴파일되었습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Compile the plugin as dylib",
+ "Скомпилировать плагин как dylib",
+ "플러그인을 dylib로 컴파일"
+ ),
+ code: "# In Cargo.toml:\n[lib]\ncrate-type = [\"dylib\"]"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0457.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0458.rs b/masterror-knowledge/src/errors/attributes/e0458.rs
new file mode 100644
index 0000000..a2c835c
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0458.rs
@@ -0,0 +1,44 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0458: unknown link kind
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0458",
+ title: LocalizedText::new(
+ "Unknown link kind in link attribute",
+ "Неизвестный тип ссылки в атрибуте link",
+ "link 속성의 알 수 없는 링크 종류"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+An invalid kind value was specified in a #[link] attribute. The kind
+parameter only accepts specific valid values for linking strategies.
+
+Note: This error is no longer emitted by modern compilers.",
+ "\
+Недопустимое значение kind указано в атрибуте #[link]. Параметр kind
+принимает только определённые допустимые значения для стратегий связывания.
+
+Примечание: эта ошибка больше не выдаётся современными компиляторами.",
+ "\
+#[link] 속성에 유효하지 않은 kind 값이 지정되었습니다. kind
+매개변수는 링크 전략에 대한 특정 유효한 값만 허용합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use a valid link kind",
+ "Использовать допустимый тип ссылки",
+ "유효한 링크 종류 사용"
+ ),
+ code: "// Valid kinds: static, dylib, framework (macOS), raw-dylib (Windows)\n#[link(kind = \"static\", name = \"foo\")] extern \"C\" {}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0458.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0459.rs b/masterror-knowledge/src/errors/attributes/e0459.rs
new file mode 100644
index 0000000..2ba6a08
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0459.rs
@@ -0,0 +1,43 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0459: link without name parameter
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0459",
+ title: LocalizedText::new(
+ "Link specified without name parameter",
+ "Ссылка указана без параметра name",
+ "name 매개변수 없이 link가 지정됨"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+The #[link(...)] attribute was used in an extern block without specifying
+the required name parameter. The Rust compiler needs the name parameter
+to know which library to link against.",
+ "\
+Атрибут #[link(...)] использован в блоке extern без указания
+обязательного параметра name. Компилятору Rust нужен параметр name,
+чтобы знать, с какой библиотекой связываться.",
+ "\
+extern 블록에서 필수 name 매개변수를 지정하지 않고 #[link(...)]
+속성이 사용되었습니다. Rust 컴파일러는 어떤 라이브러리에 연결할지
+알기 위해 name 매개변수가 필요합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Add the name parameter",
+ "Добавить параметр name",
+ "name 매개변수 추가"
+ ),
+ code: "#[link(kind = \"dylib\", name = \"some_lib\")] extern \"C\" {}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0459.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0466.rs b/masterror-knowledge/src/errors/attributes/e0466.rs
new file mode 100644
index 0000000..46881b0
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0466.rs
@@ -0,0 +1,57 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0466: malformed macro_use declaration
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0466",
+ title: LocalizedText::new(
+ "Malformed macro import declaration",
+ "Неправильное объявление импорта макросов",
+ "잘못된 형식의 매크로 임포트 선언"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+The syntax used in a #[macro_use] attribute declaration is incorrect.
+The attribute expects a comma-separated list of macro names inside
+parentheses, not function calls or key-value assignments.
+
+Note: This error is no longer emitted by modern compilers.",
+ "\
+Синтаксис в объявлении атрибута #[macro_use] неверен. Атрибут ожидает
+список имён макросов через запятую в скобках, а не вызовы функций
+или присваивания ключ-значение.
+
+Примечание: эта ошибка больше не выдаётся современными компиляторами.",
+ "\
+#[macro_use] 속성 선언에 사용된 구문이 올바르지 않습니다. 속성은
+괄호 안에 쉼표로 구분된 매크로 이름 목록을 기대하며, 함수 호출이나
+키-값 할당은 허용되지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use comma-separated macro names",
+ "Использовать имена макросов через запятую",
+ "쉼표로 구분된 매크로 이름 사용"
+ ),
+ code: "#[macro_use(macro1, macro2)]\nextern crate some_crate;"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Import all macros from crate",
+ "Импортировать все макросы из крейта",
+ "크레이트에서 모든 매크로 임포트"
+ ),
+ code: "#[macro_use]\nextern crate some_crate;"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0466.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0468.rs b/masterror-knowledge/src/errors/attributes/e0468.rs
new file mode 100644
index 0000000..694a562
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0468.rs
@@ -0,0 +1,43 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0468: macro import from non-root module
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0468",
+ title: LocalizedText::new(
+ "Non-root module tried to import macros from another crate",
+ "Нерневой модуль попытался импортировать макросы из другого крейта",
+ "비루트 모듈이 다른 크레이트에서 매크로를 임포트하려고 시도함"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+An attempt was made to use #[macro_use] with extern crate in a non-root
+module. The Rust compiler only allows macro imports from external crates
+when the extern crate declaration is at the crate root level.",
+ "\
+Попытка использовать #[macro_use] с extern crate в некорневом модуле.
+Компилятор Rust разрешает импорт макросов из внешних крейтов только
+когда объявление extern crate находится на корневом уровне крейта.",
+ "\
+비루트 모듈에서 extern crate와 함께 #[macro_use]를 사용하려고
+시도했습니다. Rust 컴파일러는 extern crate 선언이 크레이트 루트
+수준에 있을 때만 외부 크레이트에서 매크로 임포트를 허용합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Move macro import to crate root",
+ "Переместить импорт макросов в корень крейта",
+ "매크로 임포트를 크레이트 루트로 이동"
+ ),
+ code: "// In lib.rs or main.rs:\n#[macro_use]\nextern crate some_crate;\n\nmod foo {\n fn run_macro() { some_macro!(); }\n}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0468.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0469.rs b/masterror-knowledge/src/errors/attributes/e0469.rs
new file mode 100644
index 0000000..6665b99
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0469.rs
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0469: imported macro not found
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0469",
+ title: LocalizedText::new(
+ "Imported macro not found in crate",
+ "Импортируемый макрос не найден в крейте",
+ "임포트된 매크로가 크레이트에서 찾을 수 없음"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A macro listed for import via #[macro_use(macro_name)] cannot be found
+in the imported crate. The macro must:
+1. Exist in the crate
+2. Be exported with the #[macro_export] attribute
+3. Be spelled correctly",
+ "\
+Макрос, указанный для импорта через #[macro_use(macro_name)], не найден
+в импортируемом крейте. Макрос должен:
+1. Существовать в крейте
+2. Быть экспортирован с атрибутом #[macro_export]
+3. Быть написан правильно",
+ "\
+#[macro_use(macro_name)]를 통해 임포트하려는 매크로를 임포트된
+크레이트에서 찾을 수 없습니다. 매크로는:
+1. 크레이트에 존재해야 함
+2. #[macro_export] 속성으로 익스포트되어야 함
+3. 올바르게 철자되어야 함"
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Verify macro is exported in the crate",
+ "Проверить, что макрос экспортирован в крейте",
+ "매크로가 크레이트에서 익스포트되었는지 확인"
+ ),
+ code: "// In some_crate:\n#[macro_export]\nmacro_rules! my_macro { ... }\n\n// In your crate:\n#[macro_use(my_macro)]\nextern crate some_crate;"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0469.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0517.rs b/masterror-knowledge/src/errors/attributes/e0517.rs
new file mode 100644
index 0000000..8bf46df
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0517.rs
@@ -0,0 +1,66 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0517: repr attribute on unsupported item
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0517",
+ title: LocalizedText::new(
+ "`#[repr(..)]` attribute on unsupported item",
+ "Атрибут `#[repr(..)]` на неподдерживаемом элементе",
+ "지원되지 않는 항목에 `#[repr(..)]` 속성"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+The `#[repr(..)]` attribute was placed on an unsupported item. Each
+representation attribute only works with specific item types:
+
+- `#[repr(C)]`: Only structs and enums
+- `#[repr(packed)]` and `#[repr(simd)]`: Only structs
+- `#[repr(u8)]`, `#[repr(i16)]`, etc.: Only field-less enums
+
+These attributes cannot be applied to type aliases or impl blocks.",
+ "\
+Атрибут `#[repr(..)]` был помещён на неподдерживаемый элемент. Каждый
+атрибут представления работает только с определёнными типами элементов:
+
+- `#[repr(C)]`: Только структуры и перечисления
+- `#[repr(packed)]` и `#[repr(simd)]`: Только структуры
+- `#[repr(u8)]`, `#[repr(i16)]` и т.д.: Только перечисления без полей",
+ "\
+`#[repr(..)]` 속성이 지원되지 않는 항목에 배치되었습니다. 각 표현 속성은
+특정 항목 타입에서만 작동합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Apply repr(C) to struct or enum",
+ "Применить repr(C) к структуре или перечислению",
+ "repr(C)를 구조체 또는 열거형에 적용"
+ ),
+ code: "#[repr(C)]\nstruct Foo { bar: bool }"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Apply repr(u8) to field-less enum",
+ "Применить repr(u8) к перечислению без полей",
+ "repr(u8)를 필드 없는 열거형에 적용"
+ ),
+ code: "#[repr(u8)]\nenum Color { Red, Green, Blue }"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Alternative Representations",
+ url: "https://doc.rust-lang.org/nomicon/other-reprs.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0517.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0518.rs b/masterror-knowledge/src/errors/attributes/e0518.rs
new file mode 100644
index 0000000..f658c6a
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0518.rs
@@ -0,0 +1,56 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0518: inline attribute incorrectly placed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0518",
+ title: LocalizedText::new(
+ "`#[inline(..)]` attribute incorrectly placed",
+ "Атрибут `#[inline(..)]` неправильно размещён",
+ "`#[inline(..)]` 속성이 잘못 배치됨"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An `#[inline(..)]` attribute was incorrectly placed on something other than a
+function or method. The `#[inline]` attribute can only be applied to functions
+and methods.
+
+It supports the following forms:
+- `#[inline]` - hint to inline
+- `#[inline(always)]` - force inlining
+- `#[inline(never)]` - prevent inlining
+
+Note: This error code is no longer emitted by the compiler.",
+ "\
+Атрибут `#[inline(..)]` был неправильно размещён на чём-то, кроме функции
+или метода. Атрибут `#[inline]` можно применять только к функциям и методам.
+
+Примечание: этот код ошибки больше не выдаётся компилятором.",
+ "\
+`#[inline(..)]` 속성이 함수나 메서드가 아닌 다른 것에 잘못 배치되었습니다.
+`#[inline]` 속성은 함수와 메서드에만 적용할 수 있습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Apply inline to individual methods",
+ "Применить inline к отдельным методам",
+ "개별 메서드에 inline 적용"
+ ),
+ code: "impl Foo {\n #[inline(always)]\n fn method1() { }\n \n #[inline(never)]\n fn method2() { }\n}"
+ }],
+ links: &[
+ DocLink {
+ title: "Inline Attribute",
+ url: "https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0518.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0522.rs b/masterror-knowledge/src/errors/attributes/e0522.rs
new file mode 100644
index 0000000..0fe14cc
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0522.rs
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0522: lang attribute used in invalid context
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0522",
+ title: LocalizedText::new(
+ "Unknown or invalid lang item",
+ "Неизвестный или недопустимый lang элемент",
+ "알 수 없거나 잘못된 lang 항목"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+The `#[lang]` attribute was used in an invalid context. This attribute is
+intended exclusively for marking special items that are built-in to Rust,
+including:
+
+- Special traits that affect compiler behavior (e.g., `Copy`, `Sized`)
+- Special functions that may be automatically invoked (e.g., panic handlers)
+
+Using the `#[lang]` attribute with unknown or invalid lang items will result
+in this error.",
+ "\
+Атрибут `#[lang]` был использован в недопустимом контексте. Этот атрибут
+предназначен исключительно для пометки специальных элементов, встроенных
+в Rust, включая:
+
+- Специальные трейты, влияющие на поведение компилятора
+- Специальные функции, которые могут автоматически вызываться",
+ "\
+`#[lang]` 속성이 잘못된 컨텍스트에서 사용되었습니다. 이 속성은 Rust에
+내장된 특수 항목을 표시하기 위해서만 사용됩니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Only use valid compiler-recognized lang items",
+ "Использовать только допустимые lang элементы",
+ "유효한 컴파일러 인식 lang 항목만 사용"
+ ),
+ code: "// Don't use #[lang] with custom names\n// This is for internal compiler use only"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0522.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0536.rs b/masterror-knowledge/src/errors/attributes/e0536.rs
new file mode 100644
index 0000000..9a955dd
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0536.rs
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0536: malformed not cfg-predicate
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0536",
+ title: LocalizedText::new(
+ "The `not` cfg-predicate was malformed",
+ "cfg-предикат `not` был неправильно сформирован",
+ "`not` cfg 술어가 잘못 형성됨"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+The `not` cfg-predicate was malformed. The `not` predicate is used in
+conditional compilation attributes and must be properly formatted. It expects
+exactly one cfg-pattern as its argument.
+
+The `not()` cannot be empty - it requires a cfg-pattern argument.",
+ "\
+cfg-предикат `not` был неправильно сформирован. Предикат `not` используется
+в атрибутах условной компиляции и должен быть правильно отформатирован.
+Он ожидает ровно один cfg-шаблон в качестве аргумента.",
+ "\
+`not` cfg 술어가 잘못 형성되었습니다. `not` 술어는 조건부 컴파일 속성에서
+사용되며 올바르게 형식화되어야 합니다. 인수로 정확히 하나의 cfg 패턴이
+필요합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Provide a cfg-pattern inside not()",
+ "Указать cfg-шаблон внутри not()",
+ "not() 내부에 cfg 패턴 제공"
+ ),
+ code: "#[cfg(not(target_os = \"linux\"))]\npub fn main() { }"
+ }],
+ links: &[
+ DocLink {
+ title: "Conditional Compilation",
+ url: "https://doc.rust-lang.org/reference/conditional-compilation.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0536.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0537.rs b/masterror-knowledge/src/errors/attributes/e0537.rs
new file mode 100644
index 0000000..53f9c49
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0537.rs
@@ -0,0 +1,56 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0537: unknown predicate in cfg attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0537",
+ title: LocalizedText::new(
+ "Unknown predicate in `cfg` attribute",
+ "Неизвестный предикат в атрибуте `cfg`",
+ "`cfg` 속성에 알 수 없는 술어"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An unknown predicate was used inside the `cfg` attribute. The `cfg` attribute
+only supports three specific predicate types:
+- `any`
+- `all`
+- `not`
+
+Using any other predicate name will result in an error.",
+ "\
+Неизвестный предикат был использован внутри атрибута `cfg`. Атрибут `cfg`
+поддерживает только три типа предикатов:
+- `any`
+- `all`
+- `not`
+
+Использование любого другого имени предиката приведёт к ошибке.",
+ "\
+`cfg` 속성 내부에서 알 수 없는 술어가 사용되었습니다. `cfg` 속성은
+세 가지 특정 술어 타입만 지원합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use valid cfg predicates: any, all, not",
+ "Использовать допустимые cfg предикаты: any, all, not",
+ "유효한 cfg 술어 사용: any, all, not"
+ ),
+ code: "#[cfg(not(target_os = \"linux\"))]\npub fn something() {}"
+ }],
+ links: &[
+ DocLink {
+ title: "Conditional Compilation",
+ url: "https://doc.rust-lang.org/reference/conditional-compilation.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0537.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0538.rs b/masterror-knowledge/src/errors/attributes/e0538.rs
new file mode 100644
index 0000000..1eb4e5b
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0538.rs
@@ -0,0 +1,45 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0538: duplicate meta item in attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0538",
+ title: LocalizedText::new(
+ "Duplicate meta item in attribute",
+ "Дублирующийся мета-элемент в атрибуте",
+ "속성에 중복된 메타 항목"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An attribute contains the same meta item more than once. Meta items are the
+key-value pairs inside of an attribute, and each key may only be used once
+in each attribute.
+
+If you specify the same meta item key multiple times, the compiler will raise
+this error.",
+ "\
+Атрибут содержит один и тот же мета-элемент более одного раза. Мета-элементы -
+это пары ключ-значение внутри атрибута, и каждый ключ может использоваться
+только один раз в каждом атрибуте.",
+ "\
+속성에 동일한 메타 항목이 두 번 이상 포함되어 있습니다. 메타 항목은
+속성 내부의 키-값 쌍이며, 각 키는 각 속성에서 한 번만 사용할 수 있습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Remove duplicate meta items",
+ "Удалить дублирующиеся мета-элементы",
+ "중복된 메타 항목 제거"
+ ),
+ code: "#[deprecated(\n since=\"1.0.0\",\n note=\"First note only.\"\n)]\nfn deprecated_function() {}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0538.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0539.rs b/masterror-knowledge/src/errors/attributes/e0539.rs
new file mode 100644
index 0000000..82750f2
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0539.rs
@@ -0,0 +1,61 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0539: invalid meta-item in attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0539",
+ title: LocalizedText::new(
+ "Invalid meta-item in attribute",
+ "Недопустимый мета-элемент в атрибуте",
+ "속성에 잘못된 메타 항목"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An invalid meta-item was used inside an attribute. This can happen when:
+
+1. Using `name = value` when a list is expected (e.g., `#[repr = \"C\"]`)
+2. Using a list instead of `name = value` (e.g., `note(\"reason\")`)
+3. Missing required values (e.g., `issue` without a value)
+4. Providing unrecognized identifiers where specific keywords are required
+
+Review the attribute's documentation to ensure correct syntax.",
+ "\
+Недопустимый мета-элемент был использован внутри атрибута. Это может
+произойти, когда:
+
+1. Используется `name = value` вместо списка
+2. Используется список вместо `name = value`
+3. Отсутствуют обязательные значения
+4. Предоставлены нераспознанные идентификаторы",
+ "\
+속성 내부에서 잘못된 메타 항목이 사용되었습니다. 다음과 같은 경우에
+발생할 수 있습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use correct syntax for repr attribute",
+ "Использовать правильный синтаксис для атрибута repr",
+ "repr 속성에 올바른 구문 사용"
+ ),
+ code: "#[repr(C)] // not #[repr = \"C\"]\nstruct Foo {}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use name = value for deprecated note",
+ "Использовать name = value для note в deprecated",
+ "deprecated note에 name = value 사용"
+ ),
+ code: "#[deprecated(since = \"1.0.0\", note = \"reason\")]\nfn foo() {}"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0539.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0541.rs b/masterror-knowledge/src/errors/attributes/e0541.rs
new file mode 100644
index 0000000..9e11994
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0541.rs
@@ -0,0 +1,44 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0541: unknown meta item in attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0541",
+ title: LocalizedText::new(
+ "Unknown meta item in attribute",
+ "Неизвестный мета-элемент в атрибуте",
+ "속성에 알 수 없는 메타 항목"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An unknown meta item was used in an attribute. Meta items are the key-value
+pairs inside of attributes, and the keys provided must be one of the valid
+keys for the specified attribute.
+
+Either remove the unknown meta item, or rename it to a correct one.",
+ "\
+Неизвестный мета-элемент был использован в атрибуте. Мета-элементы - это
+пары ключ-значение внутри атрибутов, и предоставленные ключи должны быть
+одним из допустимых ключей для указанного атрибута.",
+ "\
+속성에서 알 수 없는 메타 항목이 사용되었습니다. 메타 항목은 속성 내부의
+키-값 쌍이며, 제공된 키는 지정된 속성에 대한 유효한 키 중 하나여야 합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use correct meta item key (e.g., `note` not `reason`)",
+ "Использовать правильный ключ (например, `note` вместо `reason`)",
+ "올바른 메타 항목 키 사용 (예: `reason`이 아닌 `note`)"
+ ),
+ code: "#[deprecated(\n since=\"1.0.0\",\n note=\"explanation\" // not 'reason'\n)]\nfn deprecated_function() {}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0541.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0552.rs b/masterror-knowledge/src/errors/attributes/e0552.rs
new file mode 100644
index 0000000..c26af87
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0552.rs
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0552: unrecognized representation hint
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0552",
+ title: LocalizedText::new(
+ "Unrecognized representation hint",
+ "Нераспознанный атрибут представления",
+ "인식할 수 없는 표현 힌트"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An unrecognized representation attribute was used. The `#[repr(...)]`
+attribute is used to specify how the compiler should lay out a struct or enum
+in memory. Only certain values are recognized.
+
+The `repr` attribute supports options like `C`, `transparent`, `packed`,
+`align(N)`, and integer types like `u8`, `i32`, etc.",
+ "\
+Был использован нераспознанный атрибут представления. Атрибут `#[repr(...)]`
+используется для указания, как компилятор должен размещать структуру или
+перечисление в памяти. Распознаются только определённые значения.",
+ "\
+인식할 수 없는 표현 속성이 사용되었습니다. `#[repr(...)]` 속성은 컴파일러가
+구조체나 열거형을 메모리에 어떻게 배치해야 하는지 지정하는 데 사용됩니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use a valid repr option",
+ "Использовать допустимую опцию repr",
+ "유효한 repr 옵션 사용"
+ ),
+ code: "#[repr(C)] // valid options: C, transparent, packed, align(N)\nstruct MyStruct {\n my_field: usize\n}"
+ }],
+ links: &[
+ DocLink {
+ title: "Alternative Representations",
+ url: "https://doc.rust-lang.org/nomicon/other-reprs.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0552.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0554.rs b/masterror-knowledge/src/errors/attributes/e0554.rs
new file mode 100644
index 0000000..3ed7885
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0554.rs
@@ -0,0 +1,64 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0554: feature attributes require nightly
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0554",
+ title: LocalizedText::new(
+ "Feature attributes require nightly compiler",
+ "Атрибуты feature требуют nightly компилятор",
+ "기능 속성은 나이틀리 컴파일러 필요"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+Feature attributes (using `#![feature(...)]`) can only be used when compiling
+with the Rust nightly compiler. Stable or beta compilers will reject code
+containing feature attributes, as they are experimental features that may
+change or be removed in future releases.
+
+This error enforces Rust's stability guarantee by preventing unstable features
+from being used in code compiled with stable or beta toolchains.",
+ "\
+Атрибуты feature (с использованием `#![feature(...)]`) могут использоваться
+только при компиляции с nightly компилятором Rust. Стабильные или бета
+компиляторы отклонят код с атрибутами feature, так как это экспериментальные
+функции, которые могут измениться или быть удалены.",
+ "\
+기능 속성(`#![feature(...)]` 사용)은 Rust 나이틀리 컴파일러로 컴파일할 때만
+사용할 수 있습니다. 안정 또는 베타 컴파일러는 기능 속성이 포함된 코드를
+거부합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Switch to nightly Rust to use unstable features",
+ "Переключиться на nightly Rust для использования нестабильных функций",
+ "불안정 기능을 사용하려면 나이틀리 Rust로 전환"
+ ),
+ code: "// Run: rustup default nightly\n// Or: rustup run nightly cargo build"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove the feature attribute for stable Rust",
+ "Удалить атрибут feature для стабильного Rust",
+ "안정 Rust를 위해 기능 속성 제거"
+ ),
+ code: "// Remove: #![feature(lang_items)]\n// Use stable alternatives instead"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Nightly Rust",
+ url: "https://doc.rust-lang.org/book/appendix-07-nightly-rust.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0554.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0556.rs b/masterror-knowledge/src/errors/attributes/e0556.rs
new file mode 100644
index 0000000..2d56ee5
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0556.rs
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0556: malformed feature attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0556",
+ title: LocalizedText::new(
+ "The `feature` attribute was malformed",
+ "Атрибут `feature` был неправильно сформирован",
+ "`feature` 속성이 잘못 형성됨"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+The `feature` attribute must be properly formatted. It only accepts feature
+flag identifiers and can only be used on nightly Rust.
+
+Invalid syntax includes:
+- Parenthesized expressions: `foo(bar)`
+- Assignment syntax: `foo = \"baz\"`
+- Duplicate flags
+- Empty attribute: `#![feature]`
+- String assignment: `#![feature = \"foo\"]`",
+ "\
+Атрибут `feature` должен быть правильно отформатирован. Он принимает только
+идентификаторы флагов функций и может использоваться только в nightly Rust.
+
+Недопустимый синтаксис включает:
+- Выражения в скобках: `foo(bar)`
+- Синтаксис присваивания: `foo = \"baz\"`
+- Дублирующиеся флаги",
+ "\
+`feature` 속성은 올바르게 형식화되어야 합니다. 기능 플래그 식별자만 허용하며
+나이틀리 Rust에서만 사용할 수 있습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use correct feature attribute syntax",
+ "Использовать правильный синтаксис атрибута feature",
+ "올바른 feature 속성 구문 사용"
+ ),
+ code: "#![feature(flag)]\n#![feature(flag1, flag2)] // multiple flags"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0556.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0557.rs b/masterror-knowledge/src/errors/attributes/e0557.rs
new file mode 100644
index 0000000..8c3a408
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0557.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0557: feature has been removed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0557",
+ title: LocalizedText::new(
+ "Feature has been removed",
+ "Функция была удалена",
+ "기능이 제거됨"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+A feature attribute named a feature that has been removed from Rust. Feature
+gates are unstable Rust features that may be removed in future versions.
+
+When a feature is removed, any code using `#![feature(...)]` with that feature
+name will fail to compile.",
+ "\
+Атрибут feature указал функцию, которая была удалена из Rust. Feature gates -
+это нестабильные функции Rust, которые могут быть удалены в будущих версиях.
+
+Когда функция удаляется, любой код, использующий `#![feature(...)]` с этим
+именем функции, не скомпилируется.",
+ "\
+기능 속성이 Rust에서 제거된 기능을 명명했습니다. 기능 게이트는 향후 버전에서
+제거될 수 있는 불안정한 Rust 기능입니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Remove the obsolete feature attribute",
+ "Удалить устаревший атрибут feature",
+ "사용되지 않는 기능 속성 제거"
+ ),
+ code: "// Remove: #![feature(managed_boxes)]\n// This feature no longer exists"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0557.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0565.rs b/masterror-knowledge/src/errors/attributes/e0565.rs
new file mode 100644
index 0000000..d55d5f8
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0565.rs
@@ -0,0 +1,45 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0565: literal used in attribute that doesn't support literals
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0565",
+ title: LocalizedText::new(
+ "Literal used in attribute that doesn't support literals",
+ "Литерал использован в атрибуте, не поддерживающем литералы",
+ "리터럴을 지원하지 않는 속성에서 리터럴 사용"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+A literal was used in a built-in attribute that doesn't support literals.
+Not all attributes support literals in their input - some specifically require
+identifiers.
+
+For example, `#[repr(\"C\")]` is incorrect because `repr` expects an
+identifier, not a string literal.",
+ "\
+Литерал был использован во встроенном атрибуте, который не поддерживает
+литералы. Не все атрибуты поддерживают литералы во входных данных - некоторые
+требуют именно идентификаторы.",
+ "\
+리터럴을 지원하지 않는 내장 속성에서 리터럴이 사용되었습니다. 모든 속성이
+입력에서 리터럴을 지원하는 것은 아니며, 일부는 특별히 식별자를 요구합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use an identifier instead of a string literal",
+ "Использовать идентификатор вместо строкового литерала",
+ "문자열 리터럴 대신 식별자 사용"
+ ),
+ code: "#[repr(C)] // not #[repr(\"C\")]\nstruct Repr {}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0565.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0566.rs b/masterror-knowledge/src/errors/attributes/e0566.rs
new file mode 100644
index 0000000..79c0113
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0566.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0566: conflicting representation hints
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0566",
+ title: LocalizedText::new(
+ "Conflicting representation hints",
+ "Конфликтующие атрибуты представления",
+ "충돌하는 표현 힌트"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+Conflicting representation hints have been used on the same item. In most
+cases, only one representation hint is needed.
+
+For example, `#[repr(u32, u64)]` is invalid because you cannot specify
+multiple conflicting integer representation hints on the same enum.",
+ "\
+Конфликтующие атрибуты представления были использованы для одного элемента.
+В большинстве случаев нужен только один атрибут представления.
+
+Например, `#[repr(u32, u64)]` недопустим, поскольку нельзя указать
+несколько конфликтующих целочисленных представлений для одного перечисления.",
+ "\
+동일한 항목에 충돌하는 표현 힌트가 사용되었습니다. 대부분의 경우
+하나의 표현 힌트만 필요합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use cfg_attr for conditional repr",
+ "Использовать cfg_attr для условного repr",
+ "조건부 repr를 위해 cfg_attr 사용"
+ ),
+ code: "#[cfg_attr(linux, repr(u32))]\n#[cfg_attr(not(linux), repr(u64))]\nenum Repr { A }"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0566.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0587.rs b/masterror-knowledge/src/errors/attributes/e0587.rs
new file mode 100644
index 0000000..2574711
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0587.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0587: packed and align on same type
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0587",
+ title: LocalizedText::new(
+ "Cannot use both `packed` and `align` on same type",
+ "Нельзя использовать `packed` и `align` для одного типа",
+ "같은 타입에 `packed`와 `align`을 모두 사용할 수 없음"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+A type has both `packed` and `align` representation hints. You cannot use both
+on the same type because they provide conflicting layout specifications.
+
+`packed` removes padding between fields to minimize size, while `align`
+specifies a minimum alignment requirement.",
+ "\
+Тип имеет оба атрибута представления `packed` и `align`. Нельзя использовать
+оба для одного типа, поскольку они задают конфликтующие спецификации
+размещения.
+
+`packed` удаляет отступы между полями, а `align` указывает минимальное
+требование выравнивания.",
+ "\
+타입에 `packed`와 `align` 표현 힌트가 모두 있습니다. 이들은 충돌하는
+레이아웃 사양을 제공하므로 같은 타입에 둘 다 사용할 수 없습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use packed(N) to specify both packing and size",
+ "Использовать packed(N) для указания упаковки и размера",
+ "패킹과 크기를 지정하려면 packed(N) 사용"
+ ),
+ code: "#[repr(packed(8))] // not #[repr(packed, align(8))]\nstruct Umbrella(i32);"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0587.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0588.rs b/masterror-knowledge/src/errors/attributes/e0588.rs
new file mode 100644
index 0000000..3d84d45
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0588.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0588: packed type contains aligned field
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0588",
+ title: LocalizedText::new(
+ "Packed type contains a field with align repr",
+ "Упакованный тип содержит поле с атрибутом align",
+ "패킹된 타입에 align repr이 있는 필드 포함"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+A type with `packed` representation hint has a field with the `align`
+representation hint. These are incompatible when nested in this direction.
+
+However, the reverse is allowed: an `align` type can contain a `packed` type.",
+ "\
+Тип с атрибутом представления `packed` содержит поле с атрибутом `align`.
+Эти атрибуты несовместимы при таком вложении.
+
+Однако обратное допустимо: тип с `align` может содержать тип с `packed`.",
+ "\
+`packed` 표현 힌트가 있는 타입에 `align` 표현 힌트가 있는 필드가 있습니다.
+이 방향의 중첩에서는 호환되지 않습니다.
+
+그러나 반대는 허용됩니다: `align` 타입은 `packed` 타입을 포함할 수 있습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Reverse the nesting: align can contain packed",
+ "Изменить вложение: align может содержать packed",
+ "중첩 반전: align이 packed를 포함할 수 있음"
+ ),
+ code: "#[repr(packed)]\nstruct Packed(i32);\n\n#[repr(align(16))] // align can wrap packed\nstruct Aligned(Packed);"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0588.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0589.rs b/masterror-knowledge/src/errors/attributes/e0589.rs
new file mode 100644
index 0000000..a9d10ef
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0589.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0589: invalid repr(align) attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0589",
+ title: LocalizedText::new(
+ "Invalid `repr(align)`: not a power of two",
+ "Недопустимый `repr(align)`: не степень двойки",
+ "잘못된 `repr(align)`: 2의 거듭제곱이 아님"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+The value of N specified for `repr(align(N))` must be a power of two and
+cannot exceed 2^29. If you provide a value that doesn't meet these
+requirements, the compiler will raise this error.
+
+Valid alignment values are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc.",
+ "\
+Значение N, указанное для `repr(align(N))`, должно быть степенью двойки
+и не может превышать 2^29. Если вы укажете значение, не соответствующее
+этим требованиям, компилятор выдаст эту ошибку.
+
+Допустимые значения выравнивания: 1, 2, 4, 8, 16, 32, 64, 128, 256 и т.д.",
+ "\
+`repr(align(N))`에 지정된 N 값은 2의 거듭제곱이어야 하며 2^29를 초과할 수
+없습니다. 이러한 요구 사항을 충족하지 않는 값을 제공하면 컴파일러가
+이 오류를 발생시킵니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use a power of two for alignment",
+ "Использовать степень двойки для выравнивания",
+ "정렬에 2의 거듭제곱 사용"
+ ),
+ code: "#[repr(align(16))] // not align(15)\nenum Foo { Bar(u64) }"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0589.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0701.rs b/masterror-knowledge/src/errors/attributes/e0701.rs
new file mode 100644
index 0000000..adf0d5f
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0701.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0701: #[non_exhaustive] misplaced (no longer emitted)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0701",
+ title: LocalizedText::new(
+ "Non-exhaustive attribute misplaced",
+ "Атрибут non_exhaustive в неправильном месте",
+ "non_exhaustive 속성 잘못된 위치"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+Note: This error code is no longer emitted by the compiler.
+
+Previously, the `#[non_exhaustive]` attribute was incorrectly placed on
+something other than a struct or enum. This attribute can only be applied
+to structs and enums.",
+ "\
+Примечание: Эта ошибка больше не выдаётся компилятором.
+
+Атрибут `#[non_exhaustive]` может применяться только к структурам и enum.",
+ "\
+참고: 이 오류 코드는 더 이상 컴파일러에서 발생하지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Apply to struct or enum only",
+ "Применяйте только к struct или enum",
+ "struct 또는 enum에만 적용"
+ ),
+ code: "#[non_exhaustive]\nstruct Config {\n field: u32,\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0701.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0710.rs b/masterror-knowledge/src/errors/attributes/e0710.rs
new file mode 100644
index 0000000..7df5952
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0710.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0710: unknown tool name in scoped lint
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0710",
+ title: LocalizedText::new(
+ "Unknown tool name in scoped lint",
+ "Неизвестное имя инструмента в lint",
+ "스코프 lint에서 알 수 없는 도구 이름"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+An unknown tool name was found in a scoped lint attribute.
+
+This typically happens when you misspell a linter tool name (such as `clippy`)
+or forget to import it in your project.",
+ "\
+В атрибуте lint найдено неизвестное имя инструмента.
+
+Обычно это происходит при опечатке в имени линтера (например, `clippy`).",
+ "\
+스코프 lint 속성에서 알 수 없는 도구 이름이 발견되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Fix the tool name spelling",
+ "Исправьте написание имени инструмента",
+ "도구 이름 철자 수정"
+ ),
+ code: "#[allow(clippy::filter_map)] // correct spelling"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0710.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0714.rs b/masterror-knowledge/src/errors/attributes/e0714.rs
new file mode 100644
index 0000000..0cb96ec
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0714.rs
@@ -0,0 +1,50 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0714: marker trait with associated items
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0714",
+ title: LocalizedText::new(
+ "Marker trait with associated items",
+ "Маркерный трейт с ассоциированными элементами",
+ "연관 항목이 있는 마커 트레이트"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A `#[marker]` trait contained an associated item.
+
+Marker traits cannot have associated items like constants, because the items
+of marker traits cannot be overridden, making them unnecessary when they
+cannot be changed per-type anyway.",
+ "\
+Маркерный трейт `#[marker]` содержит ассоциированный элемент.
+
+Маркерные трейты не могут иметь ассоциированных элементов, так как
+их нельзя переопределить.",
+ "\
+`#[marker]` 트레이트에 연관 항목이 포함되었습니다.
+
+마커 트레이트는 연관 항목을 가질 수 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use extension trait for associated items",
+ "Используйте расширяющий трейт для элементов",
+ "연관 항목에 확장 트레이트 사용"
+ ),
+ code: "#[marker]\ntrait Marker {}\n\ntrait MarkerExt: Marker {\n const N: usize;\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0714.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0715.rs b/masterror-knowledge/src/errors/attributes/e0715.rs
new file mode 100644
index 0000000..f438150
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0715.rs
@@ -0,0 +1,48 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0715: marker trait impl overrides associated item
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0715",
+ title: LocalizedText::new(
+ "Marker trait impl overrides item",
+ "Реализация маркерного трейта переопределяет элемент",
+ "마커 트레이트 impl이 항목 재정의"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+An `impl` for a `#[marker]` trait tried to override an associated item.
+
+Marker traits are allowed to have multiple implementations for the same type,
+so it is not permitted to override anything in those implementations, as it
+would be ambiguous which override should actually be used.",
+ "\
+Реализация `#[marker]` трейта пытается переопределить ассоциированный элемент.
+
+Маркерные трейты могут иметь несколько реализаций для одного типа,
+поэтому переопределение запрещено из-за неоднозначности.",
+ "\
+`#[marker]` 트레이트의 `impl`이 연관 항목을 재정의하려 했습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove override from impl",
+ "Удалите переопределение из impl",
+ "impl에서 재정의 제거"
+ ),
+ code: "#[marker]\ntrait Marker {\n const N: usize = 0;\n}\n\nimpl Marker for MyType {} // no override"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0715.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0722.rs b/masterror-knowledge/src/errors/attributes/e0722.rs
new file mode 100644
index 0000000..849ca76
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0722.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0722: malformed optimize attribute (no longer emitted)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0722",
+ title: LocalizedText::new(
+ "Malformed optimize attribute",
+ "Неправильный атрибут optimize",
+ "잘못된 optimize 속성"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+Note: This error code is no longer emitted by the compiler (now E0539).
+
+The `#[optimize]` attribute was malformed. Valid arguments are:
+- `#[optimize(size)]` - generate smaller code
+- `#[optimize(speed)]` - generate faster code",
+ "\
+Примечание: Эта ошибка больше не выдаётся (теперь E0539).
+
+Атрибут `#[optimize]` был неправильно сформирован.",
+ "\
+참고: 이 오류 코드는 더 이상 발생하지 않습니다 (현재 E0539)."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use valid optimize argument",
+ "Используйте допустимый аргумент optimize",
+ "유효한 optimize 인수 사용"
+ ),
+ code: "#[optimize(size)]\npub fn small_fn() {}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "RFC 2412",
+ url: "https://rust-lang.github.io/rfcs/2412-optimize-attr.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0725.rs b/masterror-knowledge/src/errors/attributes/e0725.rs
new file mode 100644
index 0000000..525e0fc
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0725.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0725: feature not in allowed list
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0725",
+ title: LocalizedText::new(
+ "Feature not in allowed list",
+ "Функция не в списке разрешённых",
+ "허용 목록에 없는 기능"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A feature attribute named a feature that was disallowed in the compiler
+command line flags via `-Z allow_features`.
+
+The specified feature is not in the allowed features list.",
+ "\
+Атрибут feature указывает функцию, запрещённую флагами командной строки
+компилятора через `-Z allow_features`.",
+ "\
+기능 속성이 `-Z allow_features`를 통해 컴파일러 명령줄 플래그에서
+허용되지 않은 기능을 지정했습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove disallowed feature or add to allow list",
+ "Удалите запрещённую функцию или добавьте в список",
+ "허용되지 않은 기능 제거 또는 목록에 추가"
+ ),
+ code: "// Remove: #![feature(disallowed_feature)]\n// Or add to -Z allow_features"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0725.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0734.rs b/masterror-knowledge/src/errors/attributes/e0734.rs
new file mode 100644
index 0000000..e8902eb
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0734.rs
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0734: stability attribute outside stdlib
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0734",
+ title: LocalizedText::new(
+ "Stability attribute outside standard library",
+ "Атрибут стабильности вне стандартной библиотеки",
+ "표준 라이브러리 외부의 안정성 속성"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A stability attribute (`#[stable]` or `#[unstable]`) has been used outside
+of the standard library.
+
+These attributes are meant to only be used by the standard library and are
+rejected in your own crates.",
+ "\
+Атрибут стабильности (`#[stable]` или `#[unstable]`) использован
+вне стандартной библиотеки.
+
+Эти атрибуты предназначены только для стандартной библиотеки.",
+ "\
+안정성 속성(`#[stable]` 또는 `#[unstable]`)이 표준 라이브러리
+외부에서 사용되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove stability attributes",
+ "Удалите атрибуты стабильности",
+ "안정성 속성 제거"
+ ),
+ code: "// Instead of:\n// #[stable(feature = \"a\", since = \"1.0\")]\nfn foo() {}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0734.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0736.rs b/masterror-knowledge/src/errors/attributes/e0736.rs
new file mode 100644
index 0000000..c115781
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0736.rs
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0736: naked function incompatible attributes
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0736",
+ title: LocalizedText::new(
+ "Naked function with incompatible attribute",
+ "Naked функция с несовместимым атрибутом",
+ "호환되지 않는 속성이 있는 naked 함수"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+Functions marked with `#[naked]` are restricted in what other attributes
+they may be marked with. Incompatible attributes include:
+- `#[inline]`
+- `#[track_caller]`
+- `#[test]`, `#[ignore]`, `#[should_panic]`
+
+These incompatibilities exist because naked functions deliberately impose
+strict restrictions on the code that the compiler produces.",
+ "\
+Функции с `#[naked]` имеют ограничения на другие атрибуты.
+Несовместимы: `#[inline]`, `#[track_caller]`, `#[test]`.",
+ "\
+`#[naked]`로 표시된 함수는 다른 속성에 제한이 있습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove incompatible attributes",
+ "Удалите несовместимые атрибуты",
+ "호환되지 않는 속성 제거"
+ ),
+ code: "#[unsafe(naked)]\npub extern \"C\" fn foo() {\n // naked_asm!(...)\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0736.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0774.rs b/masterror-knowledge/src/errors/attributes/e0774.rs
new file mode 100644
index 0000000..583f909
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0774.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0774: derive on invalid target
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0774",
+ title: LocalizedText::new(
+ "Derive applied to invalid target",
+ "Derive применён к неподходящему элементу",
+ "잘못된 대상에 derive 적용"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+The `derive` attribute was applied on something which is not a struct, union,
+or enum. The `derive` attribute is only allowed on these three item types.",
+ "\
+Атрибут `derive` применён к элементу, который не является структурой,
+объединением или перечислением. `derive` допустим только для них.",
+ "\
+`derive` 속성이 struct, union, enum이 아닌 것에 적용되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Apply derive to struct, enum, or union",
+ "Применяйте derive к struct, enum или union",
+ "struct, enum, union에 derive 적용"
+ ),
+ code: "#[derive(Clone)]\nstruct Bar {\n field: u32,\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Derivable Traits",
+ url: "https://doc.rust-lang.org/book/appendix-03-derivable-traits.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0774.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0777.rs b/masterror-knowledge/src/errors/attributes/e0777.rs
new file mode 100644
index 0000000..4de7350
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0777.rs
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0777: literal in derive
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0777",
+ title: LocalizedText::new(
+ "Literal value in derive",
+ "Литеральное значение в derive",
+ "derive에 리터럴 값"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A literal value (like a string) was used inside `#[derive]` instead of a
+path to a trait.
+
+The `#[derive]` attribute only accepts trait paths as arguments, not string
+literals or other literal values.",
+ "\
+В `#[derive]` использовано литеральное значение (например, строка)
+вместо пути к трейту.
+
+`#[derive]` принимает только пути к трейтам.",
+ "\
+`#[derive]`에 트레이트 경로 대신 리터럴 값이 사용되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove quotes from trait name",
+ "Удалите кавычки из имени трейта",
+ "트레이트 이름에서 따옴표 제거"
+ ),
+ code: "#[derive(Clone)] // not \"Clone\"\nstruct Foo;"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Derivable Traits",
+ url: "https://doc.rust-lang.org/book/appendix-03-derivable-traits.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0777.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0778.rs b/masterror-knowledge/src/errors/attributes/e0778.rs
new file mode 100644
index 0000000..edca93e
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0778.rs
@@ -0,0 +1,44 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0778: malformed instruction_set attribute
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0778",
+ title: LocalizedText::new(
+ "Malformed instruction_set attribute",
+ "Неправильный атрибут instruction_set",
+ "잘못된 instruction_set 속성"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+The `instruction_set` attribute was malformed. This attribute requires
+exactly one argument specifying the instruction set architecture.",
+ "\
+Атрибут `instruction_set` неправильно сформирован.
+Он требует ровно один аргумент, указывающий архитектуру.",
+ "\
+`instruction_set` 속성이 잘못되었습니다.
+명령어 집합 아키텍처를 지정하는 인수가 필요합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Provide instruction set argument",
+ "Укажите аргумент набора инструкций",
+ "명령어 집합 인수 제공"
+ ),
+ code: "#[cfg_attr(target_arch=\"arm\", instruction_set(arm::a32))]\nfn something() {}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Codegen Attributes",
+ url: "https://doc.rust-lang.org/reference/attributes/codegen.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0779.rs b/masterror-knowledge/src/errors/attributes/e0779.rs
new file mode 100644
index 0000000..15156d2
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0779.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0779: unknown instruction_set argument
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0779",
+ title: LocalizedText::new(
+ "Unknown instruction_set argument",
+ "Неизвестный аргумент instruction_set",
+ "알 수 없는 instruction_set 인수"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+An unknown argument was given to the `instruction_set` attribute.
+
+Currently supported arguments are:
+- `arm::a32`
+- `arm::t32`",
+ "\
+В атрибут `instruction_set` передан неизвестный аргумент.
+
+Поддерживаемые аргументы: `arm::a32`, `arm::t32`.",
+ "\
+`instruction_set` 속성에 알 수 없는 인수가 전달되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use valid instruction set",
+ "Используйте допустимый набор инструкций",
+ "유효한 명령어 집합 사용"
+ ),
+ code: "#[cfg_attr(target_arch=\"arm\", instruction_set(arm::a32))]\npub fn something() {}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Codegen Attributes",
+ url: "https://doc.rust-lang.org/reference/attributes/codegen.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0780.rs b/masterror-knowledge/src/errors/attributes/e0780.rs
new file mode 100644
index 0000000..c8e66e7
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0780.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0780: doc(inline) with anonymous import
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0780",
+ title: LocalizedText::new(
+ "Cannot use doc(inline) with anonymous imports",
+ "Нельзя использовать doc(inline) с анонимным импортом",
+ "익명 임포트와 doc(inline) 사용 불가"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+The `#[doc(inline)]` attribute was applied to an anonymous import (using `as _`).
+
+Anonymous imports are always rendered with `#[doc(no_inline)]` by default,
+making the `#[doc(inline)]` attribute invalid in this context.",
+ "\
+Атрибут `#[doc(inline)]` применён к анонимному импорту (с `as _`).
+
+Анонимные импорты всегда отображаются с `#[doc(no_inline)]`.",
+ "\
+`#[doc(inline)]` 속성이 익명 임포트(`as _` 사용)에 적용되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove doc(inline) attribute",
+ "Удалите атрибут doc(inline)",
+ "doc(inline) 속성 제거"
+ ),
+ code: "pub use foo::Foo as _; // without #[doc(inline)]"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0780.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0787.rs b/masterror-knowledge/src/errors/attributes/e0787.rs
new file mode 100644
index 0000000..99797ae
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0787.rs
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0787: unsupported naked function definition
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0787",
+ title: LocalizedText::new(
+ "Unsupported naked function definition",
+ "Неподдерживаемое определение naked функции",
+ "지원되지 않는 naked 함수 정의"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+A naked function was defined incorrectly. Naked functions must follow these rules:
+1. Body must contain a single `naked_asm!` block
+2. Execution must never fall through past the assembly code
+3. Only `att_syntax` and `raw` asm options are allowed
+4. Only `const` and `sym` operands are permitted",
+ "\
+Naked функция определена неправильно. Правила:
+1. Тело должно содержать один блок `naked_asm!`
+2. Выполнение не должно выходить за пределы ассемблерного кода
+3. Только опции `att_syntax` и `raw`
+4. Только операнды `const` и `sym`",
+ "\
+naked 함수가 잘못 정의되었습니다. naked 함수는 다음 규칙을 따라야 합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use naked_asm! in function body",
+ "Используйте naked_asm! в теле функции",
+ "함수 본문에 naked_asm! 사용"
+ ),
+ code: "#[unsafe(naked)]\npub extern \"C\" fn foo() {\n naked_asm!(\"ret\");\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "RFC 2972",
+ url: "https://github.com/rust-lang/rfcs/blob/master/text/2972-constrained-naked.md"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/attributes/e0788.rs b/masterror-knowledge/src/errors/attributes/e0788.rs
new file mode 100644
index 0000000..66470a8
--- /dev/null
+++ b/masterror-knowledge/src/errors/attributes/e0788.rs
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0788: coverage attribute in invalid position (no longer emitted)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0788",
+ title: LocalizedText::new(
+ "Coverage attribute in invalid position",
+ "Атрибут coverage в неправильном месте",
+ "잘못된 위치의 coverage 속성"
+ ),
+ category: Category::Attributes,
+ explanation: LocalizedText::new(
+ "\
+Note: This error code is no longer emitted by the compiler.
+
+A `#[coverage(off|on)]` attribute was found in a position where it is not allowed.
+
+Coverage attributes can be applied to:
+- Function and method declarations with a body
+- Closure expressions
+- `impl` blocks and modules",
+ "\
+Примечание: Эта ошибка больше не выдаётся компилятором.
+
+Атрибут `#[coverage]` может применяться к функциям, замыканиям,
+блокам impl и модулям.",
+ "\
+참고: 이 오류 코드는 더 이상 발생하지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Apply coverage to valid items",
+ "Применяйте coverage к допустимым элементам",
+ "유효한 항목에 coverage 적용"
+ ),
+ code: "#[coverage(off)]\nfn uncovered_fn() { /* ... */ }"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0788.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/borrowing.rs b/masterror-knowledge/src/errors/borrowing.rs
new file mode 100644
index 0000000..4176e11
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing.rs
@@ -0,0 +1,41 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Borrowing-related errors.
+
+mod e0499;
+mod e0500;
+mod e0501;
+mod e0502;
+mod e0503;
+mod e0504;
+mod e0506;
+mod e0508;
+mod e0510;
+mod e0521;
+mod e0524;
+mod e0594;
+mod e0596;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[
+ &e0499::ENTRY,
+ &e0500::ENTRY,
+ &e0501::ENTRY,
+ &e0502::ENTRY,
+ &e0503::ENTRY,
+ &e0504::ENTRY,
+ &e0506::ENTRY,
+ &e0508::ENTRY,
+ &e0510::ENTRY,
+ &e0521::ENTRY,
+ &e0524::ENTRY,
+ &e0594::ENTRY,
+ &e0596::ENTRY
+];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/borrowing/e0499.rs b/masterror-knowledge/src/errors/borrowing/e0499.rs
new file mode 100644
index 0000000..b43ca0b
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0499.rs
@@ -0,0 +1,68 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0499: cannot borrow as mutable more than once
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0499",
+ title: LocalizedText::new(
+ "Cannot borrow as mutable more than once",
+ "Нельзя заимствовать как изменяемое более одного раза",
+ "가변으로 두 번 이상 빌릴 수 없음"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+Rust allows only ONE mutable reference to data at a time. This is stricter
+than the immutable borrowing rule and prevents all aliased mutation.
+
+Why? Two mutable references to the same data could lead to:
+- Data races in concurrent code
+- Iterator invalidation
+- Dangling pointers after reallocation
+
+This rule is checked at compile time, giving you fearless concurrency.",
+ "\
+Rust разрешает только ОДНУ изменяемую ссылку на данные одновременно.
+Это строже правила неизменяемого заимствования.
+
+Почему? Две изменяемые ссылки на одни данные могут привести к:
+- Гонкам данных в конкурентном коде
+- Инвалидации итераторов
+- Висячим указателям после реаллокации",
+ "\
+Rust는 데이터에 대해 한 번에 하나의 가변 참조만 허용합니다.
+이는 불변 빌림 규칙보다 엄격합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use scopes to limit borrow lifetime",
+ "Использовать области видимости",
+ "스코프를 사용하여 빌림 수명 제한"
+ ),
+ code: "{ let r1 = &mut x; *r1 += 1; } // r1 dropped\nlet r2 = &mut x;"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use RefCell for interior mutability",
+ "Использовать RefCell",
+ "내부 가변성을 위해 RefCell 사용"
+ ),
+ code: "use std::cell::RefCell;\nlet x = RefCell::new(value);"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Mutable References",
+ url: "https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0499.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0500.rs b/masterror-knowledge/src/errors/borrowing/e0500.rs
new file mode 100644
index 0000000..8721f48
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0500.rs
@@ -0,0 +1,50 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0500: closure requires unique access but X is already borrowed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0500",
+ title: LocalizedText::new(
+ "Closure requires unique access but value is already borrowed",
+ "Замыкание требует уникальный доступ, но значение уже заимствовано",
+ "클로저가 고유 접근을 필요로 하지만 값이 이미 빌려짐"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+A closure that mutates a captured variable needs exclusive access to it.
+But you've already borrowed the value elsewhere, creating a conflict.
+
+Closures that capture by mutable reference act like mutable borrows.",
+ "\
+Замыкание, изменяющее захваченную переменную, требует эксклюзивного доступа.",
+ "\
+캡처된 변수를 변경하는 클로저는 독점적인 접근이 필요합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "End the borrow before the closure",
+ "Завершить заимствование перед замыканием",
+ "클로저 전에 빌림 종료"
+ ),
+ code: "{ let r = &x; use(r); }\nlet c = || x += 1;"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Move the value into the closure",
+ "Переместить значение в замыкание",
+ "클로저로 값 이동"
+ ),
+ code: "let c = move || { x += 1; };"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0500.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0501.rs b/masterror-knowledge/src/errors/borrowing/e0501.rs
new file mode 100644
index 0000000..34298ab
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0501.rs
@@ -0,0 +1,41 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0501: cannot borrow X as mutable because previous closure requires unique
+//! access
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0501",
+ title: LocalizedText::new(
+ "Cannot borrow because closure requires unique access",
+ "Нельзя заимствовать, так как замыкание требует уникальный доступ",
+ "클로저가 고유 접근을 필요로 하여 빌릴 수 없음"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+A closure has captured a variable mutably, and now you're trying to borrow
+that same variable again. The closure's capture acts like a mutable borrow
+that lasts for the closure's entire lifetime.",
+ "\
+Замыкание захватило переменную изменяемо, и теперь вы пытаетесь заимствовать
+ту же переменную снова.",
+ "\
+클로저가 변수를 가변으로 캡처했고, 이제 같은 변수를 다시 빌리려고 합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use the closure before borrowing again",
+ "Использовать замыкание перед повторным заимствованием",
+ "다시 빌리기 전에 클로저 사용"
+ ),
+ code: "let mut c = || x += 1;\nc(); // use closure\nlet r = &x; // now safe"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0501.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0502.rs b/masterror-knowledge/src/errors/borrowing/e0502.rs
new file mode 100644
index 0000000..fa372c0
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0502.rs
@@ -0,0 +1,63 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0502: cannot borrow as mutable because also borrowed as immutable
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0502",
+ title: LocalizedText::new(
+ "Cannot borrow as mutable (already borrowed as immutable)",
+ "Нельзя заимствовать как изменяемое (уже заимствовано как неизменяемое)",
+ "가변으로 빌릴 수 없음 (이미 불변으로 빌림)"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+Rust enforces a strict borrowing rule: you can have EITHER one mutable
+reference OR any number of immutable references, but never both at once.
+
+This prevents data races at compile time. If you could mutate data while
+someone else is reading it, the reader might see inconsistent state.
+
+The immutable borrow is still \"active\" because it's used later in code.",
+ "\
+Rust применяет строгое правило: можно иметь ЛИБО одну изменяемую ссылку,
+ЛИБО любое количество неизменяемых, но никогда обе одновременно.
+
+Это предотвращает гонки данных.",
+ "\
+Rust는 엄격한 빌림 규칙을 적용합니다: 하나의 가변 참조 또는 여러 불변 참조를
+가질 수 있지만, 동시에 둘 다 가질 수는 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "End the immutable borrow before mutating",
+ "Завершить неизменяемое заимствование",
+ "변경 전에 불변 빌림 종료"
+ ),
+ code: "{ let r = &x; println!(\"{}\", r); } // r dropped\nx.push(1);"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Clone before mutation",
+ "Клонировать перед изменением",
+ "변경 전에 복제"
+ ),
+ code: "let copy = x[0].clone();\nx.push(copy);"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: References and Borrowing",
+ url: "https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0502.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0503.rs b/masterror-knowledge/src/errors/borrowing/e0503.rs
new file mode 100644
index 0000000..083a5c3
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0503.rs
@@ -0,0 +1,42 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0503: cannot use X because it was mutably borrowed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0503",
+ title: LocalizedText::new(
+ "Cannot use value because it was mutably borrowed",
+ "Нельзя использовать значение, так как оно изменяемо заимствовано",
+ "가변으로 빌려져서 값을 사용할 수 없음"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+While a mutable borrow is active, you cannot access the original value
+in any way. This prevents you from observing partially modified state
+or creating aliased mutable references.
+
+The mutable borrow has exclusive access until it ends.",
+ "\
+Пока активно изменяемое заимствование, вы не можете обращаться к
+исходному значению никак.",
+ "\
+가변 빌림이 활성화된 동안 원래 값에 어떤 방식으로도 접근할 수 없습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "End the mutable borrow first",
+ "Сначала завершить изменяемое заимствование",
+ "먼저 가변 빌림 종료"
+ ),
+ code: "{ let r = &mut x; modify(r); } // r dropped\nuse_value(&x);"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0503.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0504.rs b/masterror-knowledge/src/errors/borrowing/e0504.rs
new file mode 100644
index 0000000..196ca1c
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0504.rs
@@ -0,0 +1,64 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0504: cannot move borrowed variable into closure
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0504",
+ title: LocalizedText::new(
+ "Cannot move borrowed value into closure",
+ "Нельзя переместить заимствованное значение в замыкание",
+ "빌린 값을 클로저로 이동할 수 없음"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+This error occurs when attempting to move a borrowed variable into a closure
+using the `move` keyword. A value cannot be moved into a closure while it is
+being borrowed elsewhere, as this would invalidate the existing borrow.
+
+Note: This error code is no longer emitted by the compiler.",
+ "\
+Эта ошибка возникает при попытке переместить заимствованную переменную
+в замыкание с помощью ключевого слова `move`. Значение нельзя переместить
+в замыкание, пока оно заимствовано в другом месте.
+
+Примечание: этот код ошибки больше не выдаётся компилятором.",
+ "\
+이 오류는 `move` 키워드를 사용하여 빌린 변수를 클로저로 이동하려고 할 때 발생합니다.
+값이 다른 곳에서 빌려진 동안에는 클로저로 이동할 수 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use a reference in the closure instead",
+ "Использовать ссылку в замыкании",
+ "클로저에서 참조 사용"
+ ),
+ code: "let x = move || { println!(\"{}\", fancy_ref.num); };"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Limit borrow lifetime with a scoped block",
+ "Ограничить время жизни заимствования блоком",
+ "스코프 블록으로 빌림 수명 제한"
+ ),
+ code: "{ let r = &val; use(r); } // r dropped\nlet x = move || use(val);"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use Arc for shared ownership in threads",
+ "Использовать Arc для разделяемого владения",
+ "스레드에서 공유 소유권을 위해 Arc 사용"
+ ),
+ code: "use std::sync::Arc;\nlet shared = Arc::new(val);\nlet clone = shared.clone();"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0504.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0506.rs b/masterror-knowledge/src/errors/borrowing/e0506.rs
new file mode 100644
index 0000000..8c3a482
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0506.rs
@@ -0,0 +1,40 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0506: cannot assign to X because it is borrowed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0506",
+ title: LocalizedText::new(
+ "Cannot assign because it is borrowed",
+ "Нельзя присвоить, так как значение заимствовано",
+ "빌려져 있어서 할당할 수 없음"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+You're trying to assign to a value while a borrow of it exists.
+This would invalidate the existing reference.
+
+You must wait for all borrows to end before assigning a new value.",
+ "\
+Вы пытаетесь присвоить значение, пока существует его заимствование.",
+ "\
+빌림이 존재하는 동안 값에 할당하려고 합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "End the borrow before assigning",
+ "Завершить заимствование перед присваиванием",
+ "할당 전에 빌림 종료"
+ ),
+ code: "{ let r = &x; use(r); } // borrow ends\nx = new_value;"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0506.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0508.rs b/masterror-knowledge/src/errors/borrowing/e0508.rs
new file mode 100644
index 0000000..4b0449c
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0508.rs
@@ -0,0 +1,50 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0508: cannot move out of type `[T]`, a non-copy slice
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0508",
+ title: LocalizedText::new(
+ "Cannot move out of type, a non-copy slice",
+ "Нельзя переместить из типа — это не-Copy срез",
+ "타입에서 이동할 수 없음, 비복사 슬라이스"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+You're trying to move a value out of a slice, but slices don't own their data.
+They're just views into an array or Vec.
+
+Moving out would leave a \"hole\" in the slice, which isn't allowed.",
+ "\
+Вы пытаетесь переместить значение из среза, но срезы не владеют данными.",
+ "\
+슬라이스에서 값을 이동하려고 하지만, 슬라이스는 데이터를 소유하지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Clone the element",
+ "Клонировать элемент",
+ "요소 복제"
+ ),
+ code: "let elem = slice[i].clone();"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use into_iter() on Vec",
+ "Использовать into_iter() на Vec",
+ "Vec에 into_iter() 사용"
+ ),
+ code: "for elem in vec.into_iter() { ... }"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0508.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0510.rs b/masterror-knowledge/src/errors/borrowing/e0510.rs
new file mode 100644
index 0000000..c21a602
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0510.rs
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0510: cannot assign in match guard
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0510",
+ title: LocalizedText::new(
+ "Cannot assign in match guard",
+ "Нельзя присваивать в охранном выражении match",
+ "매치 가드에서 할당할 수 없음"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+The matched value was assigned in a match guard. This is not allowed because
+mutating the matched value in a guard could cause the match to become
+non-exhaustive, as it might change which pattern arm should execute.
+
+The guard expression is evaluated after pattern matching but before the arm
+body executes, so modifying the matched value would require re-evaluating
+previous patterns.",
+ "\
+Сопоставляемое значение было изменено в охранном выражении match.
+Это запрещено, поскольку изменение значения в охране может нарушить
+полноту сопоставления, так как может измениться подходящая ветвь.
+
+Охранное выражение вычисляется после сопоставления с образцом, но до
+выполнения тела ветви.",
+ "\
+매치 가드에서 매칭된 값이 할당되었습니다. 가드에서 매칭된 값을 변경하면
+매치가 비완전해질 수 있어 허용되지 않습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Move mutation into match arm body",
+ "Переместить изменение в тело ветви",
+ "변경을 매치 암 본문으로 이동"
+ ),
+ code: "match x {\n Some(_) => { x = None; } // ok in body\n None => {}\n}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0510.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0521.rs b/masterror-knowledge/src/errors/borrowing/e0521.rs
new file mode 100644
index 0000000..cc39e9e
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0521.rs
@@ -0,0 +1,55 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0521: borrowed data escapes outside of closure
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0521",
+ title: LocalizedText::new(
+ "Borrowed data escapes outside of closure",
+ "Заимствованные данные выходят за пределы замыкания",
+ "빌린 데이터가 클로저 외부로 탈출함"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+This error occurs when borrowed data is used within a closure in a way that
+causes it to escape the closure's scope. When you explicitly annotate a closure
+parameter with a type that includes a reference, it creates a new lifetime
+declaration that may be incompatible with how the borrowed data is being used.
+
+The issue typically arises when a closure parameter is explicitly annotated
+with a reference type, and that reference is then stored or used in a way
+that extends beyond the closure's lifetime.",
+ "\
+Эта ошибка возникает, когда заимствованные данные используются в замыкании
+так, что они выходят за пределы области видимости замыкания. Когда вы явно
+аннотируете параметр замыкания типом со ссылкой, создаётся новое объявление
+времени жизни, которое может быть несовместимо с использованием данных.",
+ "\
+이 오류는 빌린 데이터가 클로저 내에서 클로저의 스코프를 벗어나는 방식으로
+사용될 때 발생합니다. 참조를 포함하는 타입으로 클로저 매개변수를 명시적으로
+어노테이션하면 새로운 라이프타임이 생성됩니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Remove explicit type annotation, let compiler infer",
+ "Удалить явную аннотацию типа",
+ "명시적 타입 어노테이션 제거"
+ ),
+ code: "let mut list: Vec<&str> = Vec::new();\nlet _add = |el| { list.push(el); }; // no type annotation"
+ }],
+ links: &[
+ DocLink {
+ title: "Closure Type Inference",
+ url: "https://doc.rust-lang.org/book/ch13-01-closures.html#closure-type-inference-and-annotation"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0521.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0524.rs b/masterror-knowledge/src/errors/borrowing/e0524.rs
new file mode 100644
index 0000000..ee44814
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0524.rs
@@ -0,0 +1,55 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0524: variable requiring unique access used in multiple closures
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0524",
+ title: LocalizedText::new(
+ "Two closures require unique access to same variable",
+ "Два замыкания требуют уникальный доступ к одной переменной",
+ "두 클로저가 같은 변수에 대한 고유 접근 필요"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+A variable which requires unique access is being used in more than one closure
+at the same time. Since mutable references require exclusive access, Rust's
+borrow checker prevents this to maintain memory safety.
+
+This error occurs when you attempt to borrow a mutable variable in multiple
+closures simultaneously.",
+ "\
+Переменная, требующая уникального доступа, используется одновременно
+в нескольких замыканиях. Поскольку изменяемые ссылки требуют
+эксклюзивного доступа, проверка заимствований Rust предотвращает это.",
+ "\
+고유 접근이 필요한 변수가 동시에 둘 이상의 클로저에서 사용되고 있습니다.
+가변 참조는 배타적 접근이 필요하므로 Rust의 빌림 검사기가 이를 방지합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use Rc> for shared mutable access",
+ "Использовать Rc> для общего изменяемого доступа",
+ "공유 가변 접근을 위해 Rc> 사용"
+ ),
+ code: "use std::rc::Rc;\nuse std::cell::RefCell;\nlet x = Rc::new(RefCell::new(val));\nlet y = Rc::clone(&x);"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Run closures sequentially in separate scopes",
+ "Выполнять замыкания последовательно в разных областях",
+ "별도의 스코프에서 클로저를 순차적으로 실행"
+ ),
+ code: "{ let mut c1 = || set(&mut *x); c1(); }\nlet mut c2 = || set(&mut *x); c2();"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0524.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0594.rs b/masterror-knowledge/src/errors/borrowing/e0594.rs
new file mode 100644
index 0000000..062efcc
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0594.rs
@@ -0,0 +1,44 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0594: cannot assign to immutable value
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0594",
+ title: LocalizedText::new(
+ "Cannot assign to immutable value",
+ "Нельзя присвоить неизменяемому значению",
+ "불변 값에 할당할 수 없음"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+A non-mutable value was assigned a value. In Rust, variables are immutable
+by default, so you must explicitly use the `mut` keyword to allow modifications.
+
+This error occurs when attempting to modify a variable or field that was not
+declared as mutable.",
+ "\
+Неизменяемому значению было присвоено значение. В Rust переменные
+по умолчанию неизменяемы, поэтому необходимо явно использовать
+ключевое слово `mut` для разрешения изменений.",
+ "\
+불변 값에 값이 할당되었습니다. Rust에서 변수는 기본적으로 불변이므로
+수정을 허용하려면 `mut` 키워드를 명시적으로 사용해야 합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Declare the variable as mutable",
+ "Объявить переменную как изменяемую",
+ "변수를 가변으로 선언"
+ ),
+ code: "let mut x = SolarSystem { earth: 3 };\nx.earth = 2; // ok!"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0594.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/borrowing/e0596.rs b/masterror-knowledge/src/errors/borrowing/e0596.rs
new file mode 100644
index 0000000..3f17af3
--- /dev/null
+++ b/masterror-knowledge/src/errors/borrowing/e0596.rs
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0596: cannot borrow as mutable, as it is not declared as mutable
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0596",
+ title: LocalizedText::new(
+ "Cannot borrow as mutable (not declared as mutable)",
+ "Нельзя заимствовать как изменяемое (не объявлено как изменяемое)",
+ "가변으로 빌릴 수 없음 (가변으로 선언되지 않음)"
+ ),
+ category: Category::Borrowing,
+ explanation: LocalizedText::new(
+ "\
+You're trying to get a mutable reference to something that wasn't declared
+as mutable. To modify through a reference, the original binding must be `mut`.
+
+This is Rust's way of making mutation explicit and visible in the code.",
+ "\
+Вы пытаетесь получить изменяемую ссылку на то, что не было объявлено
+как изменяемое. Для изменения через ссылку оригинал должен быть `mut`.",
+ "\
+가변으로 선언되지 않은 것에 대한 가변 참조를 얻으려고 합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Add mut to the variable declaration",
+ "Добавить mut к объявлению переменной",
+ "변수 선언에 mut 추가"
+ ),
+ code: "let mut x = vec![1, 2, 3];"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Add mut to function parameter",
+ "Добавить mut к параметру функции",
+ "함수 매개변수에 mut 추가"
+ ),
+ code: "fn process(data: &mut Vec) { ... }"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0596.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/const_eval.rs b/masterror-knowledge/src/errors/const_eval.rs
new file mode 100644
index 0000000..edb7bc4
--- /dev/null
+++ b/masterror-knowledge/src/errors/const_eval.rs
@@ -0,0 +1,16 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Const evaluation related errors.
+
+mod e0492;
+mod e0493;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[&e0492::ENTRY, &e0493::ENTRY];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/const_eval/e0492.rs b/masterror-knowledge/src/errors/const_eval/e0492.rs
new file mode 100644
index 0000000..a053831
--- /dev/null
+++ b/masterror-knowledge/src/errors/const_eval/e0492.rs
@@ -0,0 +1,50 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0492: borrow of const with interior mutability
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0492",
+ title: LocalizedText::new(
+ "Borrow of constant containing interior mutability",
+ "Заимствование константы с внутренней изменяемостью",
+ "내부 가변성을 포함하는 상수의 빌림"
+ ),
+ category: Category::ConstEval,
+ explanation: LocalizedText::new(
+ "\
+An attempt was made to take a reference to a const that contains types with
+interior mutability (like AtomicUsize or Cell).
+
+A const represents a constant value that should never change. However, types
+with interior mutability allow mutation through shared references. This
+creates a contradiction: a constant could theoretically be mutated.
+
+A static is different - it's explicitly a single memory location.",
+ "\
+Попытка взять ссылку на const, содержащий типы с внутренней изменяемостью
+(такие как AtomicUsize или Cell).
+
+Const представляет константное значение, которое не должно меняться.
+Однако типы с внутренней изменяемостью позволяют мутацию через
+разделяемые ссылки, что создаёт противоречие.",
+ "\
+내부 가변성을 가진 타입(AtomicUsize 또는 Cell 등)을 포함하는
+const에 대한 참조를 가져오려고 시도했습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use static instead of const",
+ "Использовать static вместо const",
+ "const 대신 static 사용"
+ ),
+ code: "use std::sync::atomic::AtomicUsize;\n\nstatic A: AtomicUsize = AtomicUsize::new(0);\nstatic B: &'static AtomicUsize = &A; // ok!"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0492.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/const_eval/e0493.rs b/masterror-knowledge/src/errors/const_eval/e0493.rs
new file mode 100644
index 0000000..c1a336b
--- /dev/null
+++ b/masterror-knowledge/src/errors/const_eval/e0493.rs
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0493: value with Drop may be dropped during const-eval
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0493",
+ title: LocalizedText::new(
+ "Value with custom Drop may be dropped during const-eval",
+ "Значение с Drop может быть уничтожено при const-вычислении",
+ "커스텀 Drop을 가진 값이 const-eval 중에 드롭될 수 있음"
+ ),
+ category: Category::ConstEval,
+ explanation: LocalizedText::new(
+ "\
+A value that implements the Drop trait was used in a const context (like a
+static initializer). The issue is that Drop implementations can execute
+arbitrary code that isn't const-checked, which violates the constraints
+of compile-time evaluation.
+
+Drop logic could have unpredictable side effects and must be deterministic
+and verifiable at compile-time.",
+ "\
+Значение, реализующее трейт Drop, использовано в const-контексте
+(например, в инициализаторе static). Проблема в том, что реализации
+Drop могут выполнять произвольный код, который не проверяется на
+const-совместимость, что нарушает ограничения вычисления во время
+компиляции.",
+ "\
+Drop 트레이트를 구현하는 값이 const 컨텍스트(예: static 초기화자)에서
+사용되었습니다. Drop 구현은 const-checked되지 않는 임의의 코드를
+실행할 수 있어 컴파일 타임 평가 제약을 위반합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Initialize fields directly without temporaries",
+ "Инициализировать поля напрямую без временных значений",
+ "임시 값 없이 필드 직접 초기화"
+ ),
+ code: "static FOO: Foo = Foo { field1: DropType::A }; // Direct init"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0493.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/consts.rs b/masterror-knowledge/src/errors/consts.rs
new file mode 100644
index 0000000..3f9507d
--- /dev/null
+++ b/masterror-knowledge/src/errors/consts.rs
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Constant and static related errors.
+
+mod e0010;
+mod e0015;
+mod e0080;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[&e0010::ENTRY, &e0015::ENTRY, &e0080::ENTRY];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/consts/e0010.rs b/masterror-knowledge/src/errors/consts/e0010.rs
new file mode 100644
index 0000000..86784bf
--- /dev/null
+++ b/masterror-knowledge/src/errors/consts/e0010.rs
@@ -0,0 +1,60 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0010: cannot allocate in const/static context
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0010",
+ title: LocalizedText::new(
+ "Cannot allocate in const/static",
+ "Нельзя выделять память в const/static",
+ "const/static에서 할당 불가"
+ ),
+ category: Category::Consts,
+ explanation: LocalizedText::new(
+ "\
+The value of statics and constants must be known at compile time. Creating a
+boxed value or using `vec![]` allocates memory on the heap at runtime, which
+cannot be done in a const context.
+
+Example:
+ const CON: Vec = vec![1, 2, 3]; // Error: heap allocation",
+ "\
+Значения static и const должны быть известны во время компиляции.
+Создание Box или использование vec![] выделяет память в куче во время
+выполнения, что недопустимо в контексте const.",
+ "\
+static과 const의 값은 컴파일 시점에 알려져야 합니다. 힙 할당은 런타임에 발생합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use an array instead",
+ "Использовать массив вместо Vec",
+ "대신 배열 사용"
+ ),
+ code: "const CON: [i32; 3] = [1, 2, 3];"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use lazy_static or once_cell for runtime initialization",
+ "Использовать lazy_static или once_cell",
+ "런타임 초기화를 위해 lazy_static 또는 once_cell 사용"
+ ),
+ code: "use std::sync::LazyLock;\nstatic CON: LazyLock> = LazyLock::new(|| vec![1, 2, 3]);"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Constant Evaluation",
+ url: "https://doc.rust-lang.org/reference/const_eval.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0010.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/consts/e0015.rs b/masterror-knowledge/src/errors/consts/e0015.rs
new file mode 100644
index 0000000..26ed757
--- /dev/null
+++ b/masterror-knowledge/src/errors/consts/e0015.rs
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0015: non-const function called in const context
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0015",
+ title: LocalizedText::new(
+ "Non-const function in const context",
+ "Не-const функция в const контексте",
+ "const 컨텍스트에서 non-const 함수"
+ ),
+ category: Category::Consts,
+ explanation: LocalizedText::new(
+ "\
+This error occurs when you call a non-`const` function within a constant or
+static expression. Only `const fn` functions can be evaluated at compile time.
+
+Example:
+ fn create_some() -> Option { Some(1) }
+ const FOO: Option = create_some(); // Error: not a const fn",
+ "\
+Эта ошибка возникает при вызове не-const функции в константном выражении.
+Только функции с `const fn` могут вычисляться во время компиляции.",
+ "\
+이 오류는 상수 표현식에서 non-const 함수를 호출할 때 발생합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Mark the function as const fn",
+ "Пометить функцию как const fn",
+ "함수를 const fn으로 표시"
+ ),
+ code: "const fn create_some() -> Option { Some(1) }\nconst FOO: Option = create_some();"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Const Functions",
+ url: "https://doc.rust-lang.org/reference/const_eval.html#const-functions"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0015.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/consts/e0080.rs b/masterror-knowledge/src/errors/consts/e0080.rs
new file mode 100644
index 0000000..cfa4517
--- /dev/null
+++ b/masterror-knowledge/src/errors/consts/e0080.rs
@@ -0,0 +1,54 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0080: constant value evaluation failed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0080",
+ title: LocalizedText::new(
+ "Constant evaluation failed",
+ "Ошибка вычисления константы",
+ "상수 평가 실패"
+ ),
+ category: Category::Consts,
+ explanation: LocalizedText::new(
+ "\
+This error occurs when the compiler cannot evaluate a constant expression.
+This typically happens with operations that are mathematically or
+computationally invalid:
+
+- Division by zero
+- Integer overflow
+- Invalid bit shifts
+
+Example:
+ enum E { X = (1 / 0) } // Error: division by zero",
+ "\
+Эта ошибка возникает, когда компилятор не может вычислить константное
+выражение. Обычно это происходит при недопустимых операциях:
+деление на ноль, целочисленное переполнение.",
+ "\
+이 오류는 컴파일러가 상수 표현식을 평가할 수 없을 때 발생합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Ensure valid arithmetic operations",
+ "Убедиться в корректности арифметических операций",
+ "유효한 산술 연산 확인"
+ ),
+ code: "enum E {\n X = 1,\n Y = 2,\n}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Constant Evaluation",
+ url: "https://doc.rust-lang.org/reference/const_eval.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0080.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/features.rs b/masterror-knowledge/src/errors/features.rs
new file mode 100644
index 0000000..3185b61
--- /dev/null
+++ b/masterror-knowledge/src/errors/features.rs
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Feature flag and compiler feature errors.
+
+mod e0635;
+mod e0636;
+mod e0658;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[&e0635::ENTRY, &e0636::ENTRY, &e0658::ENTRY];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/features/e0635.rs b/masterror-knowledge/src/errors/features/e0635.rs
new file mode 100644
index 0000000..2efcbb2
--- /dev/null
+++ b/masterror-knowledge/src/errors/features/e0635.rs
@@ -0,0 +1,60 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0635: unknown feature
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0635",
+ title: LocalizedText::new(
+ "Unknown feature in #![feature] attribute",
+ "Неизвестная функция в атрибуте #![feature]",
+ "#![feature] 속성에 알 수 없는 기능"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An unknown or non-existent feature was specified in a `#![feature]` attribute.
+
+Feature flags are used to opt into unstable or experimental Rust features,
+and they must be valid feature names recognized by the Rust compiler.",
+ "\
+Неизвестная или несуществующая функция была указана в атрибуте `#![feature]`.
+
+Флаги функций используются для включения нестабильных или экспериментальных
+функций Rust и должны быть допустимыми именами функций, распознаваемыми
+компилятором Rust.",
+ "\
+`#![feature]` 속성에 알 수 없거나 존재하지 않는 기능이 지정되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Verify the feature name spelling",
+ "Проверить правописание имени функции",
+ "기능 이름 철자 확인"
+ ),
+ code: "#![feature(existing_feature)] // check spelling"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Check the Unstable Book for valid features",
+ "Проверить Unstable Book для допустимых функций",
+ "유효한 기능은 Unstable Book 확인"
+ ),
+ code: "// See https://doc.rust-lang.org/unstable-book/"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "The Unstable Book",
+ url: "https://doc.rust-lang.org/unstable-book/"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0635.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/features/e0636.rs b/masterror-knowledge/src/errors/features/e0636.rs
new file mode 100644
index 0000000..5e9e37e
--- /dev/null
+++ b/masterror-knowledge/src/errors/features/e0636.rs
@@ -0,0 +1,48 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0636: duplicate feature
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0636",
+ title: LocalizedText::new(
+ "Feature enabled multiple times",
+ "Функция включена несколько раз",
+ "기능이 여러 번 활성화됨"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+The same feature is enabled multiple times with `#![feature]` attributes.
+The Rust compiler does not allow duplicate `#![feature]` declarations for
+the same feature. Each feature should only be enabled once per crate.",
+ "\
+Одна и та же функция включена несколько раз с помощью атрибутов `#![feature]`.
+Компилятор Rust не допускает дублирующиеся объявления `#![feature]` для одной
+и той же функции. Каждая функция должна быть включена только один раз в крейте.",
+ "\
+동일한 기능이 `#![feature]` 속성으로 여러 번 활성화되었습니다.
+각 기능은 크레이트당 한 번만 활성화해야 합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Remove duplicate feature attribute",
+ "Удалить дублирующийся атрибут функции",
+ "중복 기능 속성 제거"
+ ),
+ code: "#![feature(rust1)] // keep only one"
+ }],
+ links: &[
+ DocLink {
+ title: "The Unstable Book",
+ url: "https://doc.rust-lang.org/unstable-book/"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0636.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/features/e0658.rs b/masterror-knowledge/src/errors/features/e0658.rs
new file mode 100644
index 0000000..29697c8
--- /dev/null
+++ b/masterror-knowledge/src/errors/features/e0658.rs
@@ -0,0 +1,66 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0658: unstable feature used
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0658",
+ title: LocalizedText::new(
+ "Unstable feature used",
+ "Использована нестабильная функция",
+ "불안정한 기능 사용됨"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An unstable feature was used without properly enabling it. Unstable features
+are experimental functionality that may change or be removed in future Rust
+versions.
+
+Unstable features require:
+- The nightly version of Rust
+- Explicit opt-in via `#![feature(...)]` attribute",
+ "\
+Использована нестабильная функция без её правильного включения. Нестабильные
+функции — это экспериментальная функциональность, которая может измениться
+или быть удалена в будущих версиях Rust.
+
+Нестабильные функции требуют:
+- Ночную версию Rust
+- Явное включение через атрибут `#![feature(...)]`",
+ "\
+불안정한 기능이 적절한 활성화 없이 사용되었습니다. 불안정한 기능은
+향후 Rust 버전에서 변경되거나 제거될 수 있는 실험적 기능입니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Enable the feature with #![feature(...)]",
+ "Включить функцию с помощью #![feature(...)]",
+ "#![feature(...)]로 기능 활성화"
+ ),
+ code: "#![feature(core_intrinsics)]\n\nuse std::intrinsics; // ok!"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Switch to nightly Rust",
+ "Переключиться на ночную версию Rust",
+ "nightly Rust로 전환"
+ ),
+ code: "rustup default nightly"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "The Unstable Book",
+ url: "https://doc.rust-lang.org/unstable-book/"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0658.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/generics.rs b/masterror-knowledge/src/errors/generics.rs
new file mode 100644
index 0000000..6356a54
--- /dev/null
+++ b/masterror-knowledge/src/errors/generics.rs
@@ -0,0 +1,27 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Generic parameter related errors.
+
+mod e0107;
+mod e0109;
+mod e0128;
+mod e0393;
+mod e0401;
+mod e0403;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[
+ &e0107::ENTRY,
+ &e0109::ENTRY,
+ &e0128::ENTRY,
+ &e0393::ENTRY,
+ &e0401::ENTRY,
+ &e0403::ENTRY
+];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/generics/e0107.rs b/masterror-knowledge/src/errors/generics/e0107.rs
new file mode 100644
index 0000000..e348fe8
--- /dev/null
+++ b/masterror-knowledge/src/errors/generics/e0107.rs
@@ -0,0 +1,68 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0107: wrong number of generic arguments
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0107",
+ title: LocalizedText::new(
+ "Wrong number of generic arguments",
+ "Неправильное количество обобщённых аргументов",
+ "제네릭 인수 개수 불일치"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+An incorrect number of generic arguments was provided. The compiler expects
+a specific number of generic type parameters, lifetime parameters, or const
+parameters, but you've supplied a different amount.
+
+This commonly happens when:
+- Using a generic type without providing all required type arguments
+- Providing more type arguments than the type accepts
+- Forgetting lifetime parameters when they are required",
+ "\
+Указано неправильное количество обобщённых аргументов. Компилятор ожидает
+определённое количество параметров типа, времени жизни или констант,
+но вы указали другое количество.
+
+Это часто происходит когда:
+- Используется обобщённый тип без всех необходимых аргументов
+- Указано больше аргументов типа, чем принимает тип
+- Забыты параметры времени жизни",
+ "\
+제공된 제네릭 인수의 수가 올바르지 않습니다. 컴파일러는 특정 수의 타입,
+라이프타임 또는 const 매개변수를 기대하지만 다른 수가 제공되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Provide the correct number of type arguments",
+ "Указать правильное количество аргументов типа",
+ "올바른 수의 타입 인수 제공"
+ ),
+ code: "struct Foo { x: T }\nstruct Bar { x: Foo } // provide one type argument"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Check the type definition for required parameters",
+ "Проверить определение типа на требуемые параметры",
+ "필요한 매개변수에 대한 타입 정의 확인"
+ ),
+ code: "fn foo(x: T, y: U) {}\nfoo::(x, 12); // two type arguments needed"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Generic Data Types",
+ url: "https://doc.rust-lang.org/book/ch10-01-syntax.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0107.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/generics/e0109.rs b/masterror-knowledge/src/errors/generics/e0109.rs
new file mode 100644
index 0000000..1000010
--- /dev/null
+++ b/masterror-knowledge/src/errors/generics/e0109.rs
@@ -0,0 +1,63 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0109: type arguments not allowed for this type
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0109",
+ title: LocalizedText::new(
+ "Type arguments not allowed for this type",
+ "Аргументы типа не разрешены для этого типа",
+ "이 타입에는 타입 인수가 허용되지 않음"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+You tried to provide a generic argument to a type which doesn't need it.
+Primitive types like u32, bool, i64 don't accept type parameters.
+
+Generic arguments for enum variant constructors go after the variant,
+not after the enum. For example, write Option::None:: rather than
+Option::::None.",
+ "\
+Вы попытались передать обобщённый аргумент типу, который его не принимает.
+Примитивные типы вроде u32, bool, i64 не принимают параметры типа.
+
+Обобщённые аргументы для конструкторов вариантов перечислений указываются
+после варианта, а не после перечисления.",
+ "\
+제네릭 인수를 받지 않는 타입에 제네릭 인수를 제공하려고 했습니다.
+u32, bool, i64와 같은 기본 타입은 타입 매개변수를 받지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Remove the type argument from primitive type",
+ "Удалить аргумент типа у примитивного типа",
+ "기본 타입에서 타입 인수 제거"
+ ),
+ code: "type X = u32; // not u32"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Place generic args after enum variant",
+ "Поместить обобщённые аргументы после варианта",
+ "열거형 변형 뒤에 제네릭 인수 배치"
+ ),
+ code: "Option::None:: // not Option::::None"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Types",
+ url: "https://doc.rust-lang.org/reference/types.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0109.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/generics/e0128.rs b/masterror-knowledge/src/errors/generics/e0128.rs
new file mode 100644
index 0000000..183cc58
--- /dev/null
+++ b/masterror-knowledge/src/errors/generics/e0128.rs
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0128: generic parameters with a default cannot use forward declared
+//! identifiers
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0128",
+ title: LocalizedText::new(
+ "Generic parameters with a default cannot use forward declared identifiers",
+ "Обобщённые параметры со значением по умолчанию не могут использовать ещё не объявленные идентификаторы",
+ "기본값이 있는 제네릭 매개변수는 전방 선언된 식별자를 사용할 수 없음"
+ ),
+ category: Category::Types,
+ explanation: LocalizedText::new(
+ "\
+A type parameter with default value is using a forward declared identifier.
+Type parameter defaults can only reference parameters that are declared
+before them. Since type parameters are evaluated in order, attempting to
+use a not-yet-defined identifier in a default value causes this error.",
+ "\
+Параметр типа со значением по умолчанию использует ещё не объявленный
+идентификатор. Значения по умолчанию для параметров типа могут ссылаться
+только на параметры, объявленные до них. Поскольку параметры типа
+вычисляются по порядку, использование ещё не определённого идентификатора
+вызывает эту ошибку.",
+ "\
+기본값이 있는 타입 매개변수가 전방 선언된 식별자를 사용하고 있습니다.
+타입 매개변수 기본값은 이전에 선언된 매개변수만 참조할 수 있습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Reorder type parameters so referenced ones come first",
+ "Переупорядочить параметры типа так, чтобы используемые шли первыми",
+ "참조되는 매개변수가 먼저 오도록 타입 매개변수 재정렬"
+ ),
+ code: "struct Foo {\n field1: T,\n field2: U,\n}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Type Parameters",
+ url: "https://doc.rust-lang.org/reference/items/generics.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0128.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/generics/e0393.rs b/masterror-knowledge/src/errors/generics/e0393.rs
new file mode 100644
index 0000000..8c37386
--- /dev/null
+++ b/masterror-knowledge/src/errors/generics/e0393.rs
@@ -0,0 +1,70 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0393: type parameter with Self default not specified
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0393",
+ title: LocalizedText::new(
+ "Type parameter referencing Self must be specified",
+ "Параметр типа со ссылкой на Self должен быть указан",
+ "Self를 참조하는 타입 매개변수를 지정해야 함"
+ ),
+ category: Category::Generics,
+ explanation: LocalizedText::new(
+ "\
+A type parameter which references `Self` in its default value was not specified.
+This error occurs when a trait has a default type parameter that references
+`Self`, but the trait is used as a trait object without explicitly specifying
+that type parameter.
+
+Trait objects require a single, fully-defined trait. When a default parameter
+is `Self`, the trait effectively changes for each concrete type:
+- i32 would need to implement A
+- bool would need to implement A
+
+Since each type implements a different version of the trait, they cannot be
+unified into a single trait object.",
+ "\
+Параметр типа со ссылкой на `Self` в значении по умолчанию не был указан.
+Эта ошибка возникает, когда трейт имеет параметр типа по умолчанию, ссылающийся
+на `Self`, но трейт используется как трейт-объект без явного указания этого
+параметра типа.
+
+Трейт-объекты требуют единого, полностью определённого трейта. Когда параметр
+по умолчанию - `Self`, трейт фактически меняется для каждого конкретного типа:
+- i32 должен реализовывать A
+- bool должен реализовывать A
+
+Поскольку каждый тип реализует разную версию трейта, они не могут быть
+объединены в единый трейт-объект.",
+ "\
+기본값에서 `Self`를 참조하는 타입 매개변수가 지정되지 않았습니다.
+이 오류는 트레이트가 `Self`를 참조하는 기본 타입 매개변수를 가지고 있지만,
+해당 타입 매개변수를 명시적으로 지정하지 않고 트레이트 객체로 사용될 때 발생합니다.
+
+트레이트 객체는 단일하고 완전히 정의된 트레이트를 필요로 합니다.
+기본 매개변수가 `Self`일 때, 각 구체적인 타입에 대해 트레이트가 효과적으로 변경됩니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Explicitly specify the concrete type parameter",
+ "Явно указать конкретный параметр типа",
+ "구체적인 타입 매개변수를 명시적으로 지정"
+ ),
+ code: "trait A {}\n\nfn together_we_will_rule_the_galaxy(son: &dyn A) {} // Ok!"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Trait Objects",
+ url: "https://doc.rust-lang.org/reference/types/trait-object.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0393.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/generics/e0401.rs b/masterror-knowledge/src/errors/generics/e0401.rs
new file mode 100644
index 0000000..1761724
--- /dev/null
+++ b/masterror-knowledge/src/errors/generics/e0401.rs
@@ -0,0 +1,57 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0401: inner items do not inherit generic parameters
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0401",
+ title: LocalizedText::new(
+ "Inner items do not inherit generic parameters",
+ "Вложенные элементы не наследуют параметры типов",
+ "내부 항목은 제네릭 매개변수를 상속하지 않음"
+ ),
+ category: Category::Generics,
+ explanation: LocalizedText::new(
+ "\
+Nested items (functions, types, or structs) cannot use generic parameters from
+their enclosing scope. Inner items are treated as top-level items that can
+only be accessed from within their containing scope.
+
+This is a deliberate design choice - inner functions need their own generic
+parameters to be self-contained.",
+ "\
+Вложенные элементы (функции, типы или структуры) не могут использовать
+параметры типов из внешней области видимости. Внутренние элементы
+рассматриваются как элементы верхнего уровня.
+
+Это сделано намеренно - внутренние функции должны быть самодостаточными.",
+ "\
+중첩된 항목(함수, 타입 또는 구조체)은 외부 스코프의 제네릭 매개변수를
+사용할 수 없습니다. 내부 항목은 최상위 항목으로 취급됩니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use a closure instead of inner function",
+ "Использовать замыкание вместо функции",
+ "내부 함수 대신 클로저 사용"
+ ),
+ code: "fn foo(x: T) {\n let bar = |y: T| { /* closure captures T */ };\n bar(x);\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Explicitly declare generic parameters in inner item",
+ "Явно объявить параметры типов во вложенном элементе",
+ "내부 항목에 제네릭 매개변수 명시적 선언"
+ ),
+ code: "fn foo(x: T) {\n fn bar(y: T) { }\n bar(x);\n}"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0401.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/generics/e0403.rs b/masterror-knowledge/src/errors/generics/e0403.rs
new file mode 100644
index 0000000..a70cffc
--- /dev/null
+++ b/masterror-knowledge/src/errors/generics/e0403.rs
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0403: duplicate type parameter name
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0403",
+ title: LocalizedText::new(
+ "Some type parameters have the same name",
+ "Несколько параметров типа имеют одинаковое имя",
+ "일부 타입 매개변수가 같은 이름을 가짐"
+ ),
+ category: Category::Generics,
+ explanation: LocalizedText::new(
+ "\
+Multiple type parameters with the same name were declared in a function, trait,
+or other generic item. Rust requires all type parameters within the same scope
+to have unique names.
+
+Type parameters in associated items also cannot shadow parameters from the
+containing item.",
+ "\
+В функции, трейте или другом обобщённом элементе объявлено несколько
+параметров типа с одинаковым именем. Rust требует, чтобы все параметры
+типа в одной области видимости имели уникальные имена.",
+ "\
+함수, 트레이트 또는 다른 제네릭 항목에서 같은 이름의 타입 매개변수가
+여러 개 선언되었습니다. Rust는 같은 스코프 내 모든 타입 매개변수가
+고유한 이름을 가질 것을 요구합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Rename clashing type parameters to be unique",
+ "Переименовать конфликтующие параметры типа",
+ "충돌하는 타입 매개변수 이름 변경"
+ ),
+ code: "fn f(s: T, u: U) {} // Use different names"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0403.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes.rs b/masterror-knowledge/src/errors/lifetimes.rs
new file mode 100644
index 0000000..efe6e08
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes.rs
@@ -0,0 +1,67 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Lifetime-related errors.
+
+mod e0106;
+mod e0195;
+mod e0226;
+mod e0227;
+mod e0228;
+mod e0261;
+mod e0262;
+mod e0263;
+mod e0478;
+mod e0482;
+mod e0491;
+mod e0495;
+mod e0496;
+mod e0515;
+mod e0581;
+mod e0582;
+mod e0597;
+mod e0621;
+mod e0623;
+mod e0625;
+mod e0626;
+mod e0637;
+mod e0657;
+mod e0700;
+mod e0716;
+mod e0803;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[
+ &e0106::ENTRY,
+ &e0195::ENTRY,
+ &e0226::ENTRY,
+ &e0227::ENTRY,
+ &e0228::ENTRY,
+ &e0261::ENTRY,
+ &e0262::ENTRY,
+ &e0263::ENTRY,
+ &e0478::ENTRY,
+ &e0482::ENTRY,
+ &e0491::ENTRY,
+ &e0495::ENTRY,
+ &e0496::ENTRY,
+ &e0515::ENTRY,
+ &e0581::ENTRY,
+ &e0582::ENTRY,
+ &e0597::ENTRY,
+ &e0621::ENTRY,
+ &e0623::ENTRY,
+ &e0625::ENTRY,
+ &e0626::ENTRY,
+ &e0637::ENTRY,
+ &e0657::ENTRY,
+ &e0700::ENTRY,
+ &e0716::ENTRY,
+ &e0803::ENTRY
+];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/lifetimes/e0106.rs b/masterror-knowledge/src/errors/lifetimes/e0106.rs
new file mode 100644
index 0000000..3d10310
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0106.rs
@@ -0,0 +1,68 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0106: missing lifetime specifier
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0106",
+ title: LocalizedText::new(
+ "Missing lifetime specifier",
+ "Отсутствует спецификатор времени жизни",
+ "라이프타임 지정자 누락"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+References in Rust have lifetimes - they describe how long the reference
+is valid. Usually the compiler infers lifetimes, but sometimes you must
+be explicit.
+
+Lifetime annotations don't change how long values live. They describe
+relationships between references so the compiler can verify safety.",
+ "\
+Ссылки в Rust имеют времена жизни — они описывают, как долго ссылка
+действительна. Обычно компилятор выводит времена жизни, но иногда нужно
+указать явно.",
+ "\
+Rust의 참조에는 라이프타임이 있습니다 - 참조가 얼마나 오래 유효한지 설명합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Add explicit lifetime parameter",
+ "Добавить явный параметр времени жизни",
+ "명시적 라이프타임 매개변수 추가"
+ ),
+ code: "struct Foo<'a> { x: &'a str }"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use owned type instead",
+ "Использовать владеющий тип",
+ "소유 타입 사용"
+ ),
+ code: "struct Foo { x: String }"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use 'static for compile-time constants",
+ "Использовать 'static для констант",
+ "컴파일 시간 상수에 'static 사용"
+ ),
+ code: "fn get_str() -> &'static str { \"hello\" }"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Lifetimes",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0106.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0195.rs b/masterror-knowledge/src/errors/lifetimes/e0195.rs
new file mode 100644
index 0000000..4177095
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0195.rs
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0195: lifetime parameters or bounds on method do not match the trait
+//! declaration
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0195",
+ title: LocalizedText::new(
+ "Lifetime parameters or bounds on method do not match the trait declaration",
+ "Параметры времени жизни или ограничения метода не соответствуют объявлению трейта",
+ "메서드의 라이프타임 매개변수 또는 바운드가 트레이트 선언과 일치하지 않음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+The lifetime parameters of the method do not match the trait declaration.
+When implementing a trait method with lifetime parameters, the lifetime
+bounds and constraints must be identical between the trait definition
+and its implementation.",
+ "\
+Параметры времени жизни метода не соответствуют объявлению трейта.
+При реализации метода трейта с параметрами времени жизни, ограничения
+времени жизни должны быть идентичны между определением трейта и его
+реализацией.",
+ "\
+메서드의 라이프타임 매개변수가 트레이트 선언과 일치하지 않습니다.
+라이프타임 매개변수가 있는 트레이트 메서드를 구현할 때 라이프타임
+바운드와 제약 조건은 트레이트 정의와 구현 사이에서 동일해야 합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Match lifetime declarations and bounds exactly",
+ "Точно соответствовать объявлениям и ограничениям времени жизни",
+ "라이프타임 선언과 바운드를 정확히 일치시키기"
+ ),
+ code: "trait Trait {\n fn t<'a,'b:'a>(x: &'a str, y: &'b str);\n}\n\nstruct Foo;\n\nimpl Trait for Foo {\n fn t<'a,'b:'a>(x: &'a str, y: &'b str) { // ok!\n }\n}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Book: Lifetime Annotations",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0195.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0226.rs b/masterror-knowledge/src/errors/lifetimes/e0226.rs
new file mode 100644
index 0000000..99c4e72
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0226.rs
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0226: multiple explicit lifetime bounds on trait object
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0226",
+ title: LocalizedText::new(
+ "Multiple explicit lifetime bounds on trait object",
+ "Несколько явных ограничений времени жизни для трейт-объекта",
+ "트레이트 객체에 여러 명시적 수명 바운드"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+More than one explicit lifetime bound was used on a trait object.
+Trait objects in Rust can only have ONE explicit lifetime bound.
+
+If you need to work with multiple lifetimes, consider restructuring
+your code or using a single lifetime that encompasses the requirements
+of both.",
+ "\
+Для трейт-объекта было использовано более одного явного ограничения
+времени жизни. Трейт-объекты в Rust могут иметь только ОДНО явное
+ограничение времени жизни.",
+ "\
+트레이트 객체에 둘 이상의 명시적 수명 바운드가 사용되었습니다.
+트레이트 객체는 하나의 명시적 수명 바운드만 가질 수 있습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Remove all but one lifetime bound",
+ "Удалите все ограничения времени жизни, кроме одного",
+ "하나를 제외한 모든 수명 바운드 제거"
+ ),
+ code: "trait Foo {}\n\ntype T<'a> = dyn Foo + 'a;"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Trait Object Lifetime Bounds",
+ url: "https://doc.rust-lang.org/reference/types/trait-object.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0226.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0227.rs b/masterror-knowledge/src/errors/lifetimes/e0227.rs
new file mode 100644
index 0000000..4c6d60c
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0227.rs
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0227: ambiguous lifetime bounds
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0227",
+ title: LocalizedText::new(
+ "Ambiguous lifetime bounds",
+ "Неоднозначные ограничения времени жизни",
+ "모호한 수명 바운드"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+Unable to determine a unique region in derived region bounds.
+
+This error occurs when the Rust compiler cannot determine exactly one
+unique lifetime from a set of derived region bounds. When a trait
+object could satisfy multiple lifetime constraints, you need to be
+explicit about which lifetime applies.",
+ "\
+Невозможно определить единственный регион из производных ограничений регионов.
+
+Эта ошибка возникает, когда компилятор Rust не может определить ровно
+одно уникальное время жизни из набора производных ограничений регионов.",
+ "\
+파생된 영역 바운드에서 고유한 영역을 결정할 수 없습니다.
+명시적으로 어떤 수명이 적용되는지 지정해야 합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Explicitly specify a lifetime bound",
+ "Явно укажите ограничение времени жизни",
+ "수명 바운드를 명시적으로 지정"
+ ),
+ code: "struct Baz<'foo, 'bar, 'baz>\nwhere\n 'baz: 'foo + 'bar,\n{\n obj: dyn FooBar<'foo, 'bar> + 'baz,\n}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Lifetimes",
+ url: "https://doc.rust-lang.org/reference/trait-bounds.html#lifetime-bounds"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0227.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0228.rs b/masterror-knowledge/src/errors/lifetimes/e0228.rs
new file mode 100644
index 0000000..11d2a6f
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0228.rs
@@ -0,0 +1,63 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0228: undeducible lifetime bound for trait objects
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0228",
+ title: LocalizedText::new(
+ "Undeducible lifetime bound for trait object",
+ "Невыводимое ограничение времени жизни для трейт-объекта",
+ "트레이트 객체의 추론 불가능한 수명 바운드"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+The lifetime bound for this object type cannot be deduced from context
+and must be specified.
+
+This error occurs when a trait object is used as a type argument in
+a generic type that has multiple lifetime bounds, and Rust cannot
+automatically infer which lifetime should apply to the trait object.",
+ "\
+Ограничение времени жизни для этого типа объекта не может быть выведено
+из контекста и должно быть указано.
+
+Эта ошибка возникает, когда трейт-объект используется как аргумент типа
+в обобщённом типе с несколькими ограничениями времени жизни.",
+ "\
+이 객체 타입의 수명 바운드를 컨텍스트에서 추론할 수 없으므로
+명시적으로 지정해야 합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Explicitly specify the trait object's lifetime",
+ "Явно укажите время жизни трейт-объекта",
+ "트레이트 객체의 수명을 명시적으로 지정"
+ ),
+ code: "type Foo<'a, 'b> = TwoBounds<'a, 'b, dyn Trait + 'b>;"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Reduce to a single lifetime bound",
+ "Сократите до одного ограничения времени жизни",
+ "단일 수명 바운드로 축소"
+ ),
+ code: "struct OneBound<'a, T: 'a> {\n x: &'a i32,\n z: T,\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "RFC 599: Default Object Bound",
+ url: "https://github.com/rust-lang/rfcs/blob/master/text/0599-default-object-bound.md"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0228.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0261.rs b/masterror-knowledge/src/errors/lifetimes/e0261.rs
new file mode 100644
index 0000000..179b6d3
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0261.rs
@@ -0,0 +1,73 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0261: undeclared lifetime
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0261",
+ title: LocalizedText::new(
+ "Use of undeclared lifetime",
+ "Использование необъявленного времени жизни",
+ "선언되지 않은 수명 사용"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A lifetime parameter was used without first declaring it.
+
+Lifetimes must be explicitly declared as generic parameters before
+they can be used in function signatures, struct definitions, or
+impl blocks.
+
+The lifetime parameter must be declared in angle brackets before
+being referenced in the type or function signature.",
+ "\
+Параметр времени жизни был использован без предварительного объявления.
+
+Времена жизни должны быть явно объявлены как параметры дженериков,
+прежде чем их можно использовать в сигнатурах функций, определениях
+структур или блоках impl.",
+ "\
+수명 매개변수가 선언되지 않고 사용되었습니다.
+수명은 사용하기 전에 제네릭 매개변수로 선언해야 합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Declare lifetime in function signature",
+ "Объявите время жизни в сигнатуре функции",
+ "함수 시그니처에서 수명 선언"
+ ),
+ code: "fn foo<'a>(x: &'a str) {}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Declare lifetime in struct definition",
+ "Объявите время жизни в определении структуры",
+ "구조체 정의에서 수명 선언"
+ ),
+ code: "struct Foo<'a> {\n x: &'a str,\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Declare lifetime on impl block",
+ "Объявите время жизни в блоке impl",
+ "impl 블록에서 수명 선언"
+ ),
+ code: "impl<'a> Foo<'a> {\n fn foo(x: &'a str) {}\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Lifetimes",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0261.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0262.rs b/masterror-knowledge/src/errors/lifetimes/e0262.rs
new file mode 100644
index 0000000..80ddbca
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0262.rs
@@ -0,0 +1,53 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0262: invalid lifetime parameter name
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0262",
+ title: LocalizedText::new(
+ "Invalid lifetime parameter name",
+ "Недопустимое имя параметра времени жизни",
+ "잘못된 수명 매개변수 이름"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+An invalid name was used for a lifetime parameter.
+
+The name `'static` cannot be used as a named lifetime parameter because
+it is a special built-in lifetime that denotes the lifetime of the
+entire program. It has special meaning in Rust and is reserved, so it
+cannot be redefined or used as a custom generic lifetime parameter.",
+ "\
+Для параметра времени жизни использовано недопустимое имя.
+
+Имя `'static` нельзя использовать как именованный параметр времени жизни,
+потому что это специальное встроенное время жизни, обозначающее время
+жизни всей программы.",
+ "\
+수명 매개변수에 잘못된 이름이 사용되었습니다.
+`'static`은 예약된 이름이므로 사용자 정의 수명 매개변수로 사용할 수 없습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Use a valid custom lifetime name",
+ "Используйте допустимое пользовательское имя времени жизни",
+ "유효한 사용자 정의 수명 이름 사용"
+ ),
+ code: "fn foo<'a>(x: &'a str) {}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Book: Static Lifetime",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#the-static-lifetime"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0262.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0263.rs b/masterror-knowledge/src/errors/lifetimes/e0263.rs
new file mode 100644
index 0000000..bdff4a7
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0263.rs
@@ -0,0 +1,54 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0263: duplicate lifetime declaration
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0263",
+ title: LocalizedText::new(
+ "Duplicate lifetime declaration",
+ "Дублирующееся объявление времени жизни",
+ "중복된 수명 선언"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A lifetime was declared more than once in the same scope.
+
+A lifetime parameter cannot have the same name as another lifetime
+parameter within the same function or generic declaration.
+
+Note: This error code is no longer emitted by the compiler.",
+ "\
+Время жизни было объявлено более одного раза в той же области видимости.
+
+Параметр времени жизни не может иметь то же имя, что и другой параметр
+времени жизни в той же функции или обобщённом объявлении.
+
+Примечание: Этот код ошибки больше не выдаётся компилятором.",
+ "\
+수명이 같은 범위에서 두 번 이상 선언되었습니다.
+참고: 이 오류 코드는 더 이상 컴파일러에서 발생하지 않습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Rename duplicate lifetime to unique identifier",
+ "Переименуйте дублирующееся время жизни в уникальный идентификатор",
+ "중복된 수명을 고유 식별자로 이름 변경"
+ ),
+ code: "fn foo<'a, 'b, 'c>(x: &'a str, y: &'b str, z: &'c str) {}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Book: Lifetimes",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0263.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0309.rs b/masterror-knowledge/src/errors/lifetimes/e0309.rs
new file mode 100644
index 0000000..f9c366f
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0309.rs
@@ -0,0 +1,60 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0309: parameter type is missing an explicit lifetime bound
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0309",
+ title: LocalizedText::new(
+ "Parameter type is missing an explicit lifetime bound",
+ "Параметр типа не имеет явного ограничения времени жизни",
+ "매개변수 타입에 명시적 라이프타임 바운드가 없음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A type parameter lacks an explicit lifetime bound required by an associated
+type constraint. The compiler cannot verify that all data in the type T is
+valid for the required lifetime 'a.
+
+This commonly happens when:
+- A struct field uses an associated type like >::Output
+- The trait implementation requires a lifetime bound (e.g., T: 'a)
+- The struct definition doesn't declare this same bound in its where-clause",
+ "\
+Параметр типа не имеет явного ограничения времени жизни, требуемого
+ассоциированным типом. Компилятор не может проверить, что все данные
+в типе T действительны для требуемого времени жизни 'a.
+
+Это часто происходит когда:
+- Поле структуры использует ассоциированный тип
+- Реализация трейта требует ограничения времени жизни
+- Определение структуры не объявляет это ограничение",
+ "\
+타입 매개변수에 연관 타입 제약에 필요한 명시적 라이프타임 바운드가 없습니다.
+컴파일러는 타입 T의 모든 데이터가 필요한 라이프타임 'a에 유효한지 확인할 수 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Add lifetime bound to type parameter",
+ "Добавить ограничение времени жизни к параметру типа",
+ "타입 매개변수에 라이프타임 바운드 추가"
+ ),
+ code: "struct Foo<'a, T>\nwhere\n T: 'a,\n{\n foo: >::Output\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Lifetime Bounds",
+ url: "https://doc.rust-lang.org/reference/trait-bounds.html#lifetime-bounds"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0309.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0310.rs b/masterror-knowledge/src/errors/lifetimes/e0310.rs
new file mode 100644
index 0000000..bfc5687
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0310.rs
@@ -0,0 +1,56 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0310: parameter type may not live long enough (requires 'static)
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0310",
+ title: LocalizedText::new(
+ "Parameter type may not live long enough",
+ "Параметр типа может не жить достаточно долго",
+ "매개변수 타입이 충분히 오래 살지 않을 수 있음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+Type parameters in type definitions have lifetimes associated with them that
+represent how long the data stored within them is guaranteed to live. When a
+type parameter is used with a reference that requires a specific lifetime
+(like 'static), the type parameter must be constrained to meet that requirement.
+
+Example: struct Foo { foo: &'static T } fails because T is not constrained
+to the 'static lifetime that the reference requires.",
+ "\
+Параметры типов имеют связанные с ними времена жизни, которые представляют,
+как долго данные гарантированно существуют. Когда параметр типа используется
+со ссылкой, требующей определённого времени жизни (например 'static),
+параметр типа должен быть ограничен для соответствия этому требованию.",
+ "\
+타입 정의의 타입 매개변수에는 저장된 데이터가 얼마나 오래 유효한지를 나타내는
+라이프타임이 연결되어 있습니다. 타입 매개변수가 특정 라이프타임('static 등)을
+요구하는 참조와 함께 사용될 때, 해당 요구사항을 충족하도록 제약되어야 합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Add 'static lifetime bound to type parameter",
+ "Добавить ограничение 'static к параметру типа",
+ "타입 매개변수에 'static 라이프타임 바운드 추가"
+ ),
+ code: "struct Foo {\n foo: &'static T\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Static Lifetime",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#the-static-lifetime"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0310.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0311.rs b/masterror-knowledge/src/errors/lifetimes/e0311.rs
new file mode 100644
index 0000000..9e6f498
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0311.rs
@@ -0,0 +1,56 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0311: unsatisfied outlives bound with elided region
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0311",
+ title: LocalizedText::new(
+ "Unsatisfied outlives bound with elided region",
+ "Неудовлетворённое ограничение outlives с опущенным временем жизни",
+ "생략된 영역으로 인한 outlives 바운드 불만족"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+This error occurs when there is an unsatisfied outlives bound involving an
+elided region and a generic type parameter. The compiler automatically adds
+lifetime bounds based on function signatures, and when these don't align with
+generic parameter requirements, this error is raised.
+
+The fix is to explicitly name the elided lifetime and add the outlives bound
+to the generic parameter.",
+ "\
+Эта ошибка возникает, когда есть неудовлетворённое ограничение outlives,
+включающее опущенное время жизни и параметр обобщённого типа. Компилятор
+автоматически добавляет ограничения времени жизни на основе сигнатур функций,
+и когда они не согласуются с требованиями параметра, возникает эта ошибка.",
+ "\
+생략된 영역과 제네릭 타입 매개변수를 포함하는 outlives 바운드가 충족되지 않을 때
+이 오류가 발생합니다. 컴파일러는 함수 시그니처를 기반으로 라이프타임 바운드를
+자동으로 추가하며, 이것이 제네릭 매개변수 요구사항과 맞지 않으면 이 오류가 발생합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Explicitly name elided lifetime and add bound",
+ "Явно указать опущенное время жизни и добавить ограничение",
+ "생략된 라이프타임을 명시하고 바운드 추가"
+ ),
+ code: "fn no_restriction<'a, T: 'a>(x: &'a ()) -> &'a () {\n with_restriction::(x)\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Lifetime Elision",
+ url: "https://doc.rust-lang.org/reference/lifetime-elision.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0311.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0316.rs b/masterror-knowledge/src/errors/lifetimes/e0316.rs
new file mode 100644
index 0000000..c8f66b0
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0316.rs
@@ -0,0 +1,58 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0316: nested quantification over lifetimes in where clause
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0316",
+ title: LocalizedText::new(
+ "Nested quantification over lifetimes",
+ "Вложенная квантификация по временам жизни",
+ "라이프타임에 대한 중첩 한정"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A where clause contains a nested quantification over lifetimes, which is not
+supported in Rust. Rust syntax allows lifetime quantifications in two places:
+1. Quantifying over the trait bound only: Ty: for<'l> Trait<'l>
+2. Quantifying over the whole clause: for<'l> &'l Ty: Trait<'l>
+
+However, using both in the same clause leads to nested lifetime quantification.",
+ "\
+Where-клауза содержит вложенную квантификацию по временам жизни, которая
+не поддерживается в Rust. Синтаксис Rust позволяет квантификацию в двух местах:
+1. Квантификация только по trait bound: Ty: for<'l> Trait<'l>
+2. Квантификация по всей клаузе: for<'l> &'l Ty: Trait<'l>
+
+Использование обоих приводит к вложенной квантификации.",
+ "\
+where 절에 중첩된 라이프타임 한정이 포함되어 있으며, 이는 Rust에서 지원되지 않습니다.
+Rust 문법은 두 위치에서 라이프타임 한정을 허용합니다:
+1. 트레이트 바운드만 한정: Ty: for<'l> Trait<'l>
+2. 전체 절 한정: for<'l> &'l Ty: Trait<'l>"
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Combine lifetime parameters in single for<>",
+ "Объединить параметры времени жизни в один for<>",
+ "단일 for<>에서 라이프타임 매개변수 결합"
+ ),
+ code: "fn foo(t: T)\nwhere\n for<'a, 'b> &'a T: Tr<'a, 'b>,\n{\n}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Reference: Higher-Ranked Trait Bounds",
+ url: "https://doc.rust-lang.org/reference/trait-bounds.html#higher-ranked-trait-bounds"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0316.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0478.rs b/masterror-knowledge/src/errors/lifetimes/e0478.rs
new file mode 100644
index 0000000..b252153
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0478.rs
@@ -0,0 +1,48 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0478: lifetime bound not satisfied
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0478",
+ title: LocalizedText::new(
+ "Lifetime bound not satisfied",
+ "Ограничение времени жизни не выполнено",
+ "라이프타임 바운드가 충족되지 않음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A lifetime parameter doesn't satisfy the required lifetime bounds of a trait
+or type. When a trait has a lifetime bound (superbound), any type implementing
+or using that trait must ensure its lifetimes respect those bounds.
+
+The bound 'a: 'b means 'a must live at least as long as 'b.",
+ "\
+Параметр времени жизни не удовлетворяет требуемым ограничениям трейта
+или типа. Когда трейт имеет ограничение времени жизни (superbound),
+любой тип, реализующий или использующий этот трейт, должен обеспечить
+соответствие своих времён жизни этим ограничениям.
+
+Ограничение 'a: 'b означает, что 'a должно жить не меньше чем 'b.",
+ "\
+라이프타임 매개변수가 트레이트 또는 타입의 필수 라이프타임 바운드를
+충족하지 않습니다. 'a: 'b 바운드는 'a가 최소한 'b만큼 살아야 함을
+의미합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Add lifetime bound to enforce relationship",
+ "Добавить ограничение времени жизни",
+ "관계를 강제하기 위해 라이프타임 바운드 추가"
+ ),
+ code: "struct Prince<'kiss, 'snow: 'kiss> {\n child: Box + 'snow>,\n}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0478.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0482.rs b/masterror-knowledge/src/errors/lifetimes/e0482.rs
new file mode 100644
index 0000000..2169687
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0482.rs
@@ -0,0 +1,59 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0482: lifetime of returned value doesn't outlive function call
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0482",
+ title: LocalizedText::new(
+ "Lifetime of returned value doesn't outlive function call",
+ "Время жизни возвращаемого значения не переживает вызов функции",
+ "반환된 값의 라이프타임이 함수 호출보다 오래 살지 않음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+This error occurs when using impl Trait in return types with lifetimes that
+don't properly align. The issue arises because impl Trait implicitly applies
+a 'static lifetime restriction, but the actual data may only live for a
+shorter lifetime.
+
+Note: This error is no longer emitted by modern compilers.",
+ "\
+Эта ошибка возникает при использовании impl Trait в возвращаемых типах
+с неправильно согласованными временами жизни. Проблема в том, что
+impl Trait неявно применяет ограничение 'static, но данные могут жить
+только более короткое время.
+
+Примечание: эта ошибка больше не выдаётся современными компиляторами.",
+ "\
+이 오류는 라이프타임이 제대로 정렬되지 않는 반환 타입에서 impl Trait를
+사용할 때 발생합니다. impl Trait가 암묵적으로 'static 라이프타임
+제한을 적용하기 때문입니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Add lifetime bounds to impl Trait",
+ "Добавить ограничения времени жизни к impl Trait",
+ "impl Trait에 라이프타임 바운드 추가"
+ ),
+ code: "fn prefix<'a>(\n words: impl Iterator- + 'a\n) -> impl Iterator
- + 'a {\n words.map(|v| format!(\"foo-{}\", v))\n}"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use 'static lifetime",
+ "Использовать время жизни 'static",
+ "'static 라이프타임 사용"
+ ),
+ code: "fn prefix(\n words: impl Iterator
- \n) -> impl Iterator
- {\n words.map(|v| format!(\"foo-{}\", v))\n}"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0482.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0491.rs b/masterror-knowledge/src/errors/lifetimes/e0491.rs
new file mode 100644
index 0000000..5c518ff
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0491.rs
@@ -0,0 +1,44 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0491: reference has longer lifetime than data it references
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0491",
+ title: LocalizedText::new(
+ "Reference has longer lifetime than data it references",
+ "Ссылка имеет большее время жизни чем данные",
+ "참조가 참조하는 데이터보다 긴 라이프타임을 가짐"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+The compiler cannot guarantee that a lifetime parameter will outlive another
+lifetime parameter in a reference type. When you have a reference with
+lifetime 'a to data with lifetime 'b, 'b must outlive 'a to ensure the
+reference is always valid.",
+ "\
+Компилятор не может гарантировать, что один параметр времени жизни
+переживёт другой в ссылочном типе. Когда есть ссылка с временем жизни 'a
+на данные с временем жизни 'b, 'b должно пережить 'a, чтобы ссылка
+всегда была действительна.",
+ "\
+컴파일러가 참조 타입에서 한 라이프타임 매개변수가 다른 라이프타임
+매개변수보다 오래 살 것을 보장할 수 없습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Add lifetime bound to enforce that 'b outlives 'a",
+ "Добавить ограничение, чтобы 'b пережило 'a",
+ "'b가 'a보다 오래 살도록 라이프타임 바운드 추가"
+ ),
+ code: "impl<'a, 'b: 'a> Trait<'a, 'b> for usize {\n type Out = &'a Foo<'b>; // works!\n}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0491.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0495.rs b/masterror-knowledge/src/errors/lifetimes/e0495.rs
new file mode 100644
index 0000000..a5ce0a0
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0495.rs
@@ -0,0 +1,38 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0495: cannot infer an appropriate lifetime
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0495",
+ title: LocalizedText::new(
+ "Cannot infer an appropriate lifetime",
+ "Невозможно вывести подходящее время жизни",
+ "적절한 라이프타임을 추론할 수 없음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+The compiler found conflicting lifetime requirements and couldn't
+determine which one to use.",
+ "\
+Компилятор обнаружил конфликтующие требования времён жизни.",
+ "\
+컴파일러가 충돌하는 라이프타임 요구사항을 찾았습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Add explicit lifetime bounds",
+ "Добавить явные ограничения времени жизни",
+ "명시적 라이프타임 바운드 추가"
+ ),
+ code: "fn process<'a, 'b: 'a>(x: &'a str, y: &'b str) -> &'a str"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0495.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0496.rs b/masterror-knowledge/src/errors/lifetimes/e0496.rs
new file mode 100644
index 0000000..3c9a1b4
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0496.rs
@@ -0,0 +1,43 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0496: lifetime name shadowing
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0496",
+ title: LocalizedText::new(
+ "Lifetime name shadows another lifetime",
+ "Имя времени жизни затеняет другое время жизни",
+ "라이프타임 이름이 다른 라이프타임을 가림"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+The same lifetime name was used in nested scopes, causing the inner lifetime
+to shadow (hide) the outer lifetime. This is not allowed in Rust because it
+creates ambiguity about which lifetime is being referenced.",
+ "\
+Одно и то же имя времени жизни использовано во вложенных областях
+видимости, из-за чего внутреннее время жизни затеняет внешнее.
+Это запрещено в Rust, так как создаёт неоднозначность.",
+ "\
+중첩된 스코프에서 같은 라이프타임 이름이 사용되어 내부 라이프타임이
+외부 라이프타임을 가립니다. 이는 어떤 라이프타임이 참조되는지
+모호함을 만들기 때문에 Rust에서 허용되지 않습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Rename one of the conflicting lifetimes",
+ "Переименовать одно из конфликтующих времён жизни",
+ "충돌하는 라이프타임 중 하나의 이름 변경"
+ ),
+ code: "struct Foo<'a> {\n a: &'a i32,\n}\n\nimpl<'a> Foo<'a> {\n fn f<'b>(x: &'b i32) {} // Use 'b instead of 'a\n}"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0496.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0515.rs b/masterror-knowledge/src/errors/lifetimes/e0515.rs
new file mode 100644
index 0000000..f8ca6a2
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0515.rs
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0515: cannot return reference to temporary value
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0515",
+ title: LocalizedText::new(
+ "Cannot return reference to temporary value",
+ "Нельзя вернуть ссылку на временное значение",
+ "임시 값에 대한 참조를 반환할 수 없음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+You're trying to return a reference to a value that was created inside
+the function. When the function returns, that value is dropped.
+
+The reference would point to freed memory - a dangling pointer.",
+ "\
+Вы пытаетесь вернуть ссылку на значение, созданное внутри функции.
+При возврате из функции это значение будет уничтожено.",
+ "\
+함수 내에서 생성된 값에 대한 참조를 반환하려고 합니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Return owned value instead of reference",
+ "Вернуть владеющее значение вместо ссылки",
+ "참조 대신 소유 값 반환"
+ ),
+ code: "fn create() -> String { String::from(\"hello\") }"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use a parameter lifetime",
+ "Использовать время жизни параметра",
+ "매개변수 라이프타임 사용"
+ ),
+ code: "fn longest<'a>(x: &'a str, y: &'a str) -> &'a str"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0515.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0581.rs b/masterror-knowledge/src/errors/lifetimes/e0581.rs
new file mode 100644
index 0000000..3db317f
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0581.rs
@@ -0,0 +1,56 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0581: lifetime appears only in return type
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0581",
+ title: LocalizedText::new(
+ "Lifetime appears only in return type",
+ "Время жизни появляется только в возвращаемом типе",
+ "라이프타임이 반환 타입에서만 나타남"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+In a `fn` type, a lifetime parameter must appear in both the argument types
+and return type. If a lifetime appears only in the return type and not in
+the arguments, it's impossible to determine how long the lifetime should
+actually be, since there's nothing constraining it.
+
+This restriction ensures the compiler can properly track lifetime relationships.",
+ "\
+В типе `fn` параметр времени жизни должен появляться как в типах аргументов,
+так и в возвращаемом типе. Если время жизни появляется только в возвращаемом
+типе, невозможно определить, каким оно должно быть на самом деле.",
+ "\
+`fn` 타입에서 라이프타임 매개변수는 인수 타입과 반환 타입 모두에 나타나야 합니다.
+라이프타임이 인수가 아닌 반환 타입에만 나타나면 라이프타임이 실제로 얼마나
+길어야 하는지 결정할 수 없습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use lifetime in both arguments and return type",
+ "Использовать время жизни и в аргументах, и в возвращаемом типе",
+ "인수와 반환 타입 모두에서 라이프타임 사용"
+ ),
+ code: "let x: for<'a> fn(&'a i32) -> &'a i32;"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use 'static lifetime for return-only case",
+ "Использовать 'static для случая только возврата",
+ "반환 전용 케이스에 'static 라이프타임 사용"
+ ),
+ code: "let y: fn() -> &'static i32;"
+ }
+ ],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0581.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0582.rs b/masterror-knowledge/src/errors/lifetimes/e0582.rs
new file mode 100644
index 0000000..991b8f1
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0582.rs
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0582: lifetime only in associated-type binding
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0582",
+ title: LocalizedText::new(
+ "Lifetime only present in associated-type binding",
+ "Время жизни присутствует только в привязке ассоциированного типа",
+ "라이프타임이 연관 타입 바인딩에서만 존재"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A lifetime is only present in an associated-type binding, and not in the input
+types to the trait. This creates an unsatisfiable constraint because the
+compiler cannot guarantee that the lifetime is actually used.
+
+The lifetime must also appear in the input types to properly constrain it.",
+ "\
+Время жизни присутствует только в привязке ассоциированного типа, а не
+во входных типах трейта. Это создаёт неудовлетворимое ограничение, поскольку
+компилятор не может гарантировать, что время жизни действительно используется.
+
+Время жизни должно также появляться во входных типах.",
+ "\
+라이프타임이 연관 타입 바인딩에만 존재하고 트레이트의 입력 타입에는 없습니다.
+이는 컴파일러가 라이프타임이 실제로 사용된다는 것을 보장할 수 없기 때문에
+충족할 수 없는 제약을 만듭니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Include lifetime in input types",
+ "Включить время жизни во входные типы",
+ "입력 타입에 라이프타임 포함"
+ ),
+ code: "where F: for<'a> Fn(&'a i32) -> Option<&'a i32>"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0582.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0597.rs b/masterror-knowledge/src/errors/lifetimes/e0597.rs
new file mode 100644
index 0000000..bf3f11f
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0597.rs
@@ -0,0 +1,57 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0597: value does not live long enough
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0597",
+ title: LocalizedText::new(
+ "Value does not live long enough",
+ "Значение живёт недостаточно долго",
+ "값이 충분히 오래 살지 않음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+You're creating a reference to something that will be destroyed before
+the reference is used. This would create a dangling pointer.
+
+Rust prevents this at compile time. The referenced value must live at
+least as long as the reference itself.",
+ "\
+Вы создаёте ссылку на что-то, что будет уничтожено до использования ссылки.",
+ "\
+참조가 사용되기 전에 파괴될 것에 대한 참조를 만들고 있습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Move value to outer scope",
+ "Переместить значение во внешнюю область",
+ "값을 외부 스코프로 이동"
+ ),
+ code: "let s = String::from(\"hello\"); // declare before use"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Return owned value instead",
+ "Вернуть владеющее значение",
+ "소유 값 반환"
+ ),
+ code: "fn get() -> String { s.to_string() }"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Rust Book: Lifetimes",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0597.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0621.rs b/masterror-knowledge/src/errors/lifetimes/e0621.rs
new file mode 100644
index 0000000..b7247fc
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0621.rs
@@ -0,0 +1,38 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0621: explicit lifetime required in the type of X
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0621",
+ title: LocalizedText::new(
+ "Explicit lifetime required in the type",
+ "Требуется явное время жизни в типе",
+ "타입에 명시적 라이프타임이 필요함"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+The compiler cannot infer lifetimes in this context. You need to add
+explicit lifetime annotations to show how references relate.",
+ "\
+Компилятор не может вывести времена жизни в этом контексте.",
+ "\
+컴파일러가 이 컨텍스트에서 라이프타임을 추론할 수 없습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Add lifetime parameter to function",
+ "Добавить параметр времени жизни к функции",
+ "함수에 라이프타임 매개변수 추가"
+ ),
+ code: "fn process<'a>(data: &'a str) -> &'a str { data }"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0621.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0623.rs b/masterror-knowledge/src/errors/lifetimes/e0623.rs
new file mode 100644
index 0000000..152bb3b
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0623.rs
@@ -0,0 +1,37 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0623: lifetime mismatch
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0623",
+ title: LocalizedText::new(
+ "Lifetime mismatch",
+ "Несоответствие времён жизни",
+ "라이프타임 불일치"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+Two lifetimes in your code don't match where they should.",
+ "\
+Два времени жизни в коде не совпадают там, где должны.",
+ "\
+코드에서 두 라이프타임이 일치해야 하는 곳에서 일치하지 않습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Ensure consistent lifetime annotations",
+ "Обеспечить согласованные аннотации",
+ "일관된 라이프타임 어노테이션 확보"
+ ),
+ code: "fn foo<'a>(x: &'a str) -> &'a str { x }"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0623.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0625.rs b/masterror-knowledge/src/errors/lifetimes/e0625.rs
new file mode 100644
index 0000000..3df7da6
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0625.rs
@@ -0,0 +1,53 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0625: const cannot refer to thread-local static
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0625",
+ title: LocalizedText::new(
+ "Const cannot refer to thread-local static",
+ "Константа не может ссылаться на thread-local static",
+ "const는 thread-local static을 참조할 수 없음"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A compile-time const variable is referring to a thread-local static variable.
+
+Const variables cannot depend on thread-local statics because const values
+must be evaluated at compile time, while thread-local statics are inherently
+runtime-dependent.",
+ "\
+Константа времени компиляции ссылается на thread-local static переменную.
+
+Константы не могут зависеть от thread-local statics, потому что значения
+констант должны быть вычислены во время компиляции, тогда как thread-local
+statics по своей природе зависят от времени выполнения.",
+ "\
+컴파일 시간 const 변수가 thread-local static 변수를 참조하고 있습니다.
+const 값은 컴파일 시간에 평가되어야 하지만 thread-local statics는
+본질적으로 런타임 의존적입니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Extract value as separate const",
+ "Извлечь значение как отдельную константу",
+ "값을 별도의 const로 추출"
+ ),
+ code: "const C: usize = 12;\n\n#[thread_local]\nstatic X: usize = C;\n\nconst Y: usize = 2 * C; // both refer to const C"
+ }],
+ links: &[
+ DocLink {
+ title: "Constants",
+ url: "https://doc.rust-lang.org/reference/items/constant-items.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0625.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0626.rs b/masterror-knowledge/src/errors/lifetimes/e0626.rs
new file mode 100644
index 0000000..db5addd
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0626.rs
@@ -0,0 +1,66 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0626: borrow persists across yield point
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0626",
+ title: LocalizedText::new(
+ "Borrow in coroutine persists across yield point",
+ "Заимствование в сопрограмме сохраняется через точку yield",
+ "코루틴의 빌림이 yield 지점을 넘어 지속됨"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A borrow remains in scope across a `yield` point in a movable (unmarked)
+coroutine. This is not permitted because the coroutine could be moved while
+the borrow is still active, violating borrow safety rules.
+
+In an unmarked (movable) coroutine, you cannot have a borrow that is still
+in scope when a `yield` occurs.",
+ "\
+Заимствование остаётся в области видимости через точку `yield` в подвижной
+(непомеченной) сопрограмме. Это не разрешено, потому что сопрограмма может
+быть перемещена, пока заимствование ещё активно, нарушая правила
+безопасности заимствования.
+
+В непомеченной (подвижной) сопрограмме у вас не может быть заимствования,
+которое ещё находится в области видимости при выполнении `yield`.",
+ "\
+이동 가능한(표시되지 않은) 코루틴에서 빌림이 `yield` 지점을 넘어
+범위 내에 남아 있습니다. 코루틴이 빌림이 활성화된 상태에서 이동될 수
+있어 빌림 안전 규칙을 위반할 수 있으므로 허용되지 않습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Mark the coroutine as static",
+ "Пометить сопрограмму как static",
+ "코루틴을 static으로 표시"
+ ),
+ code: "let mut b = #[coroutine] static || {\n let a = &String::from(\"hello\");\n yield ();\n println!(\"{}\", a);\n};"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Store by value instead of borrowing",
+ "Хранить по значению вместо заимствования",
+ "빌림 대신 값으로 저장"
+ ),
+ code: "let mut b = #[coroutine] || {\n let a = String::from(\"hello\");\n yield ();\n println!(\"{}\", a);\n};"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Coroutines",
+ url: "https://doc.rust-lang.org/std/ops/trait.Coroutine.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0626.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0637.rs b/masterror-knowledge/src/errors/lifetimes/e0637.rs
new file mode 100644
index 0000000..2b626c4
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0637.rs
@@ -0,0 +1,66 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0637: underscore lifetime used illegally
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0637",
+ title: LocalizedText::new(
+ "'_ lifetime used in illegal place",
+ "Время жизни '_ использовано в недопустимом месте",
+ "'_ 라이프타임이 잘못된 위치에서 사용됨"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+The `'_` lifetime name or `&T` without an explicit lifetime name has been
+used in an illegal place.
+
+The `'_` lifetime is reserved for the anonymous lifetime and cannot be
+used as a named lifetime identifier in some places. Similarly, `&T` without
+an explicit lifetime name is not permitted in certain contexts like trait
+bounds and where clauses.",
+ "\
+Имя времени жизни `'_` или `&T` без явного имени времени жизни было
+использовано в недопустимом месте.
+
+Время жизни `'_` зарезервировано для анонимного времени жизни и не может
+использоваться как именованный идентификатор времени жизни в некоторых
+местах. Аналогично, `&T` без явного имени времени жизни не допускается
+в определённых контекстах, таких как ограничения трейтов и where-предложения.",
+ "\
+`'_` 라이프타임 이름 또는 명시적 라이프타임 이름이 없는 `&T`가
+잘못된 위치에서 사용되었습니다."
+ ),
+ fixes: &[
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use explicit lifetime name",
+ "Использовать явное имя времени жизни",
+ "명시적 라이프타임 이름 사용"
+ ),
+ code: "fn foo<'a>(str1: &'a str, str2: &'a str) -> &'a str { }"
+ },
+ FixSuggestion {
+ description: LocalizedText::new(
+ "Use higher-ranked trait bounds",
+ "Использовать ограничения трейтов высшего ранга",
+ "고차 트레이트 바운드 사용"
+ ),
+ code: "fn foo()\nwhere\n T: for<'a> Into<&'a u32>,\n{}"
+ }
+ ],
+ links: &[
+ DocLink {
+ title: "Lifetime Elision",
+ url: "https://doc.rust-lang.org/reference/lifetime-elision.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0637.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0657.rs b/masterror-knowledge/src/errors/lifetimes/e0657.rs
new file mode 100644
index 0000000..1535653
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0657.rs
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0657: impl Trait captures higher-ranked lifetime
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0657",
+ title: LocalizedText::new(
+ "impl Trait captured higher-ranked lifetime",
+ "impl Trait захватил время жизни высшего ранга",
+ "impl Trait가 고차 라이프타임을 캡처함"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+An `impl Trait` type attempts to capture a higher-ranked lifetime
+(a lifetime introduced by a `for<'a>` binder), which is not supported.
+
+`impl Trait` types are only allowed to capture lifetimes from their parent
+items, not from any `for<'a>` binders in scope.",
+ "\
+Тип `impl Trait` пытается захватить время жизни высшего ранга
+(время жизни, введённое связывателем `for<'a>`), что не поддерживается.
+
+Типам `impl Trait` разрешено захватывать только времена жизни из их
+родительских элементов, но не из связывателей `for<'a>` в области видимости.",
+ "\
+`impl Trait` 타입이 고차 라이프타임(`for<'a>` 바인더로 도입된
+라이프타임)을 캡처하려고 시도하는데, 이는 지원되지 않습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Avoid capturing higher-ranked lifetimes in impl Trait",
+ "Избегать захвата времён жизни высшего ранга в impl Trait",
+ "impl Trait에서 고차 라이프타임 캡처 피하기"
+ ),
+ code: "// Refactor to use concrete types for associated types"
+ }],
+ links: &[
+ DocLink {
+ title: "Higher-Ranked Trait Bounds",
+ url: "https://doc.rust-lang.org/nomicon/hrtb.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0657.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0700.rs b/masterror-knowledge/src/errors/lifetimes/e0700.rs
new file mode 100644
index 0000000..f0ec8d0
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0700.rs
@@ -0,0 +1,39 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0700: hidden type captures lifetime
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0700",
+ title: LocalizedText::new(
+ "Hidden type captures lifetime",
+ "Скрытый тип захватывает время жизни",
+ "숨겨진 타입이 라이프타임을 캡처함"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+When using `impl Trait` return type, the hidden concrete type captures
+a lifetime that isn't declared in the function signature.",
+ "\
+При использовании типа возврата `impl Trait` скрытый конкретный тип
+захватывает время жизни, не объявленное в сигнатуре.",
+ "\
+`impl Trait` 반환 타입을 사용할 때, 숨겨진 구체적 타입이 선언되지 않은 라이프타임을 캡처합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Declare the captured lifetime",
+ "Объявить захваченное время жизни",
+ "캡처된 라이프타임 선언"
+ ),
+ code: "fn foo<'a>(x: &'a str) -> impl Iterator- + 'a"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0700.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0716.rs b/masterror-knowledge/src/errors/lifetimes/e0716.rs
new file mode 100644
index 0000000..f12a054
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0716.rs
@@ -0,0 +1,40 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0716: temporary value dropped while borrowed
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0716",
+ title: LocalizedText::new(
+ "Temporary value dropped while borrowed",
+ "Временное значение уничтожено во время заимствования",
+ "빌린 동안 임시 값이 삭제됨"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A temporary value was created, borrowed, and then immediately dropped.
+The borrow outlives the temporary.
+
+Temporaries only live until the end of the statement by default.",
+ "\
+Было создано временное значение, заимствовано и сразу уничтожено.",
+ "\
+임시 값이 생성되고, 빌려지고, 즉시 삭제되었습니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Bind temporary to a variable",
+ "Привязать временное значение к переменной",
+ "임시 값을 변수에 바인딩"
+ ),
+ code: "let value = create_value();\nlet reference = &value;"
+ }],
+ links: &[DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0716.html"
+ }]
+};
diff --git a/masterror-knowledge/src/errors/lifetimes/e0803.rs b/masterror-knowledge/src/errors/lifetimes/e0803.rs
new file mode 100644
index 0000000..05661f8
--- /dev/null
+++ b/masterror-knowledge/src/errors/lifetimes/e0803.rs
@@ -0,0 +1,71 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! E0803: lifetime mismatch in trait implementation
+
+use crate::errors::{Category, DocLink, ErrorEntry, FixSuggestion, LocalizedText};
+
+pub static ENTRY: ErrorEntry = ErrorEntry {
+ code: "E0803",
+ title: LocalizedText::new(
+ "Lifetime mismatch in trait implementation",
+ "Несоответствие времён жизни в реализации трейта",
+ "트레이트 구현에서 라이프타임 불일치"
+ ),
+ category: Category::Lifetimes,
+ explanation: LocalizedText::new(
+ "\
+A trait implementation returns a reference without an explicit lifetime
+linking it to `self`. This commonly arises in generic trait implementations
+requiring explicit lifetime bounds.
+
+The issue occurs when:
+- A trait method returns a reference
+- The trait is implemented for a struct with a lifetime parameter
+- The compiler cannot verify if the returned reference satisfies constraints
+
+Solution: Explicitly bind lifetimes in the trait definition and implementation.",
+ "\
+Реализация трейта возвращает ссылку без явного времени жизни,
+связывающего её с `self`. Это часто возникает в обобщённых
+реализациях трейтов, требующих явных ограничений времени жизни.
+
+Проблема возникает когда:
+- Метод трейта возвращает ссылку
+- Трейт реализован для структуры с параметром времени жизни
+- Компилятор не может проверить, удовлетворяет ли ссылка ограничениям
+
+Решение: явно привязать времена жизни в определении и реализации трейта.",
+ "\
+트레이트 구현이 `self`에 명시적 라이프타임 연결 없이 참조를 반환합니다.
+이는 명시적 라이프타임 바운드가 필요한 제네릭 트레이트 구현에서 자주 발생합니다."
+ ),
+ fixes: &[FixSuggestion {
+ description: LocalizedText::new(
+ "Add lifetime parameter to trait",
+ "Добавить параметр времени жизни в трейт",
+ "트레이트에 라이프타임 매개변수 추가"
+ ),
+ code: "\
+trait DataAccess<'a, T> {
+ fn get_ref(&'a self) -> T;
+}
+
+impl<'a> DataAccess<'a, &'a f64> for Container<'a> {
+ fn get_ref(&'a self) -> &'a f64 {
+ self.value
+ }
+}"
+ }],
+ links: &[
+ DocLink {
+ title: "Rust Book: Lifetimes",
+ url: "https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"
+ },
+ DocLink {
+ title: "Error Code Reference",
+ url: "https://doc.rust-lang.org/error_codes/E0803.html"
+ }
+ ]
+};
diff --git a/masterror-knowledge/src/errors/linking.rs b/masterror-knowledge/src/errors/linking.rs
new file mode 100644
index 0000000..65f8b73
--- /dev/null
+++ b/masterror-knowledge/src/errors/linking.rs
@@ -0,0 +1,25 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm
+//
+// SPDX-License-Identifier: MIT
+
+//! Crate linking related errors.
+
+mod e0460;
+mod e0461;
+mod e0462;
+mod e0463;
+mod e0464;
+
+use super::ErrorEntry;
+
+static ENTRIES: &[&ErrorEntry] = &[
+ &e0460::ENTRY,
+ &e0461::ENTRY,
+ &e0462::ENTRY,
+ &e0463::ENTRY,
+ &e0464::ENTRY
+];
+
+pub fn entries() -> &'static [&'static ErrorEntry] {
+ ENTRIES
+}
diff --git a/masterror-knowledge/src/errors/linking/e0460.rs b/masterror-knowledge/src/errors/linking/e0460.rs
new file mode 100644
index 0000000..48f5d73
--- /dev/null
+++ b/masterror-knowledge/src/errors/linking/e0460.rs
@@ -0,0 +1,58 @@
+// SPDX-FileCopyrightText: 2025-2026 RAprogramm