crates.sage_test_harness.compile_tests.edition

The default fixture uses the latest Rust edition supported by the repository’s pinned toolchain. An explicit edition fixes an older supported edition; unknown editions fail setup.

Read in specification context · design/crates/sage_test_harness/compile-tests.md

Implementation

Implemented crates/sage-ir/src/scope.rs:15–20

sage_ir::scope · lib:sage_ir

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.edition`
impl Edition {
    pub fn parse(text: &str) -> Option<Self> {
        match text {
            "2015" => Some(Self::Rust2015),
            "2018" => Some(Self::Rust2018),

}

See more source ↗

Implemented crates/sage-test-harness/src/compile/rustc.rs:17–22

sage_test_harness::compile::rustc · lib:sage_test_harness

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.edition`
// {anchor}`crates.sage_test_harness.compile_tests.project_isolation`
pub(super) fn check(
    project: &Path,
    files: &BTreeMap<String, String>,
    edition: &str,

}

See more source ↗

Implemented crates/sage-test-harness/src/compile/mod.rs:107–112

sage_test_harness::compile · lib:sage_test_harness

#![allow(unused)]
fn main() {
        // {anchor}`crates.sage_test_harness.compile_tests.edition`
        if sage_ir::scope::Edition::parse(edition).is_none() {
            return Err(format!("unknown edition: {edition}"));
        }
        let mut markers = Vec::new();
        for (path, source) in &files {

}

See more source ↗

Implemented crates/sage-host/src/driver.rs:11–16

sage_host::driver · lib:sage_host

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.edition`
// {anchor}`crates.sage_test_harness.compile_tests.query_capture`
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::mpsc;


}

See more source ↗

Implemented crates/sage-host/src/metadata.rs:4–9

sage_host::metadata · lib:sage_host

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.edition`
// {anchor}`crates.sage_test_harness.compile_tests.project_isolation`
use std::collections::{HashMap, HashSet};
use std::path::{Path, PathBuf};
use std::process::Command;


}

See more source ↗

Tests and review

Indexed tests and the implementation-completeness and test-adequacy review; no test run is implied.

Implemented sage_test_harness::compile::edition_review_tests::default_edition_supplies_into_future_but_2021_does_not

crates/sage-test-harness/src/compile/mod.rs · lib:sage_test_harness

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_test_harness.compile_tests.edition)]
    fn default_edition_supplies_into_future_but_2021_does_not() {
        let mut current = CompileTest::default();
        current.source("fn f<T: IntoFuture>() {}");
        current.prepare().unwrap();
        let mut older = CompileTest::default();
        older.edition("2021");
        older.source("fn f<T: IntoFuture>() {} //# ERROR");
        older.diagnostics(expect_test::expect![""]);
        assert!(
            older
                .prepare()
                .unwrap()
                .diagnostics
                .contains("unresolved trait")
        );
    }
}

Conditional source: #[cfg(test)]

See more source ↗

Implemented sage_test_harness::compile::tests::unknown_edition_fails_setup

crates/sage-test-harness/src/compile/mod.rs · lib:sage_test_harness

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_test_harness.compile_tests.edition)]
    #[sage::test(crates.sage_test_harness.compile_tests.production_execution)]
    fn unknown_edition_fails_setup() {
        let mut test = CompileTest::default();
        test.source("");
        test.edition("future");
        assert!(test.prepare().unwrap_err().contains("unknown edition"));
    }
}

Conditional source: #[cfg(test)]

See more source ↗

Implemented sage_test_harness::explicit_edition_and_rustc_warning_marker

crates/sage-test-harness/tests/compile_tests.rs · test:compile_tests

#![allow(unused)]
fn main() {
#[test]
#[sage::test(crates.sage_test_harness.compile_tests.compiler_conditions)]
#[sage::test(crates.sage_test_harness.compile_tests.edition)]
fn explicit_edition_and_rustc_warning_marker() {
    compile_test! {
        diagnostics: expect![""],
        edition: "2021",
        source: "#[warn(dead_code)] fn example() {} //# WARN if rustc",
    }
}
}

See more source ↗

Review: Accepted · Codex anchor_010 refresh.

Freshly reviewed the current complete claim, all five ordinary implementation associations, and all three ordinary associated tests. There are no TODO/N/A entries. Requirements are latest supported default edition under the repository pin, retention of an explicitly selected older supported edition, and setup rejection of unknown editions.

CompileTest::prepare takes the explicit string or defaults to 2024, validates it through Edition::parse before filesystem/compiler setup, writes it into the generated Cargo manifest, and passes it into rustc::check. The current scope implementation enumerates 2015/2018/2021/2024, round-trips those values through as_str, and maps all other strings to None. Metadata loads the actual selected Cargo target edition without overriding it. Driver uses that edition for its embedded compiler arguments, root module and local crate; local_crate_with_edition asserts crate/root agreement. The independent rustc adapter passes the chosen edition as --edition; its current execute/validate_output refactoring preserves those arguments and rejects failed execution or diagnostics inconsistent with markers. These five implementation entries collectively cover the entire selection and propagation path. Captured rust-toolchain.toml pins nightly-2026-03-15; rustc --help executed during this review identifies 2024 as latest stable edition. The experimental future spelling is not a concrete numbered fixture edition.

