File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -100,20 +100,21 @@ to satisfy the conditions required to perform this unsafe operation.
100100 }
101101 ```
102102
103- 2 . In a next step , we have a lint that fires when an unsafe operation is performed
104- inside an `unsafe fn ` but outside an `unsafe ` block . So , this would trigger the
105- lint :
103+ 2 . Optionally , we could add a clippy " correctness " lint to warn about unsafe
104+ operations inside an `unsafe fn `, but outside an `unsafe ` block . So , this
105+ would trigger the lint :
106106
107107 ```rust
108108 unsafe fn get_unchecked <T >(x : & [T ], i : usize ) -> & T {
109109 x . get_unchecked (i )
110110 }
111111 ```
112112
113- This gets us into a state where programmers are much less likely to accidentally
114- perform undesired unsafe operations inside `unsafe fn `.
113+ 3 . In a next step , we move this lint to rustc proper , make it warn - by - default .
114+ This gets us into a state where programmers are much less likely to
115+ accidentally perform undesired unsafe operations inside `unsafe fn `.
115116
116- 3 . Even later (in the 2021 edition ), it might be desirable to turn this warning
117+ 4 . Even later (in the 2021 edition ), it might be desirable to turn this warning
117118 into an error .
118119
119120# Drawbacks
You can’t perform that action at this time.
0 commit comments