From dcdeb9c8a2e65330530301b8619c519814931f10 Mon Sep 17 00:00:00 2001 From: Connor Horman Date: Thu, 18 Jul 2024 13:11:08 -0400 Subject: [PATCH 1/3] Add some spec glossary terms to the reference glossary --- src/glossary.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/glossary.md b/src/glossary.md index b5074767c..7d1b77d12 100644 --- a/src/glossary.md +++ b/src/glossary.md @@ -1,5 +1,30 @@ # Glossary +## Terms used in the Specification + +### Ill-formed Program + +A Rust Program is ill-formed if it violates a statically set constraint placed on it by the language. +Unless otherwise statement explicitly an implementation shall issue an appropriate diagnostic for an ill-formed program and shall not translate such a program. + +#### No Diagnostic Required + +When No Diagnostic is Required for a static constraint, the implementation may issue a diagnostic for the violation, and may translate the program. +If such a program is succesfully translated, no constraints are placed on the result of executing the program. + +> [!NOTE] +> The constraint which is modified by the phrase "No Diagnostic Required" may be defined implicitly, such as with the term "shall", rather than explicitly stating that the program is ill-formed. + +> [!NOTE] +> Such constraints are used only when it may be unreasonable or impossible to check the constraints statically, and where the result of violating the constraints makes it impossible to ensure the required behaviour of the program + +### Shall + +The word "shall" is a static constraint placed upon the program. A program that violates a constraint that uses "shall" is ill-formed. + + +## Rust Specific Terms + ### Abstract syntax tree An ‘abstract syntax tree’, or ‘AST’, is an intermediate representation of @@ -105,6 +130,7 @@ are also considered local. Fundamental type constructors cannot [cover](#uncover Any time the term "covered type" is used, the `T` in `&T`, `&mut T`, `Box`, and `Pin` is not considered covered. + ### Inhabited A type is inhabited if it has constructors and therefore can be instantiated. An inhabited type is From f4ab575347e3d39814bf759a091759f921ce1d01 Mon Sep 17 00:00:00 2001 From: Connor Horman Date: Thu, 18 Jul 2024 13:19:13 -0400 Subject: [PATCH 2/3] Fix formatting of glossary.md --- src/glossary.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/glossary.md b/src/glossary.md index 7d1b77d12..ee326b80e 100644 --- a/src/glossary.md +++ b/src/glossary.md @@ -4,7 +4,7 @@ ### Ill-formed Program -A Rust Program is ill-formed if it violates a statically set constraint placed on it by the language. +A Rust Program is ill-formed if it violates a statically set constraint placed on it by the language. Unless otherwise statement explicitly an implementation shall issue an appropriate diagnostic for an ill-formed program and shall not translate such a program. #### No Diagnostic Required @@ -16,13 +16,12 @@ If such a program is succesfully translated, no constraints are placed on the re > The constraint which is modified by the phrase "No Diagnostic Required" may be defined implicitly, such as with the term "shall", rather than explicitly stating that the program is ill-formed. > [!NOTE] -> Such constraints are used only when it may be unreasonable or impossible to check the constraints statically, and where the result of violating the constraints makes it impossible to ensure the required behaviour of the program +> Such constraints are used only when it may be unreasonable or impossible to check the constraints statically, and where the result of violating the constraints makes it impossible to ensure the required behaviour of the program ### Shall The word "shall" is a static constraint placed upon the program. A program that violates a constraint that uses "shall" is ill-formed. - ## Rust Specific Terms ### Abstract syntax tree From 8f464baa4112766428fc69abeee187012ca57634 Mon Sep 17 00:00:00 2001 From: Connor Horman Date: Wed, 24 Jul 2024 16:45:23 -0400 Subject: [PATCH 3/3] Make suggested glossary changes from PR Comments --- src/glossary.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/glossary.md b/src/glossary.md index ee326b80e..0ce4272c6 100644 --- a/src/glossary.md +++ b/src/glossary.md @@ -2,14 +2,19 @@ ## Terms used in the Specification -### Ill-formed Program +### Ill-formed program -A Rust Program is ill-formed if it violates a statically set constraint placed on it by the language. -Unless otherwise statement explicitly an implementation shall issue an appropriate diagnostic for an ill-formed program and shall not translate such a program. +r[requirement.error] -#### No Diagnostic Required +A Rust program is ill-formed if it violates a static constraint of the language. +Unless otherwise stated (See ["no diagnostic required"][requirement.ndr]), it is an error to have an ill-formed program. + +#### No diagnostic required + +r[requirement.ndr] + +When No diagnostic is required for a static constraint, the implementation may (but is not required to) issue an compile-time error or other diagnostic, and may translate the program. -When No Diagnostic is Required for a static constraint, the implementation may issue a diagnostic for the violation, and may translate the program. If such a program is succesfully translated, no constraints are placed on the result of executing the program. > [!NOTE]