Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX #21475: Parsing interval match patterns with path #21521

Merged
merged 3 commits into from
Feb 28, 2015

Conversation

defuz
Copy link
Contributor

@defuz defuz commented Jan 22, 2015

Fixing #21475. Right now this code can not be parsed:

use m::{START, END};

fn main() {
    match 42u32 {
        m::START...m::END => {}, // error: expected one of `::`, `=>`, or `|`, found `...`
        _  => {},
    }
}

mod m {
  pub const START: u32 = 4;
  pub const END:   u32 = 14;
}

I fixed the parser and added test for this case, but now there are still problems with mixing literals and paths in interval:

    match 42u32 {
        0u32...m::END => {},       // mismatched types in range [E0031]
        m::START...59u32 => {},    // mismatched types in range [E0031]
        _  => {},
    }
}

I'll try fix this problem and need review.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@pnkfelix
Copy link
Member

pnkfelix commented Feb 5, 2015

@defuz

Sorry for taking so long to respond; have you made any progress fixing the other issue you noted?

@defuz defuz force-pushed the interval-with-path branch from 8730539 to eb34eaf Compare February 18, 2015 18:21
@defuz
Copy link
Contributor Author

defuz commented Feb 18, 2015

Hi @pnkfelix!
As far as I can see, @eddyb has already fixed the problem which leads to incorrect comparison between constants and literals (#21744). So I uncommented test and I think this pull request can be successfully merged.

@defuz
Copy link
Contributor Author

defuz commented Feb 24, 2015

@pnkfelix ping

@pnkfelix
Copy link
Member

@defuz will review

@pnkfelix
Copy link
Member

@bors r+ eb34eaf

@bors
Copy link
Contributor

bors commented Feb 27, 2015

⌛ Testing commit eb34eaf with merge 61f2d09...

@bors
Copy link
Contributor

bors commented Feb 27, 2015

💔 Test failed - auto-mac-32-opt

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented Feb 27, 2015

@bors
Copy link
Contributor

bors commented Feb 27, 2015

💔 Test failed - auto-win-32-opt

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented Feb 27, 2015

@bors
Copy link
Contributor

bors commented Feb 27, 2015

💔 Test failed - auto-linux-64-opt

@alexcrichton
Copy link
Member

@bors: retry clean

@bors
Copy link
Contributor

bors commented Feb 27, 2015

⌛ Testing commit eb34eaf with merge cae5f94...

@bors
Copy link
Contributor

bors commented Feb 27, 2015

💔 Test failed - auto-mac-64-nopt-t

@defuz defuz force-pushed the interval-with-path branch from eb34eaf to 6c35bf4 Compare February 28, 2015 09:01
@defuz
Copy link
Contributor Author

defuz commented Feb 28, 2015

@alexcrichton @pnkfelix retry?

@alexcrichton
Copy link
Member

@bors: r=pnkfelix 6c35bf4

@bors
Copy link
Contributor

bors commented Feb 28, 2015

⌛ Testing commit 6c35bf4 with merge 8902936...

bors added a commit that referenced this pull request Feb 28, 2015
Fixing #21475. Right now this code can not be parsed:

```rust
use m::{START, END};

fn main() {
    match 42u32 {
        m::START...m::END => {}, // error: expected one of `::`, `=>`, or `|`, found `...`
        _  => {},
    }
}

mod m {
  pub const START: u32 = 4;
  pub const END:   u32 = 14;
}
```

I fixed the parser and added test for this case, but now there are still problems with mixing literals and paths in interval:

```rust
    match 42u32 {
        0u32...m::END => {},       // mismatched types in range [E0031]
        m::START...59u32 => {},    // mismatched types in range [E0031]
        _  => {},
    }
}
```

I'll try fix this problem and need review.
@bors bors merged commit 6c35bf4 into rust-lang:master Feb 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants