spec: accept RFC 0009 and integrate unsafe boundaries
- spec 13 §6-§8: unsafe operations (assume, borrow.index.unchecked), contagious unsafe effect, trusted boundary with obligation, E6001, unsafe report, profiles as policy - spec 05 §9.3: trusted is the one discharging boundary; spec 07 §8.10 trusted syntax; 07a, 08 stage order and assume facts - T0009, E6001 reasons; feature unsafe published
This commit is contained in:
1 parent
17ddb98597
commit
c510a37cf9
9 files changed
+105
-7
No files matched your search
@@ -37,6 +37,7 @@ variant = ident [ "(" [ type { "," type } ] ")" ] ;
|
||||
|
||||
function = "fn" global "(" [ param_list ] ")" "->" type [ "from" local ] NL (* from: feature ownership *)
|
||||
"effects" "[" [ path_list ] "]" NL
|
||||
[ "trusted" string NL ] (* feature unsafe *)
|
||||
block { block } ;
|
||||
param_list = param { "," param } ;
|
||||
param = local ":" type ;
|
||||
@@ -81,7 +82,9 @@ arrays_op = "array.splat" type local
|
||||
| "slice.sub" local "," local "," local
|
||||
| "slice.split" local "," local
|
||||
| "slice.copy" local "," local
|
||||
| "guard" local ;
|
||||
| "guard" local
|
||||
| "assume" local (* feature unsafe *)
|
||||
| "borrow.index.unchecked" local "," local ; (* feature unsafe *)
|
||||
|
||||
arith_op = ( "add" | "sub" | "mul" ) "." ( "checked" | "wrap" ) "." int_type
|
||||
| ( "div" | "rem" ) ".checked." int_type
|
||||
@@ -121,3 +124,4 @@ name_char = letter | digit | "_" ;
|
||||
int_lit = [ "-" ] ( dec_digits | "0x" hex_digits | "0b" bin_digits ) ;
|
||||
(* "_" may separate digits; it carries no meaning. *)
|
||||
version_lit = digit { digit } "." digit { digit } ;
|
||||
string = '"' { string_char | '\\"' | '\\\\' | '\\n' } '"' ; (* not empty; only in `trusted` *)
|
||||
Reference in new issue
Block a user