Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,062 changes: 1,537 additions & 1,525 deletions src/v3/compiler/src/bootstrap_generated.rs

Large diffs are not rendered by default.

2,896 changes: 1,454 additions & 1,442 deletions src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2549,6 +2549,55 @@ fn special_value_policy_axes_are_closed_sums() {
);
}

#[test]
fn string_diagnostic_ordering_axes_live_in_emit_model_authority() {
let dag = v3_compiler::generated_full_bootstrap_dag();

for name in [
"StringOwnershipAxis",
"StringLifetimeAxis",
"StringGrowabilityAxis",
"StringEncodingAxis",
] {
let decl = dag
.declaration_by_name(name)
.unwrap_or_else(|| panic!("`{name}` missing from full bootstrap"));
assert_eq!(
decl.span.file, "src/v3/std/emit_model.dag",
"`{name}` must stay with target emission-model substrate; \
per-target diagnostic-ordering rows land in target specs later"
);
}
}

#[test]
fn string_diagnostic_ordering_axes_are_closed_structural_values() {
let dag = v3_compiler::generated_full_bootstrap_dag();

assert_eq!(
disj_variant_labels(&dag, "StringOwnershipAxis"),
["Owned", "Borrowed"].map(String::from),
"string ownership must be a typed axis, not a boolean or target string"
);
assert_eq!(
disj_variant_labels(&dag, "StringLifetimeAxis"),
["SelfContained", "Caller"].map(String::from),
"string lifetime must use canonical substrate names, not Rust enum \
escaping or target-local strings"
);
assert_eq!(
disj_variant_labels(&dag, "StringGrowabilityAxis"),
["Growable", "Fixed", "NotApplicable"].map(String::from),
"`NotApplicable` must be an explicit growability value, not absence"
);
assert_eq!(
disj_variant_labels(&dag, "StringEncodingAxis"),
["Utf8FreeMonoidChar"].map(String::from),
"R2 string encoding vocabulary must name the FreeMonoid<Char> / UTF-8 \
row shape structurally"
);
}

#[test]
fn runtime_value_carrier_matches_pb_runtime_shape_and_marker_boundary() {
let dag = v3_compiler::generated_full_bootstrap_dag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ src/v3/std/computation_model.dag 14 22953 20e458fe097d175a
src/v3/std/diagnostics.dag 11 20274 a317777d55e36b19
src/v3/std/dimensions.dag 21 40239 d595746d2bda22f6
src/v3/std/effects.dag 53 97984 1acdbeaa68acfd2e
src/v3/std/emit_model.dag 36 68760 30bb483bab671fa7
src/v3/std/emit_model.dag 40 73232 109e5f6becc954c6
src/v3/std/extdeps_bootstrap_fixtures.dag 4 14463 909ca7a1c1705e89
src/v3/std/go_method_template_contracts.dag 5 110898 7eb5c9f1296f4a45
src/v3/std/induction.dag 56 88794 546f74c63c189c50
Expand Down
33 changes: 33 additions & 0 deletions src/v3/std/emit_model.dag
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,39 @@ type ParameterDisposition
= Borrowed
| Consumed

// 🟢 TERMINAL at string-family diagnostic-ordering axis scope. Ownership is a
// target-row property for string-family candidates, distinct from callable
// `ParameterDisposition`: it classifies the candidate carrier itself, not how a
// callee receives one argument. Rows land in target specs later; this slice
// only provides canonical structural values so consumers do not normalize
// strings locally.
type StringOwnershipAxis
= Owned
| Borrowed

// 🟢 TERMINAL at string-family diagnostic-ordering axis scope. These are the R2
// lifetime roles shared by lifetime analyzer facts and future target rows.
// `SelfContained` avoids leaking Rust's `Self_` identifier escaping into the
// substrate vocabulary; `Caller` names the call-frame-bounded role.
type StringLifetimeAxis
= SelfContained
| Caller

// 🟢 TERMINAL at string-family diagnostic-ordering axis scope. `NotApplicable`
// is an explicit value, not absence: borrowed candidates and returns can say
// the growability axis does not apply without becoming unknown.
type StringGrowabilityAxis
= Growable
| Fixed
| NotApplicable

// 🟢 TERMINAL at R2 string-family encoding scope. The design-doc correction
// makes `.dag` `String` the `FreeMonoid<Char>` family; this value names the
// UTF-8 target-row semantics consumed by the analyzer/fold bridge. Additional
// byte or target-specific encodings belong in later LanguageSpec rows.
type StringEncodingAxis
= Utf8FreeMonoidChar

type TypeInstantiationRealization {
language: DeclarationRef
target: DeclarationRef
Expand Down
Loading