The complete associated tests supply meaningful assertions: default_edition_supplies_into_future_but_2021_does_not uses an IntoFuture-dependent program accepted under the omitted edition, then explicitly selects 2021, requires a shared ERROR, and asserts the returned Sage diagnostic contains unresolved trait. Successful prepare requires both compiler results to succeed; thus the contrasting inputs detect accidentally defaulting to the older edition or ignoring the explicit override on either path. The older 2015/2018 values use the same inspected option propagation and conversion path; 2021 provides the representative observable older-edition regression. unknown_edition_fails_setup supplies future and asserts the precise unknown-edition setup error. explicit_edition_and_rustc_warning_marker covers the public macro's edition field dispatch, 2021 preparation, a rustc-only warning marker and an empty Sage diagnostic expectation. Captured observe::collect and diagnostic matching code confirm that returned diagnostics are actual collected results and that shared ERROR markers must match each compiler, rather than serving as unconditional permission to pass. No opaque assertion helper hides the edition scenario.

This refresh involved source inspection and review start/read/record commands, plus rustc --help; no source edits or test executions were performed. The coordinator runs the relevant suites centrally. No earlier test result or approval was substituted for current source assessment. No behavioral defect or missing required evidence was identified.

Browse crates anchors

139 anchors

Specification anchors and declared coverage
AnchorImplementationTests
crates (139)114 Implemented37 TODO2 N/A74 Implemented107 TODO
crates.sage_inspector (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
crates.sage_inspector.inspection (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
balanced_tracesImplementedTODO
canonical_ownershipImplementedImplementedTODO
derive_reflectionImplementedImplementedTODO
detail_free_indexImplementedTODO
deterministic_traceImplementedTODO
durable_navigationN/ATODO
generic_browserN/ATODO
owned_reflectionImplementedImplementedTODO
product_availabilityImplementedTODO
revision_and_demandImplementedTODO
semantic_phase_boundaryImplementedTODO
source_evidenceImplementedTODO
typed_serviceImplementedTODO
unknown_workImplementedTODOTODO
workspace_actorImplementedTODO
crates.sage_ir (90)67 Implemented34 TODO40 Implemented88 TODO
crates.sage_ir.checking (12)12 Implemented3 TODO5 Implemented12 TODO
crates.sage_ir.checking.body (5)5 Implemented2 TODO3 Implemented5 TODO
elaborationImplementedImplementedTODO
expected_typesImplementedTODOTODO
interface_dependenciesImplementedImplementedTODO
isolated_completionImplementedImplementedTODO
operator_callsImplementedTODOTODO
identity_mintingImplementedTODO
owned_productsImplementedImplementedTODO
crates.sage_ir.checking.signature (4)4 Implemented1 TODO1 Implemented4 TODO
body_independenceImplementedTODO
narrow_detailImplementedTODOTODO
owner_binderImplementedImplementedTODO
storageImplementedTODO
symbol_keyed_interfacesImplementedTODO
crates.sage_ir.crate (9)9 TODO9 TODO
explicit_restrictionsTODOTODO
identity_before_detailTODOTODO
incremental_evidenceTODOTODO
narrow_demandsTODOTODO
reexecution_and_invalidationTODOTODO
represented_completenessTODOTODO
restrictions_and_gapsTODOTODO
semantic_query_boundariesTODOTODO
terminal_incompletenessTODOTODO
crates.sage_ir.inference (8)8 Implemented6 Implemented8 TODO
atomic_checkingImplementedImplementedTODO
body_local_quiescenceImplementedImplementedTODO
canonical_boundaryImplementedImplementedTODO
completed_body_boundaryImplementedTODO
numeric_domainsImplementedImplementedTODO
subtyping_and_coercionImplementedImplementedTODO
terminal_obligationsImplementedTODO
transaction_isolationImplementedImplementedTODO
crates.sage_ir.metadata (4)4 Implemented1 TODO4 TODO
explicit_incompletenessImplementedTODO
keyed_reuseImplementedTODOTODO
product_boundariesImplementedTODO
provider_authorityImplementedTODO
crates.sage_ir.modules (8)7 Implemented1 TODO4 Implemented8 TODO
crates.sage_ir.modules.expand (4)4 Implemented2 Implemented4 TODO
completenessImplementedImplementedTODO
dependenciesImplementedTODO
direct_membersImplementedTODO
recursion_and_fixpointImplementedImplementedTODO
crates.sage_ir.modules.parse (4)3 Implemented1 TODO2 Implemented4 TODO
dependenciesImplementedTODO
detail_firewallImplementedImplementedTODO
recovery_completenessTODOTODO
syntax_identitiesImplementedImplementedTODO
crates.sage_ir.resolution (5)5 Implemented1 TODO3 Implemented4 TODO
crates.sage_ir.resolution.lookup (5)5 Implemented1 TODO3 Implemented4 TODO
completenessImplementedTODOImplementedTODO
dependenciesImplementedTODO
expansion_import_ambiguityImplementedImplemented
identity_onlyImplementedTODO
precedenceImplementedImplementedTODO
crates.sage_ir.solver (9)7 Implemented7 TODO5 Implemented9 TODO
alternative_isolationImplementedTODOImplementedTODO
bounded_completenessImplementedTODOTODO
candidate_completenessImplementedTODO
canonical_cyclesTODOTODO
canonical_outputsImplementedImplementedTODO
local_index_firewallTODOTODO
normalization_demandImplementedTODOImplementedTODO
schedule_independenceImplementedTODOImplementedTODO
shared_final_resultImplementedTODOImplementedTODO
crates.sage_ir.symbols (8)8 Implemented4 Implemented7 TODO
associated_identityImplementedImplemented
associated_interfacesImplementedTODO
body_interfacesImplementedImplementedTODO
definition_identityImplementedTODO
external_fact_queriesImplementedTODO
external_identityImplementedTODO
kind_wrappersImplementedImplementedTODO
local_identityImplementedImplementedTODO
crates.sage_ir.types (27)16 Implemented12 TODO13 Implemented27 TODO
crates.sage_ir.types.aliases (2)1 Implemented1 TODO1 Implemented2 TODO
identityImplementedImplementedTODO
revelationTODOTODO
crates.sage_ir.types.binder (1)1 Implemented1 TODO1 Implemented1 TODO
owner_parametersImplementedTODOImplementedTODO
crates.sage_ir.types.body (13)4 Implemented9 TODO3 Implemented13 TODO
awaitTODOTODO
closuresTODOTODO
conditional_patternsTODOTODO
coroutinesTODOTODO
diagnosed_recoveryImplementedImplementedTODO
elaboratedTODOImplementedTODO
for_iterationTODOTODO
indexingTODOTODO
macro_expansionTODOTODO
no_inferenceImplementedImplementedTODO
resolved_referencesImplementedTODO
try_residualTODOTODO
typed_provenanceImplementedTODO
crates.sage_ir.types.calls (2)1 Implemented1 TODO1 Implemented2 TODO
dispatch_familiesTODOTODO
selected_semanticsImplementedImplementedTODO
crates.sage_ir.types.lifetimes (2)2 Implemented2 Implemented2 TODO
dummyImplementedImplementedTODO
unchecked_borrowsImplementedImplementedTODO
crates.sage_ir.types.operators (2)2 Implemented1 Implemented2 TODO
lazy_control_flowImplementedTODO
trait_callsImplementedImplementedTODO
scoped_identitiesImplementedTODO
crates.sage_ir.types.spans (4)4 Implemented4 Implemented4 TODO
generated_identityImplementedImplementedTODO
item_originImplementedImplementedTODO
offset_reuseImplementedImplementedTODO
relative_compositionImplementedImplementedTODO
crates.sage_oracle_harness (4)4 Implemented2 TODO1 Implemented4 TODO
crates.sage_oracle_harness.crate (4)4 Implemented2 TODO1 Implemented4 TODO
deterministic_emissionImplementedTODO
exact_comparisonImplementedTODOImplementedTODO
fixed_projectionImplementedTODO
independent_coverageImplementedTODOTODO
crates.sage_stash (5)5 Implemented5 Implemented
crates.sage_stash.storage (5)5 Implemented5 Implemented
handle_ownershipImplementedImplemented
immutable_entriesImplementedImplemented
query_valueImplementedImplemented
rooted_equalityImplementedImplemented
typed_interningImplementedImplemented
crates.sage_test_harness (25)25 Implemented25 Implemented
crates.sage_test_harness.compile_tests (25)25 Implemented25 Implemented
annotation_validationImplementedImplemented
blessing_gateImplementedImplemented
callsite_updatesImplementedImplemented
checking_scopeImplementedImplemented
compiler_conditionsImplementedImplemented
completed_typesImplementedImplemented
coordinatesImplementedImplemented
dependenciesImplementedImplemented
diagnostic_countsImplementedImplemented
diagnostic_locationsImplementedImplemented
editionImplementedImplemented
fixturesImplementedImplemented
grouped_observationsImplementedImplemented
invocationImplementedImplemented
production_executionImplementedImplemented
project_isolationImplementedImplemented
query_captureImplementedImplemented
query_projectionImplementedImplemented
renderingImplementedImplemented
resolved_symbolsImplementedImplemented
review_visibilityImplementedImplemented
rustc_executionImplementedImplemented
rustc_lintsImplementedImplemented
starting_expressionsImplementedImplemented
target_lineImplementedImplemented