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

Compiler keeps running after it emits a compilation error #51374

Closed
DutchGhost opened this issue Jun 5, 2018 · 1 comment
Closed

Compiler keeps running after it emits a compilation error #51374

DutchGhost opened this issue Jun 5, 2018 · 1 comment

Comments

@DutchGhost
Copy link
Contributor

DutchGhost commented Jun 5, 2018

The following code does not compile, however the compiler keeps running after emitting a message it could not compile:
https://play.rust-lang.org/?gist=7dc801439d22e1d11c9025092d757099&version=stable&mode=debug

const q: () = 'a: while (continue 'a != break 'a) {};

fn main() {
    let q: ();
}

The error is:

|                                         ^^^^^^^^
  |
  = note: #[warn(unreachable_code)] on by default

error[E0019]: constant contains unimplemented expression type
 --> src/main.rs:1:26
  |
1 | const q: () = 'a: while (continue 'a != break 'a) {};
  |                          ^^^^^^^^^^^

warning: Constant evaluating a complex constant, this might take some time
 --> src/main.rs:1:1
  |
1 | const q: () = 'a: while (continue 'a != break 'a) {};
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

when let q: (); is removed, it just fails to compile, and rustc stops running.

@betawaffle
Copy link

Duplicate of #50637

@oli-obk oli-obk closed this as completed Jun 5, 2018
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

No branches or pull requests

3 participants