Skip to content

Commit 814301e

Browse files
committed
mention an alternative that avoids lint-on-lint dependencies
1 parent 2e47c41 commit 814301e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ fn` for functions that are "unsafe to call" but do not implicitly have an
162162
`unsafe {}` block in their body. For consistency, we might want `unsafe_to_impl
163163
trait` for traits, though the behavior would be the same as `unsafe trait`.
164164

165+
We could avoid having the "unnecessary unsafe" lint depend on
166+
`unsafe_op_in_unsafe_fn` and instead always behave like those blocks are
167+
necessary (if they contain an "unsafe to call" operation). That would avoid a
168+
dependency of one lint on another, but it could possibly be confusing when,
169+
inside an `unsafe fn`, some operations are guarded by an unsafe block and others
170+
are not.
171+
165172
We could introduce named proof obligations (proposed by @Centril) such that the
166173
compiler can be be told (to some extend) if the assumptions made by the `unsafe
167174
fn` are sufficient to discharge the requirements of the unsafe operations.

0 commit comments

Comments
 (0)