From 1c31de361d345c7cfc9ac2ca7a3040bdfa649d9a Mon Sep 17 00:00:00 2001 From: Andrey Makarov Date: Wed, 17 Aug 2022 22:20:22 +0300 Subject: Markdown code blocks part 5 (#20236) No logic was added, just a few more `*.md` files have been migrated. --- doc/manual/var_t_return.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/manual') diff --git a/doc/manual/var_t_return.md b/doc/manual/var_t_return.md index f5c5bc4c0..15d908c74 100644 --- a/doc/manual/var_t_return.md +++ b/doc/manual/var_t_return.md @@ -6,7 +6,7 @@ rule: If `result` does not refer to a location pointing to the heap (that is in `result = X` the `X` involves a `ptr` or `ref` access) then it has to be derived from the routine's first parameter: -.. code-block:: nim + ```nim proc forward[T](x: var T): var T = result = x # ok, derived from the first parameter. @@ -17,6 +17,7 @@ then it has to be derived from the routine's first parameter: result = forward(x) # Error: location is derived from `x` # which is not p's first parameter and lives # on the stack. + ``` In other words, the lifetime of what `result` points to is attached to the lifetime of the first parameter and that is enough knowledge to verify -- cgit 1.4.1-2-gfad0 fs log blame commit diff stats
path: root/build_all.sh
blob: e22facc1b22b7d9f9fbe28457fcdb180347f42d2 (plain) (tree)
1
2
3
4
5
6
7
8
9