From 6d73e5de058ea421a98a53ae6c0844860715cc01 Mon Sep 17 00:00:00 2001 From: Shritesh Bhattarai Date: Thu, 30 May 2019 19:38:26 -0700 Subject: [PATCH] doc: recommend optional pointers for nullptrs instead of allowzero --- doc/langref.html.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 622a3aeb60..a98705afd5 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -2026,9 +2026,9 @@ fn foo(bytes: []u8) u32 { {#header_open|allowzero#}

This pointer attribute allows a pointer to have address zero. This is only ever needed on the - freestanding OS target, where the address zero is mappable. In this code example, if the pointer - did not have the {#syntax#}allowzero{#endsyntax#} attribute, this would be a - {#link|Pointer Cast Invalid Null#} panic: + freestanding OS target, where the address zero is mappable. If you want to represent null pointers, use + {#link|Optional Pointers#} instead. In this code example, if the pointer did not have the + {#syntax#}allowzero{#endsyntax#} attribute, this would be a {#link|Pointer Cast Invalid Null#} panic:

{#code_begin|test|allowzero#} const std = @import("std");