From 55b33a18eef4fbaaab23354d2d49735a107540a4 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Wed, 14 Sep 2022 14:08:29 -0700 Subject: [PATCH 1/2] Relax some rules in unsafe context --- proposals/low-level-struct-improvements.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proposals/low-level-struct-improvements.md b/proposals/low-level-struct-improvements.md index 19163c29d6..cc072bf3b6 100644 --- a/proposals/low-level-struct-improvements.md +++ b/proposals/low-level-struct-improvements.md @@ -702,6 +702,12 @@ Namely the rules of [method invocation](#rules-method-invocation) updated above: For a `new` expression with initializers, the initializer expressions count as arguments (they contribute their *safe-to-escape*) and the `ref` initializer expressions count as `ref` arguments (they contribute their *ref-safe-to-escape*), recursively. +## Changes in unsafe context + +Pointer types are extended to allow managed types as referent type, but only in local declarations and casts. +Such pointer types are written as a managed type followed by a `*` token. They produce a warning. +The address-of operator is relaxed to accept a variable with a managed type as its operand. + ## Considerations There are considerations other parts of the development stack should consider when evaluating this feature. From f22e2a735217f59c5d1b881e532b2080c40e25a4 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Wed, 14 Sep 2022 14:56:39 -0700 Subject: [PATCH 2/2] Update low-level-struct-improvements.md --- proposals/low-level-struct-improvements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/low-level-struct-improvements.md b/proposals/low-level-struct-improvements.md index cc072bf3b6..3d45e0e7df 100644 --- a/proposals/low-level-struct-improvements.md +++ b/proposals/low-level-struct-improvements.md @@ -704,7 +704,7 @@ For a `new` expression with initializers, the initializer expressions count as a ## Changes in unsafe context -Pointer types are extended to allow managed types as referent type, but only in local declarations and casts. +Pointer types are extended to allow managed types as referent type, but only in casts. Such pointer types are written as a managed type followed by a `*` token. They produce a warning. The address-of operator is relaxed to accept a variable with a managed type as its operand.