rustc-driver-frontend

Builds custom Rust compiler frontends consuming crate dependency metadata via rustc_driver callbacks.

2|1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/nikomatsakis/sage-dev --skill rustc-driver-frontend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rustc-driver-frontend
Source: https://github.com/nikomatsakis/sage-dev/tree/main/.agents/skills/rustc-driver
Command: npx skills add https://github.com/nikomatsakis/sage-dev --skill rustc-driver-frontend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill allows you to build an alternate Rust compiler frontend, analyzer, or tool that needs to consume dependency metadata from Rust crates without decoding rlibs by hand.

Core Features & Use Cases

  • Dependency Metadata Consumption: Use this skill to consume types, traits, impls, and MIR from Rust crates.
  • Custom Driver Pattern: Covers the rustc_driver custom-driver pattern and hooking rustc_interface callbacks.
  • Use Case: Ideal for users designing a Rust compiler, type checker, verifier, or analysis tool that requires rustc's view of dependencies.

Quick Start

Use the rustc-driver-frontend skill to build a custom Rust compiler frontend that extracts dependency metadata from Rust crates.

Frequently Asked Questions about rustc-driver-frontend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I consume dependency metadata from Rust crates without decoding rlibs by hand?

To consume dependency metadata from Rust crates without decoding rlibs manually, you can build an alternate Rust compiler frontend using the rustc_driver custom-driver pattern. This approach hooks rustc_interface callbacks to directly access types, traits, impls, and MIR from dependencies.

How does the rustc_driver custom-driver pattern work for building a Rust compiler frontend?

The rustc_driver custom-driver pattern works by hooking rustc_interface callbacks to intercept and consume dependency metadata from Rust crates. This allows developers to construct an alternate Rust compiler frontend that directly accesses rustc's internal view of dependencies.

Can I use this custom driver approach to build a Rust type checker or verifier?

Yes, you can use this custom driver approach to build a Rust type checker, verifier, or analysis tool. It is specifically designed for development tasks that require rustc's view of dependencies, allowing you to extract necessary metadata like types and MIR from Rust crates.

What is the best way to extract types, traits, and MIR from Rust crates for an analysis tool?

The best way to extract types, traits, impls, and MIR from Rust crates for an analysis tool is to construct an alternate Rust compiler frontend. By consuming dependency metadata through the rustc_driver custom-driver pattern, you avoid manual rlibs decoding and get rustc's native view of the dependencies.

Do I need to decode rlibs manually to get rustc's view of dependencies for my custom Rust tool?

No, you do not need to decode rlibs manually to get rustc's view of dependencies for your custom Rust tool. By building an alternate Rust compiler frontend with the rustc_driver custom-driver pattern, you can consume the required dependency metadata directly from Rust crates.