Path hanger extern
instead of crate declarations
#49
Labels
A-module-system
Area: Module system
A-name-resolution
Area: Name resolution
A-syntax
Area: Syntax
T-proposal
Type: Proposed feature which might not actually be accepted
Remove crate declarations (
crate my-lovely-library
) from the language and replace them by paths beginning with the path hangerexternal
crates
extern
being a new keyword (extern.my-lovely-library
).Conceptually, we now have two roots in the module system:
crate
for the current crate being compiled(…) andcrates
for all the--link
ed library dependencies. For the purpose of documentation, let me inform you that before, we only had one –crate
– and dependencies would be mounted into this single tree with duplicate crate declarations linking to the identical crate.Motivations
core
!. Before, those would need to somehow inject a crate declaration somewhere close with a hygienic name. Horrendous! One example: Lowering sequence literals. Another one: Derive macros.use
bindings from an external crate directly with a single declaration (a use declaration) instead of two (a crate and a use declaration)--link
or the crate manifestpackage.json5
, rather than declared by the current crate (which might lead to the assumption that crate metadata is or should be in code like@(version ">=2.3.2") crate extension
(whether that's a good thing or not))Example
Currently
Then
The text was updated successfully, but these errors were encountered: