Skip to content

Unreachable expression in void-1.0.2, Rust 1.16 #38975

Closed
@brson

Description

@brson

https://github.com/reem/rust-void.git a6e061227f47ba8798b7e828ed0ac4e25382eb15

Not on stable/beta.

128 brian@ip-10-145-43-250:~⟫ rustc +nightly -Vv
rustc 1.16.0-nightly (47c8d9fdc 2017-01-08)
binary: rustc
commit-hash: 47c8d9fdcf2e6502cf4ca7d7f059fdc1a2810afa
commit-date: 2017-01-08
host: x86_64-unknown-linux-gnu
release: 1.16.0-nightly
LLVM version: 3.9
brian@ip-10-145-43-250:~/dev/rust-void⟫ cargo +nightly test
   Compiling void v1.0.2 (file:///mnt2/dev/rust-void)
warning: unreachable pattern, #[warn(unreachable_patterns)] on by default
  --> src/lib.rs:98:13
   |
98 |             Err(e) => unreachable(e)
   |             ^^^^^^

warning: unreachable pattern, #[warn(unreachable_patterns)] on by default
   --> src/lib.rs:116:13
    |
116 |             Ok(v) => unreachable(v),
    |             ^^^^^

error: unreachable pattern
  --> src/lib.rs:98:13
   |
98 |             Err(e) => unreachable(e)
   |             ^^^^^^
   |
note: lint level defined here
  --> src/lib.rs:1:24
   |
1  | #![cfg_attr(test, deny(warnings))]
   |                        ^^^^^^^^

error: unreachable pattern
   --> src/lib.rs:116:13
    |
116 |             Ok(v) => unreachable(v),
    |             ^^^^^

error: aborting due to 2 previous errors

Build failed, waiting for other jobs to finish...
error: Could not compile `void`.

To learn more, run the command again with --verbose.

The code here is interesting. I don't quite see what the compiler does.

cc @reem

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemP-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions