Skip to content

cargo fmt fails with half_open_range_patterns #4009

Closed
@JohnTitor

Description

@JohnTitor

This example compiles fine with latest nightly, but cargo fmt fails. The failure also occurs on clippy's CI (https://travis-ci.com/rust-lang/rust-clippy/jobs/274511513).
Probably we need rustup and update submodule on rust-lang/rust?

#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]

fn main() {
    match 54 {
        5.. => println!("yay!"),
        _ => (),
    }
}

error log:

error: `X..` range patterns are not supported
 --> main.rs:6:9
  |
6 |         5.. => println!("yay!"),
  |         ^^^ help: try using the maximum value for the type: `5..MAX`

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked on rustc, an RFC, etc.bugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions