Skip to content

Commit 885a416

Browse files
madsmtmehuss
authored andcommitted
Do not take a stance on #![deny(warnings)]
1 parent 448fc14 commit 885a416

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/doc/src/reference/semver.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ considered incompatible.
8888
* [Possibly-breaking: introducing a new function type parameter](#fn-generic-new)
8989
* [Minor: generalizing a function to use generics (supporting original type)](#fn-generalize-compatible)
9090
* [Major: generalizing a function to use generics with type mismatch](#fn-generalize-mismatch)
91-
* [Minor: making an `unsafe` function safe](#fn-unsafe-safe)
91+
* [Possibly-breaking: making an `unsafe` function safe](#fn-unsafe-safe)
9292
* Attributes
9393
* [Major: switching from `no_std` support to requiring `std`](#attr-no-std-to-std)
9494
* [Major: adding `non_exhaustive` to an existing enum, variant, or struct with no private fields](#attr-adding-non-exhaustive)
@@ -1082,10 +1082,12 @@ fn main() {
10821082
```
10831083

10841084
<a id="fn-unsafe-safe"></a>
1085-
### Minor: making an `unsafe` function safe
1085+
### Possibly-breaking: making an `unsafe` function safe
10861086

1087-
It is not a breaking change to make a previously `unsafe` function safe, as in
1088-
the example below.
1087+
A previously `unsafe` function can be made safe without breaking code. Note
1088+
however that it will likely cause the [`unused_unsafe`][unused_unsafe] lint
1089+
to trigger as in the example below, which will cause local crates that have
1090+
specified `#![deny(warnings)]` to stop compiling.
10891091

10901092
Going the other way (making a safe function `unsafe`) is a breaking change.
10911093

@@ -1101,7 +1103,7 @@ pub unsafe fn foo() {}
11011103
pub fn foo() {}
11021104
11031105
///////////////////////////////////////////////////////////
1104-
// Example use of the library that will safely work.
1106+
// Example use of the library that will trigger a lint.
11051107
use updated_crate::foo;
11061108
11071109
unsafe fn bar(f: unsafe fn()) {
@@ -1144,10 +1146,6 @@ impl Foo for Bar {
11441146
}
11451147
```
11461148

1147-
Note that local crates that have specified `#![deny(warnings)]` (which is an
1148-
[anti-pattern][deny warnings]) will break, since they've explicitly opted out
1149-
of Rust's stability guarantees.
1150-
11511149
<a id="attr-no-std-to-std"></a>
11521150
### Major: switching from `no_std` support to requiring `std`
11531151

@@ -1555,4 +1553,4 @@ document what your commitments are.
15551553
[SemVer]: https://semver.org/
15561554
[struct literal]: ../../reference/expressions/struct-expr.html
15571555
[wildcard patterns]: ../../reference/patterns.html#wildcard-pattern
1558-
[deny warnings]: https://rust-unofficial.github.io/patterns/anti_patterns/deny-warnings.html
1556+
[unused_unsafe]: ../../rustc/lints/listing/warn-by-default.html#unused-unsafe

0 commit comments

Comments
 (0)