Skip to content

Commit f6dcd5c

Browse files
committed
stop mentioning unsafe_op_in_unsafe_fn
1 parent 803aca7 commit f6dcd5c

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

library/std/src/keyword_docs.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,10 +1916,6 @@ mod type_keyword {}
19161916
/// - and to declare that a programmer has checked that these contracts have been upheld (`unsafe
19171917
/// {}` and `unsafe impl`, but also `unsafe fn` -- see below).
19181918
///
1919-
/// They are not mutually exclusive, as can be seen in `unsafe fn`: the body of an `unsafe fn` is,
1920-
/// by default, treated like an unsafe block. The `unsafe_op_in_unsafe_fn` lint can be enabled to
1921-
/// change that.
1922-
///
19231919
/// # Unsafe abilities
19241920
///
19251921
/// **No matter what, Safe Rust can't cause Undefined Behavior**. This is
@@ -1961,13 +1957,6 @@ mod type_keyword {}
19611957
/// - `unsafe impl`: the contract necessary to implement the trait has been
19621958
/// checked by the programmer and is guaranteed to be respected.
19631959
///
1964-
/// By default, `unsafe fn` also acts like an `unsafe {}` block
1965-
/// around the code inside the function. This means it is not just a signal to
1966-
/// the caller, but also promises that the preconditions for the operations
1967-
/// inside the function are upheld. Mixing these two meanings can be confusing, so the
1968-
/// `unsafe_op_in_unsafe_fn` lint can be enabled to warn against that and require explicit unsafe
1969-
/// blocks even inside `unsafe fn`.
1970-
///
19711960
/// See the [Rustonomicon] and the [Reference] for more information.
19721961
///
19731962
/// # Examples
@@ -2161,8 +2150,7 @@ mod type_keyword {}
21612150
/// defined by the trait (or a stronger contract, i.e., weaker preconditions).
21622151
///
21632152
/// Of course, the implementation may choose to call other unsafe operations, and then it needs an
2164-
/// `unsafe` *block* to indicate it discharged the proof obligations of its callees. (We enabled
2165-
/// `unsafe_op_in_unsafe_fn`, so the body of `idx_unchecked` is not implicitly an unsafe block.) For
2153+
/// `unsafe` *block* to indicate it discharged the proof obligations of its callees. For
21662154
/// that purpose it can make use of the contract that all its callers must uphold -- the fact that
21672155
/// `idx < LEN`.
21682156
///

0 commit comments

Comments
 (0)