Skip to content

Commit 947f2a2

Browse files
committed
Updated from FCP
1 parent 0b04c3d commit 947f2a2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

text/0000-path-clarity.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,9 @@ epoch**.
471471
resolve to a top-level definition of `foo`, and otherwise fall back to
472472
available external crates.
473473

474-
- Cargo will provide a new `crate` key for aliasing dependencies, so that
475-
e.g. users who want to use the `rand` crate but call it `random` instead can
476-
now write `random = { version = "0.3", crate = "rand" }`.
474+
- Cargo will provide a new `alias` key for aliasing dependencies, so that
475+
e.g. users who want to use the `rand` crate but call its library crate
476+
`random` instead can now write `rand = { version = "0.3", alias = "random" }`.
477477

478478
- We introduce several lints, which all start out allow-by-default but are
479479
expected to ratchet up over time:
@@ -574,6 +574,15 @@ motivation. The crucial insight of the design is that, by making absolute paths
574574
unambiguous about which crate they draw from, we can solve a number of
575575
confusions and papercuts with the module system.
576576

577+
## Epoch-based migration story
578+
579+
We can avoid the need for fallback in resolution by leveraging epochs instead.
580+
On the current epoch, we would make `crate::` paths available and start warning
581+
about *not* using them for crate-internal paths, but we would not issue warnings
582+
about `extern crate`. In the next epoch, we would change absolute path
583+
interpretations, such that warning-free code on the previous epoch would
584+
continue to compile and have the same meaning.
585+
577586
## Bike-sheddy choices
578587

579588
There are a few aspects of this proposal that could be colored a bit differently
@@ -643,4 +652,6 @@ ideas off into a separate *experimental* RFC:
643652
# Unresolved questions
644653
[unresolved]: #unresolved-questions
645654

646-
None.
655+
- How should we approach migration? Via a fallback, as proposed, or via epochs?
656+
It is probably best to make this determination with more experience,
657+
e.g. after we have a `rustfix` tool in hand.

0 commit comments

Comments
 (0)