You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/0000-cargo-report-future-incompat.md
-37Lines changed: 0 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -69,43 +69,6 @@ warning: borrow of packed field is unsafe and requires unsafe function or block
69
69
brash %
70
70
```
71
71
72
-
Even if `brash` is a path-dependency of `unwary` (which means building
73
-
`unwary` will issue the warning associated with `brash` when it builds
74
-
that crate), but subsequent rebuilds of `unwary` will not rebuild
75
-
`brash`, and thus will not emit the diagnostic for the
76
-
future-incompatibility issue (at least not until `unwary` updates to a
77
-
newer version of `brash` or of Rust itself).
78
-
79
-
Example of today's behavior (where in this case, `brash` is a path dependency of `unwary`):
80
-
81
-
```
82
-
crates % cd unwary
83
-
unwary % cargo build # We *do* see warning on first build...
84
-
Compiling brash v0.1.0 (/tmp/brash)
85
-
warning: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
86
-
--> src/lib.rs:13:9
87
-
|
88
-
13 | let y = &x.data.0;
89
-
| ^^^^^^^^^
90
-
|
91
-
= note: `#[warn(safe_packed_borrows)]` on by default
92
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
93
-
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
94
-
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
95
-
Compiling unwary v0.1.0 (/tmp/unwary)
96
-
Finished dev [unoptimized + debuginfo] target(s) in 0.30s
97
-
unwary % touch src/main.rs
98
-
unwary % cargo build # ... but no warning issued about still-present problem in path dependency.
99
-
Compiling unwary v0.1.0 (/tmp/unwary)
100
-
Finished dev [unoptimized + debuginfo] target(s) in 0.30s
101
-
unwary %
102
-
```
103
-
104
-
Therefore, if the developer does not do something to address the
105
-
warning the first time they see it, it is likely to go unaddressed
106
-
until the developer upgrades to a version of Rust that actually fails
107
-
to compile `brash`. This is a frustrating developer experience.
108
-
109
72
Cargo passes `--cap-lints=allow` on upstream dependencies for good
110
73
reason, as discussed in [Rust RFC 1193][] and the comment thread from
0 commit comments