design-md-consolidation 3.1: remove 2 Rust code blocks from Decision 10 (Type::Fn + Suppress) — schema lives in §Data-model
This commit is contained in:
+8
-25
@@ -1022,21 +1022,9 @@ The form-A surface for fn signatures gains mode wrappers:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Internally, this is *not* a new `Type` variant. Modes are
|
Internally, this is *not* a new `Type` variant. Modes are
|
||||||
metadata on `Type::Fn`:
|
metadata on `Type::Fn` — `paramModes` and `retMode` fields run
|
||||||
|
parallel to `params` and `ret` (see §"Data model" for the JSON
|
||||||
```rust
|
schema). The substantive reasons for per-position metadata over a
|
||||||
Type::Fn {
|
|
||||||
params: Vec<Type>,
|
|
||||||
param_modes: Vec<ParamMode>, // same length as params
|
|
||||||
ret: Box<Type>,
|
|
||||||
ret_mode: ParamMode,
|
|
||||||
effects: Vec<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum ParamMode { Implicit, Own, Borrow } // default: Implicit
|
|
||||||
```
|
|
||||||
|
|
||||||
The substantive reasons for per-position metadata over a
|
|
||||||
`Type::Borrow` / `Type::Own` variant approach:
|
`Type::Borrow` / `Type::Own` variant approach:
|
||||||
|
|
||||||
- **Semantic locality.** Modes are properties of fn-signature
|
- **Semantic locality.** Modes are properties of fn-signature
|
||||||
@@ -1127,16 +1115,11 @@ All four are skipped during serialisation when absent / false /
|
|||||||
None so canonical-JSON hashes of every fixture remain stable
|
None so canonical-JSON hashes of every fixture remain stable
|
||||||
until the fixture intentionally adopts the feature.
|
until the fixture intentionally adopts the feature.
|
||||||
|
|
||||||
**`FnDef.suppress`.**
|
**`FnDef.suppress`.** The `suppress` field on `FnDef` carries a
|
||||||
|
list of advisory-diagnostic suppress entries; each entry has a
|
||||||
```rust
|
`code` (the diagnostic being suppressed) and a `because` (a
|
||||||
FnDef.suppress: Vec<Suppress> ; advisory diagnostic suppress list
|
mandatory non-empty reason). See §"Data model" for the canonical
|
||||||
|
schema.
|
||||||
struct Suppress {
|
|
||||||
code: String, // diagnostic code being suppressed
|
|
||||||
because: String, // mandatory non-empty reason
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Form-A surface: `(suppress (code "...") (because "..."))` clause
|
Form-A surface: `(suppress (code "...") (because "..."))` clause
|
||||||
between fn name and `(type ...)`. Multiple clauses allowed; one
|
between fn name and `(type ...)`. Multiple clauses allowed; one
|
||||||
|
|||||||
Reference in New Issue
Block a user