crates.sage_test_harness.compile_tests.rustc_lints

rustc starts with warning-by-default lints individually allowed, using the pinned compiler’s lint inventory, to keep incidental unused-item and naming lints out of ordinary fixtures. Deny-by-default lints remain enabled. Source-level lint attributes may enable specific warnings or deny them; emitted warnings and errors must then have matching markers. This is not a lint cap and does not suppress hard language errors.

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

Implementation

Implemented crates/sage-test-harness/src/compile/observe.rs:600–605

sage_test_harness::compile::observe · lib:sage_test_harness

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.rustc_lints`
pub(super) fn match_compiler_diagnostics(
    compiler: Compiler,
    markers: &[Marker],
    diagnostics: &[DiagnosticSnapshot],
) -> Result<(), String> {

}

See more source ↗

Implemented crates/sage-test-harness/src/compile/rustc.rs:15–20

sage_test_harness::compile::rustc · lib:sage_test_harness

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.rustc_lints`
// {anchor}`crates.sage_test_harness.compile_tests.compiler_conditions`
// {anchor}`crates.sage_test_harness.compile_tests.edition`
// {anchor}`crates.sage_test_harness.compile_tests.project_isolation`
pub(super) fn check(
    project: &Path,

}

See more source ↗

Implemented crates/sage-test-harness/src/compile/rustc.rs:202–207

sage_test_harness::compile::rustc · lib:sage_test_harness

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.rustc_lints`
fn quiet_lints() -> Result<&'static [String], String> {
    static FLAGS: OnceLock<Result<Vec<String>, String>> = OnceLock::new();
    FLAGS
        .get_or_init(|| {
            let output = Command::new(sage_host::metadata::our_rustc())

}

See more source ↗

Implemented crates/sage-host/src/metadata.rs:108–113

sage_host::metadata · lib:sage_host

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.rustc_lints`
pub fn our_rustc() -> PathBuf {
    Path::new(our_sysroot()).join("bin/rustc")
}

pub fn load_workspace(

}

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::rustc::tests::pinned_rustc_checks_errors_editions_and_normal_library_configuration

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

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_test_harness.compile_tests.rustc_execution)]
    #[sage::test(crates.sage_test_harness.compile_tests.rustc_lints)]
    fn pinned_rustc_checks_errors_editions_and_normal_library_configuration() {
        assert!(
            run("fn f() -> u8 { true }", "2024")
                .unwrap_err()
                .contains("0 markers, 1 diagnostics")
        );
        run("fn f() -> u8 { true } //# ERROR", "2024").unwrap();
        run("fn f() -> u8 { 256 } //# ERROR", "2024").unwrap(); // deny-by-default overflow survives quiet lint policy
        run("fn f<T: IntoFuture>() {}", "2024").unwrap();
        run("fn f<T: IntoFuture>() {} //# ERROR", "2021").unwrap();
        run("#[cfg(test)] fn f() -> u8 { true }\n#[cfg(feature = \"unexpected\")] fn g() -> u8 { true }", "2024").unwrap();
    }
}

Conditional source: #[cfg(test)]

See more source ↗

Implemented sage_test_harness::compile::rustc_tests::rustc_is_mandatory_and_warnings_can_be_enabled_in_source

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.rustc_execution)]
    #[sage::test(crates.sage_test_harness.compile_tests.rustc_lints)]
    #[sage::test(crates.sage_test_harness.compile_tests.compiler_conditions)]
    fn rustc_is_mandatory_and_warnings_can_be_enabled_in_source() {
        let mut quiet = CompileTest::default();
        quiet.source("fn unused() {}\nfn nonSnakeCase() {}");
        quiet.prepare().unwrap();

        let mut missing = CompileTest::default();
        missing.source("#![warn(dead_code)]\nfn unused() {}");
        let error = missing.prepare().unwrap_err();
        assert!(
            error.contains("Rustc diagnostic markers do not match: 0 markers, 1 diagnostics"),
            "{error}"
        );

        let mut expected = CompileTest::default();
        expected.source("#![warn(dead_code)]\nfn unused() {} //# WARN if rustc");
        assert!(expected.prepare().unwrap().diagnostics.is_empty());

        let mut denied = CompileTest::default();
        denied.source("#![deny(dead_code)]\nfn unused() {} //# ERROR if rustc");
        denied.prepare().unwrap();
    }
}

Conditional source: #[cfg(test)]

See more source ↗

Review: Accepted · Codex anchor_022 refresh 2026-10-19.

Fresh review started with the current coordinator instructions; assessed the current complete claim, four ordinary implementation entries, and both ordinary associated tests. No TODO or N/A evidence exists. This is source inspection, not a claim of new test execution; the coordinator is running central suites.
Requirement 1: warning-by-default lints are individually allowed using the pinned compiler inventory. quiet_lints calls metadata::our_rustc with -W help, selects exactly warn rows, excludes the warnings group, constructs individual -A{name} flags, rejects unrecognized inventory lacking dead-code, and caches the result. check calls the same compiler and appends those flags. metadata::our_rustc resolves the embedded sysroot's bin/rustc; captured build.rs supplies SAGE_SYSROOT. These account for the two rustc implementation entries and the metadata entry.
Requirement 2: incidental unused-item and naming warnings disappear from ordinary fixtures. The complete associated rustc_is_mandatory_and_warnings_can_be_enabled_in_source test prepares fn unused and fn nonSnakeCase without markers, so an unsuppressed dead_code or non_snake_case warning fails the preparation assertion. The pinned_rustc test also compiles unused functions without warning markers.
Requirement 3: deny-by-default lints remain active. The inventory filter does not select deny rows, and no blanket allow or cap flag is passed. pinned_rustc_checks_errors_editions_and_normal_library_configuration requires an ERROR for the overflowing u8 literal 256; matching would fail if the deny-by-default overflow disappeared.
Requirement 4: source attributes may reenable warnings or deny them, and resulting diagnostics require matching markers. The source-override test enables warn(dead_code), asserts missing markers cause a rustc-specific 0 markers/1 diagnostics error, then accepts the corresponding WARN if rustc fixture. It separately accepts deny(dead_code) with ERROR if rustc. The observe::match_compiler_diagnostics implementation entry filters applicable markers, matches exact severity and source location, and requires a complete one-to-one assignment; missing or extra diagnostics cannot succeed. Captured annotations.rs defines warning/error kinds and compiler conditions; captured mod.rs shows preparation passing markers into rustc and propagating errors. Rustc parsing retains warning/error severity and excludes only presentation summaries from matching.
Requirement 5: this is not a lint cap and hard language errors survive. The complete invocation contains individual allows and no cap. Source warn/deny overrides provide behavioral discrimination against a suppressive cap. The pinned_rustc test asserts the hard bool-to-u8 type error fails without a marker and succeeds with ERROR. Its 2021/2024 IntoFuture and cfg cases additionally confirm ordinary compiler execution settings; those cases do not substitute for the lint assertions.
The current private execute and validate_output helpers preserve the quiet-lint arguments and feed compiler diagnostics into the exhaustive matcher. Tests visibly contain fixtures and substantive success/failure assertions. Captured dependencies and initial implementation files cover the behavior relied upon in this assessment. No source edits or test runs were performed during this refresh; review start/read/record are the commands used for this source assessment. All aspects are accounted for, with no requested edits.

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