In some cases, it is easy to see that a change is backwards compatible. However, many changes that seem backwards compatible are not.
On the other hand, some kinds of changes rarely break code. We have to decide whether these are considered to be “practically backwards-compatible”.
Here are some edge cases:
-
Adding
pub
items to apub mod
-
Causes name clashes due to glob imports
-
Adding
pub fn
inherent methods to apub
type -
Causes name clashes with
trait
methods. -
Adding object-safe provided methods to
pub trait
s -
Causes name clashes with inherent methods due to autoderef / autoref
-
Adding
#[must_use]
to a type or afn
-
Breaks code with
#![deny(unused_must_use)]
-
Implementing
Drop
for a type -
Breaks
unsafe
code that assumes noDrop
impl’s -
Adding private fields
-
Breaks some
unsafe
code, e.g.transmute()
andVec::map_in_place()
. -
Changes the result of
size_of()
.