Description
Sub-bug of #5677
Currently, extern mod
directives take an identifier, like: extern mod foo;
. We need to instead allow two different forms of extern mod
:
First, extern mod foo = "github.com/catamorphism/an-awesome-package-called-foo";
Second, extern mod "github.com/catamorphism/a_valid_identifier";
In the first case, you specify that foo
is the short name for the package at the URL (or URL-fragment) on the right-hand side of the =. This allows remote paths to contain any Unicode characters while also associating the package with a valid Rust identifier.
In the second case, rustpkg guesses that a_valid_identifier
is the short name. Omitting the foo =
in the first case would be a usage error, since the stem of the URL fragment is not a valid identifier (it contains hyphens).