Skip to content

Commit f195ebe

Browse files
committed
Fixed text of unsafe4.cxx
1 parent e78bd2a commit f195ebe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/draft.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1692,9 +1692,9 @@ <h3 data-number="2.1.3" id="the-unsafe-type-qualifier"><span class="header-secti
16921692
<span id="cb26-15"><a href="#cb26-15" aria-hidden="true" tabindex="-1"></a> Vec<span class="op">&lt;</span>unsafe String<span class="op">&gt;</span> vec <span class="op">{</span> <span class="op">}</span>;</span>
16931693
<span id="cb26-16"><a href="#cb26-16" aria-hidden="true" tabindex="-1"></a></span>
16941694
<span id="cb26-17"><a href="#cb26-17" aria-hidden="true" tabindex="-1"></a> <span class="co">// void Vec&lt;unsafe String&gt;::push_back(self^, unsafe String) safe;</span></span>
1695-
<span id="cb26-18"><a href="#cb26-18" aria-hidden="true" tabindex="-1"></a> <span class="co">// Copy initialization of the `unsafe String` function parameter is</span></span>
1696-
<span id="cb26-19"><a href="#cb26-19" aria-hidden="true" tabindex="-1"></a> <span class="co">// permitted.</span></span>
1697-
<span id="cb26-20"><a href="#cb26-20" aria-hidden="true" tabindex="-1"></a> mut vec<span class="op">.</span>push_back<span class="op">(</span><span class="st">&quot;A string&quot;</span><span class="op">)</span>;</span>
1695+
<span id="cb26-18"><a href="#cb26-18" aria-hidden="true" tabindex="-1"></a> <span class="co">// This is ill-formed. We can&#39;t invoke the unsafe String constructor</span></span>
1696+
<span id="cb26-19"><a href="#cb26-19" aria-hidden="true" tabindex="-1"></a> <span class="co">// to initialize an unsafe type.</span></span>
1697+
<span id="cb26-20"><a href="#cb26-20" aria-hidden="true" tabindex="-1"></a> mut vec<span class="op">.</span>push_back<span class="op">(</span>String<span class="op">(</span><span class="st">&quot;A string&quot;</span><span class="op">))</span>;</span>
16981698
<span id="cb26-21"><a href="#cb26-21" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
16991699
<div class="sourceCode" id="cb27"><pre class="sourceCode default"><code class="sourceCode default"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a>$ circle unsafe4.cxx</span>
17001700
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a>error: unsafe4.cxx:20:27</span>

proposal/draft.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,9 @@ int main() safe {
795795
Vec<unsafe String> vec { };
796796
797797
// void Vec<unsafe String>::push_back(self^, unsafe String) safe;
798-
// Copy initialization of the `unsafe String` function parameter is
799-
// permitted.
800-
mut vec.push_back("A string");
798+
// This is ill-formed. We can't invoke the unsafe String constructor
799+
// to initialize an unsafe type.
800+
mut vec.push_back(String("A string"));
801801
}
802802
```
803803
```

0 commit comments

Comments
 (0)