Skip to content

are feature gates for tuple indexing and slicing properly enforced? #18180

Closed

Description

@pnkfelix

I have seen evidence that both tuple indexing and slicing syntax are silently allowed by rustc, rather than requiring the feature gate turned on to enable them.

It could be that I missed some step along the way where these features were officially enabled. But I think its more likely that someone has accidentally turned them both on somehow, especially since the team discussion from last Thursday on #18006 included statements that tuple-indexing is meant to be feature gated.

% cat /tmp/f.rs 
fn main() {
    let t = ('a', 'b', 'c');
    let v = vec!['x', 'y', 'z'];
    println!("t: {} v: {}", t.1, v[]);
}
% rustc-0.12-x64 --version=verbose
rustc 0.12.0 (ba4081a5a 2014-10-07 13:44:41 -0700)
binary: rustc
commit-hash: ba4081a5a8573875fed17545846f6f6902c8ba8d
commit-date: 2014-10-07 13:44:41 -0700
host: x86_64-apple-darwin
release: 0.12.0
% rustc-0.12-x64 /tmp/f.rs 
% rustc --version
rustc 0.13.0-dev (4480caf2a 2014-10-18 06:22:15 +0000)
% rustc /tmp/f.rs 
% ./f
t: b v: [x, y, z]
% 

Activity

  1. pnkfelix commented on Oct 20, 2014

    @pnkfelix
    ContributorAuthor

    Note that I demonstrated running both the release (0.12) and a recent development (4480caf) build of rustc on the file that is using these features without the gate.

  2. nrc commented on Oct 20, 2014

    @nrc
    Member
  3. pnkfelix commented on Oct 20, 2014

    @pnkfelix
    ContributorAuthor

    oh... right.

  4. pnkfelix commented on Oct 20, 2014

    @pnkfelix
    ContributorAuthor

    (closing as duplicate of #18102 )

  5. added a commit that references this issue on Oct 8, 2024
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions