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

Regression "pattern _ not covered" in objc-encode-0.0.2, Rust 1.16 #40250

Closed
brson opened this issue Mar 4, 2017 · 8 comments
Closed

Regression "pattern _ not covered" in objc-encode-0.0.2, Rust 1.16 #40250

brson opened this issue Mar 4, 2017 · 8 comments
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@brson
Copy link
Contributor

brson commented Mar 4, 2017

brian@ip-10-145-43-250:~/dev/rust-objc-encode⟫ git remote -v
origin  https://github.com/SSheldon/rust-objc-encode (fetch)
origin  https://github.com/SSheldon/rust-objc-encode (push)
brian@ip-10-145-43-250:~/dev/rust-objc-encode⟫ git log -1
commit 1e377bf4481835767a5e31aa5480aa8ac91b56de
Author: Steven Sheldon <steven@sasheldon.com>
Date:   Sun Feb 19 16:43:21 2017 -0800

    Bumped to version 0.0.2
error[E0004]: non-exhaustive patterns: `_` not covered
  --> src/encoding/never.rs:16:15
   |
16 |         match self { }
   |               ^^^^ pattern `_` not covered

error[E0004]: non-exhaustive patterns: `_` not covered
  --> src/encoding/never.rs:22:15
   |
22 |         match self { }
   |               ^^^^ pattern `_` not covered

error[E0004]: non-exhaustive patterns: `_` not covered
  --> src/encoding/never.rs:26:15
   |
26 |         match self { }
   |               ^^^^ pattern `_` not covered

error[E0004]: non-exhaustive patterns: `_` not covered
  --> src/encoding/never.rs:32:15
   |
32 |         match self { }
   |               ^^^^ pattern `_` not covered

error: aborting due to 4 previous errors

error: build failed

The type is defined as

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Never { }

cc @SSheldon

@brson brson added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Mar 4, 2017
@brson
Copy link
Contributor Author

brson commented Mar 4, 2017

Actually, on beta.3 the error is

error[E0004]: non-exhaustive patterns: type &encoding::never::Never is non-empty
  --> src/encoding/never.rs:16:15
   |
16 |         match self { }
   |               ^^^^
   |
help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms.
  --> src/encoding/never.rs:16:15
   |
16 |         match self { }
   |               ^^^^

error[E0004]: non-exhaustive patterns: type &encoding::never::Never is non-empty
  --> src/encoding/never.rs:22:15
   |
22 |         match self { }
   |               ^^^^
   |
help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms.
  --> src/encoding/never.rs:22:15
   |
22 |         match self { }
   |               ^^^^

error[E0004]: non-exhaustive patterns: type &encoding::never::Never is non-empty
  --> src/encoding/never.rs:26:15
   |
26 |         match self { }
   |               ^^^^
   |
help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms.
  --> src/encoding/never.rs:26:15
   |
26 |         match self { }
   |               ^^^^

error[E0004]: non-exhaustive patterns: type &encoding::never::Never is non-empty
  --> src/encoding/never.rs:32:15
   |
32 |         match self { }
   |               ^^^^
   |
help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms.
  --> src/encoding/never.rs:32:15
   |
32 |         match self { }
   |               ^^^^

error: aborting due to 4 previous errors

error: build failed

@SSheldon
Copy link
Contributor

SSheldon commented Mar 4, 2017

Also commented on #38972 about this, wasn't sure if it was covered by that issue or not though: #38972 (comment)

As far as I know, this should also impact the Void crate, which is used by more stuff

@SSheldon
Copy link
Contributor

SSheldon commented Mar 4, 2017

Ah actually, nevermind, the difference is that the void crate matches a value, where I was matching a reference. The repro case I gave in #38972 is:

enum Void { }

fn use_void(v: &Void) -> u32 {
    match v { }
}

fn main() { }

@arielb1
Copy link
Contributor

arielb1 commented Mar 4, 2017

The regression on matching &Void is intentional - matching on &Void being allowed was a pirate feature in 1.14.0 1.15.0.

@arielb1 arielb1 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 4, 2017
@SSheldon
Copy link
Contributor

SSheldon commented Mar 5, 2017

So the repro case I gave would only ever have compiled on 1.15? It was feature-gated in 1.14 and is disallowed again in 1.16?

@arielb1
Copy link
Contributor

arielb1 commented Mar 6, 2017

@SSheldon

It was not even feature gated in 1.14 - it just didn't work. The feature was introduced in PR #36449 in 1.15.0 without proper consideration.

@SSheldon
Copy link
Contributor

SSheldon commented Mar 7, 2017

Ah welp, guess I was just writing the wrong code at the right time. Nothing is using objc-encode yet so I can just change it.

SSheldon added a commit to SSheldon/rust-objc-encode that referenced this issue Mar 7, 2017
Apparently 1.15 was the only window where this code would be accepted:
rust-lang/rust#40250.
@brson
Copy link
Contributor Author

brson commented Mar 9, 2017

Seems like this is expected behavior. Thanks @arielb1 and @SSheldon.

@brson brson closed this as completed Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants