File tree 6 files changed +14
-10
lines changed
6 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ edit-url-template = "https://github.com/rust-lang/reference/edit/master/{path}"
10
10
11
11
[output .html .redirect ]
12
12
"/expressions/enum-variant-expr.html" = " struct-expr.html"
13
+ "/unsafe-blocks.html" = " unsafe-keyword.html"
14
+ "/unsafe-functions.html" = " unsafe-keyword.html"
13
15
14
16
[rust ]
15
17
edition = " 2021"
Original file line number Diff line number Diff line change 118
118
- [ Inline assembly] ( inline-assembly.md )
119
119
120
120
- [ Unsafety] ( unsafety.md )
121
- - [ Unsafe functions] ( unsafe-functions.md )
122
- - [ Unsafe blocks] ( unsafe-blocks.md )
121
+ - [ The ` unsafe ` keyword] ( unsafe-keyword.md )
123
122
- [ Behavior considered undefined] ( behavior-considered-undefined.md )
124
123
- [ Behavior not considered unsafe] ( behavior-not-considered-unsafe.md )
125
124
Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ trait object whose methods are attributed.
347
347
[ target architecture ] : ../conditional-compilation.md#target_arch
348
348
[ trait ] : ../items/traits.md
349
349
[ undefined behavior ] : ../behavior-considered-undefined.md
350
- [ unsafe function ] : ../unsafe-functions .md
350
+ [ unsafe function ] : ../unsafe-keyword .md
351
351
[ rust-abi ] : ../items/external-blocks.md#abi
352
352
[ `core::intrinsics::caller_location` ] : ../../core/intrinsics/fn.caller_location.html
353
353
[ `core::panic::Location::caller` ] : ../../core/panic/struct.Location.html#method.caller
Original file line number Diff line number Diff line change @@ -62,5 +62,5 @@ restrictions as [regular function parameters].
62
62
[ closures ] : closure.md
63
63
[ extern function ] : ../items/functions.md#extern-function-qualifier
64
64
[ function items ] : function-item.md
65
- [ unsafe function ] : ../unsafe-functions .md
65
+ [ unsafe function ] : ../unsafe-keyword .md
66
66
[ regular function parameters ] : ../items/functions.md#attributes-on-function-parameters
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- # Unsafe blocks
1
+ # The ` unsafe ` keyword
2
+
3
+ ## Unsafe functions
4
+
5
+ Unsafe functions are functions that are not safe in all contexts and/or for all
6
+ possible inputs. Such a function must be prefixed with the keyword ` unsafe ` and
7
+ can only be called from an ` unsafe ` block or another ` unsafe ` function.
8
+
9
+ ## Unsafe blocks
2
10
3
11
A block of code can be prefixed with the ` unsafe ` keyword, to permit calling
4
12
` unsafe ` functions or dereferencing raw pointers within a safe function.
You can’t perform that action at this time.
0 commit comments