You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're moving in the direction of having one or more examples for each
rule where possible. Let's add examples to the new rules where they
were missing and make sense to have.
Copy file name to clipboardExpand all lines: src/items/functions.md
+57-2Lines changed: 57 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -349,6 +349,13 @@ This parameter stands in for an arbitrary number of arguments that may be passed
349
349
r[items.fn.c-variadic.parameter-type]
350
350
The type of `pat` in the function body is [`VaList<'_>`].
351
351
352
+
```rust
353
+
# usecore::ffi::VaList;
354
+
unsafeextern"C"fnf(ap:...) {
355
+
let_:VaList<'_> =ap;
356
+
}
357
+
```
358
+
352
359
r[items.fn.c-variadic.lifetime]
353
360
A C-variadic function definition is implicitly generic over the lifetime of its variadic parameter, as if the parameter had type `VaList<'x>` for a fresh, unnameable lifetime `'x`. Because the function must be valid for any such lifetime, the `VaList` cannot be proved to outlive any caller-provided lifetime (and so cannot escape the call) and no caller-provided lifetime can be proved to outlive it.
0 commit comments