chore - 1480 incan_ir and incan_emit are crates - #1577
Open
dannymeijer wants to merge 3 commits into
Open
dannymeijer wants to merge 3 commits into
dannymeijer wants to merge 3 commits into
Conversation
This was referenced Sep 15, 2026
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
backend/irsplits along the line the measurement on #1480 drew.loaves/compiler/incan_iris the IR and the lowering to it:lib.rs(the oldir/mod.rswithIrProgram,FunctionRegistry, the checked-C types),types,expr,stmt,decl,visit,surface_semantics,scanners,borrow_inference,lower/, and the IR-side numeric adapters — the analyses that read only the IR.loaves/compiler/incan_emitis everything that turns IR into Rust and everything built onconversions(2.7k lines that LAYOUT already put on the emit side):emit/,codegen,conversions,ownership,reference_shape,trait_bound_inference,emit_service,facade,prelude, the replacement backend (backend/replacement/) and backend selection (backend/selection.rs), plus thechecked_programtests. The root keepsbackend::iras a shim module that re-exports both crates under their old paths, socrate::backend::ir::…in the driver, CLI and LSP andincan::backend::ir::…intests/keep resolving;backend::replacementandbackend::selectionre-export the same way.One function crossed the line the wrong way and moves:
manifest_type_ref_from_ir, the IR→manifest type projection, was incodegenbut lowering needs it too, so it lives inincan_ir::typesnow. Five things the emit side reached in the root move below it:oven::compiler_suite_env(131 lines, std and serde only) andOVEN_LOAF_ENVbecomeoven_model::compiler_suite_env;oven::{digest_bytes, digest_content}becomeoven_model::digest;SDK_PROVIDER_BUILD_ENVjoins the frontend's provider contract; the root re-exports all of them under their old names. Tests that cross the cut move to the side that has everything they need: the four codegen tests that drive the project generator go tobackend::project::tests::codegen_generatorin the root, the two lowering tests that need an emission pass or plan toincan_emit::tests::lowering_through_emission, and the one executable-resolution test that needs a compilation session todriver::tests::executable_session. The codegen test helpers those root tests share becomeincan_emit::test_supportbehind atest_supportfeature, the pattern #1576 set;IrCodegen::{external_rust_functions, collect_external_rust_functions}becomepubfor the one moved test that reads them.Facts the split carries, each fixed here:
pub(crate) → puband thecrate::provider::rewrite reached intoquote!bodies and assertion strings and changed generated Rust — ten codegen snapshots caught it. Every rewrite in the split script now skips string literals, comments andquote!/quote_spanned!/parse_quote!bodies, and the snapshots are byte-identical.cargo test -p incan_emitruns from the crate directory:read_stdlib_programand the rust-inspect workspace a test points atCARGO_MANIFEST_DIRnow anchor atoven_model::toolchain_layout::development_root();include_str!ofzen.txtand theinclude!oftests/support/canonical_projection.rsclimb one more level.cargo test -p <crate>sees no stdlib semantics packs unless the crate says so:incan_irandincan_emitdefault torust_inspect+std_*like the frontend does, and the root depends on both withdefault-features = falseand forwards its own features.#[path]-includedsrc/oven/compiler_suite_env.rs; theyuse oven_model::compiler_suite_envnow.backend/replacementwas never in its roots, so its 17 sites are classified for the first time. Five functions the rustdoc gate sees as new get the rustdoc they never had.Type of change
docs/RFCs/*)Area(s)
Key details
incan_irdepends on the kernel crates,incan_frontend,oven_modelandrust_inspect;incan_emiton those plusincan_ir,syn/quote/proc-macro2/prettyplease,sha2/hex,regex.Cargo.lockgains both.pubis wider than the crates' eventual surface.backend/project/{generator,plan,lock_projection,cargo_toml,runner}.rsandbackend/shadowstay in the root for the driver and Oven steps.Testing / verification
cargo check -p incanin the six feature configurations;cargo clippy -p incan -p incan_ir -p incan_emit -p oven_model --all-targetsdefault and--all-featureswith-D warnings; rustdoc gate lastcargo test -p incan_ir— 140 tests;cargo test -p incan_emit— 519 tests;cargo test -p oven_model— 121cargo test --test codegen_snapshot_tests— 266 unchangedcargo test --test cli_layering_guardrails --test vocab_guardrails --test layering_guardbackend::project::tests,driver::tests,backend,driver::buildmake check-oven-ringmake test-one TEST_ROOT=tests/cli_surface_tests.rs TEST_EXACT=a_cargo_manifest_beside_a_loaf_manifest_warns_without_stopping_the_buildDocs impact
Checklist
Part of #1480 (slice 5, #1478). Builds on #1576: the branch carries its commit, so the diff shows both steps until #1576 lands and a merge-commit sync narrows it to this one.