rfc, cfg-path-version: add `usable` to bikeshed.

This commit is contained in:
Mazdak Farrokhzad 2018-08-19 11:07:58 +02:00
parent 3abb76f782
commit 4601f1c4c4
1 changed files with 4 additions and 3 deletions

View File

@ -445,6 +445,7 @@ One might consider other names for the flag instead of `accessible`.
Some contenders are:
+ `path_accessible`
+ `usable`
+ `can_use`
+ `path_exists`
+ `have_path`
@ -461,8 +462,8 @@ we argue that from the context of seeing `accessible(::std::foo::bar)`
it is clear that it is paths we are talking about because the argument
is a path and not something else.
While `can_use` is also a strong contender, we reject this option because
it may imply to the user that only things that you may `use $path;` can
While `can_use` and `usable` are also strong contenders, we reject these options
because they may imply to the user that only things that you may `use $path;` can
go in there. Meanwhile, you may `#[cfg(accessible(::foo::MyTrait::my_method))`
which is *not* possible as `use ::foo::MyTrait::my_method;`. This also applies
to other associated items and inherent methods as well as `struct` fields.
@ -671,4 +672,4 @@ The ability to have optional cargo dependencies is out of scope for this RFC.
> check against feature-gates (assuming the set of `#![feature(...)]`s in
> the local crate is known at `cfg`-stripping time).
3. Should we allow referring to fields of type definitions in `accessible(..)`?
3. Should we allow referring to fields of type definitions in `accessible(..)`?