Skip to content

Commit 4126f2d

Browse files
committed
Remove digression regarding behavior of path-dependencies; it no longer occurs on nightly.
1 parent f2733fc commit 4126f2d

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

text/0000-cargo-report-future-incompat.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -69,43 +69,6 @@ warning: borrow of packed field is unsafe and requires unsafe function or block
6969
brash %
7070
```
7171

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-
10972
Cargo passes `--cap-lints=allow` on upstream dependencies for good
11073
reason, as discussed in [Rust RFC 1193][] and the comment thread from
11174
[rust-lang/rust#59658][].

0 commit comments

Comments
 (0)