Skip to content

Commit 5571c39

Browse files
committed
add clippy to action plan
1 parent 5d46a2d commit 5571c39

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

text/0000-unsafe-block-in-unsafe-fn.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)