Skip to content

Should the sets of library and language features be disjoint? #43089

Closed

Description

@est31

Currently, there is a check in tidy that ensures that there is no library feature and language feature of the same name. Its presence is also mentioned in the documentation above.

This check was present since #21248, and has caused multiple additions that have both library and language components to be split up:

  • i128 / i128_type
  • inclusive_range / inclusive_range_syntax
  • profiler_runtime / profiler_runtime_lib

PR #40939 has challenged the status quo, by reusing the lang feature proc_macro inside libraries provided to programs. It actually added an exception to the tidy check in order to get it passing.

There has been discussion about this in the thread of #40939 and the resolution was to allow proc_macro to share the feature gate.

So my question is: which purpose does this check serve? should the check be present, or should it be abolished? Should the proc_macro feature gate be split up into a library component and a lang component?

Activity

  1. changed the title [-]Should the sets of library and language features be disjunct?[/-] [+]Should the sets of library and language features be disjoint?[/+] on Jul 6, 2017
  2. durka commented on Jul 6, 2017

    @durka
    Contributor

    IMO we should just kill the tidy check. For inclusive ranges we are stabilizing the lib and syntax separately, but if they had been under the same gate it would have been easy to split them up, like we are doing for const fn.

  3. nikomatsakis commented on Jul 6, 2017

    @nikomatsakis
    Contributor

    I too think we should lump things that are "the same underlying concept" under one feature gate.

  4. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.
    on Jul 6, 2017
  5. aidanhs commented on Jul 6, 2017

    @aidanhs
    Contributor

    Looks like the original code allowed for a 'joint features' whitelist, so it seems like it might have just been a sanity check that any intersection was intentional. Indeed, that script actually says that it's for doing some sanity checks.

    If for some reason that sanity check is still desirable, at minimum I'd be +1 to creating a joint_features whitelist rather than ad-hoc growing the if condition.

  6. est31 commented on Jul 6, 2017

    @est31
    MemberAuthor

    it seems like it might have just been a sanity check that any intersection was intentional

    We can guard from that by doing a check for any joint features whether the tracking issue and stability status (stable or unstable) matches between lib and lang features.

  7. added a commit that references this issue on Jul 15, 2017
    94fc09c
  8. added a commit that references this issue on Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions