Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

error-chain doesn't work on stable 1.10! #12

Closed
brson opened this issue Jul 22, 2016 · 6 comments
Closed

error-chain doesn't work on stable 1.10! #12

brson opened this issue Jul 22, 2016 · 6 comments

Comments

@brson
Copy link
Contributor

brson commented Jul 22, 2016

I thought error-chain worked on stable but it doesn't seem to:

brian@ip-10-145-43-250:~/dev/error-chain⟫ cargo test
   Compiling error-chain v0.2.2 (file:///mnt/dev/error-chain)
<error_chain macros>:37:24: 37:27 error: expected expression, found keyword `pub`
<error_chain macros>:37 # [ derive ( Debug ) ] pub struct $ error_name (
                                               ^~~
error: Could not compile `error-chain`.

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

If I try to test further back on 1.9 the errors are even worse:

brian@ip-10-145-43-250:~/dev/error-chain⟫ cargo test
   Compiling gcc v0.3.32
   Compiling cfg-if v0.1.0
   Compiling winapi-build v0.1.1
   Compiling winapi v0.2.8
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 0 }', ../src/libcore/result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Build failed, waiting for other jobs to finish...
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 0 }', ../src/libcore/result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 0 }', ../src/libcore/result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 0 }', ../src/libcore/result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: Could not compile `winapi-build`.

To learn more, run the command again with --verbose.
@benaryorg
Copy link
Contributor

I don't know what's happening here, but I am using error-chain on stable Rust and it seemed to work flawlessly.

@benaryorg
Copy link
Contributor

benaryorg commented Jul 26, 2016

I just checked and error-chain builds (and works) with that:

cargo 0.11.0-nightly (259324c 2016-05-20)
rustc 1.10.0 (cfcb716cf 2016-07-03)

Output of cargo:

   Compiling error-chain v0.2.2
     Running `rustc /home/benaryorg/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.2.2/src/lib.rs --crate-name error_chain --crate-type lib -g -C metadata=08db5cd4c8eb6242 -C extra-filename=-08db5cd4c8eb6242 --out-dir /home/benaryorg/Documents/project/target/debug/deps --emit=dep-info,link -L dependency=/home/benaryorg/Documents/project/target/debug/deps -L dependency=/home/benaryorg/Documents/project/target/debug/deps --extern backtrace=/home/benaryorg/Documents/project/target/debug/deps/libbacktrace-dffaf784d6265843.rlib --cap-lints allow`

(only relevant output displayed)

@brson
Copy link
Contributor Author

brson commented Jul 26, 2016

Oh, nice. Thanks for testing @benaryorg.

@benaryorg
Copy link
Contributor

benaryorg commented Jul 27, 2016

Also, I've retested with version 0.2.2 and still the same result, a seamless build without any error/mistake.

Edit: Original response updated

@birkenfeld
Copy link
Contributor

The problem is with using error_chain inside a function, as in the smoke tests.

It is "easily" (once you figure it out) fixed by appending a semicolon. PR incoming.

@brson brson closed this as completed in 5134800 Aug 7, 2016
brson added a commit that referenced this issue Aug 7, 2016
Fix tests on stable/beta (closes #12)
@brson
Copy link
Contributor Author

brson commented Aug 9, 2016

Thanks @birkenfeld !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants