@@ -88,7 +88,7 @@ considered incompatible.
88
88
* [ Possibly-breaking: introducing a new function type parameter] ( #fn-generic-new )
89
89
* [ Minor: generalizing a function to use generics (supporting original type)] ( #fn-generalize-compatible )
90
90
* [ 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 )
92
92
* Attributes
93
93
* [ Major: switching from ` no_std ` support to requiring ` std ` ] ( #attr-no-std-to-std )
94
94
* [ 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() {
1082
1082
```
1083
1083
1084
1084
<a id =" fn-unsafe-safe " ></a >
1085
- ### Minor : making an ` unsafe ` function safe
1085
+ ### Possibly-breaking : making an ` unsafe ` function safe
1086
1086
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.
1089
1091
1090
1092
Going the other way (making a safe function ` unsafe ` ) is a breaking change.
1091
1093
@@ -1101,7 +1103,7 @@ pub unsafe fn foo() {}
1101
1103
pub fn foo() {}
1102
1104
1103
1105
///////////////////////////////////////////////////////////
1104
- // Example use of the library that will safely work .
1106
+ // Example use of the library that will trigger a lint .
1105
1107
use updated_crate::foo;
1106
1108
1107
1109
unsafe fn bar(f: unsafe fn()) {
@@ -1144,10 +1146,6 @@ impl Foo for Bar {
1144
1146
}
1145
1147
```
1146
1148
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
-
1151
1149
<a id =" attr-no-std-to-std " ></a >
1152
1150
### Major: switching from ` no_std ` support to requiring ` std `
1153
1151
@@ -1555,4 +1553,4 @@ document what your commitments are.
1555
1553
[ SemVer ] : https://semver.org/
1556
1554
[ struct literal ] : ../../reference/expressions/struct-expr.html
1557
1555
[ 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