Open Manishearth opened 4 years ago
My proposal is that foo/bar
is always "feature bar
of crate foo
" (and it will provide a helpful error message when foo/bar
exists but foo
does not), and if you want to enable a namespaced crate, you use foo/bar/
This doesn't quite fix the situation where you have foo/bar/baz
which can either be foo/bar
feature baz
or foo
feature bar/baz
. This seems rare in practice, we can just pick one (foo/bar
feature baz
IMO since foo/bar
AND bar/baz
existing in the same deptree seems unlikely) and if you want the other one you explicitly define a feature. Alternatively we require an extra slash, i.e. foo/bar//baz
Continuing from this comment:
With the proposal of separator being :
, there will no more disambiguates:
bar
in namespace foo
: foo:bar
bar
feature of crate foo
: foo/bar
baz
feature of crate bar
in namespace foo
: foo:bar/baz
bar/baz
feature of crate foo
: foo/bar/baz
(Colons are no longer free to use, see https://doc.rust-lang.org/nightly/cargo/reference/features.html#optional-dependencies)
Not a big blocker, we can make it ::
Features can be specified as
crate/feature
, which makesfoo/bar
ambiguous with "featurebar
of cratefoo
" and "optional crate `foo/bar".We need a way to resolve ambiguity in the feature syntax