Skip to content

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

Closed
@pnkfelix

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]
% 

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