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

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

Comments

Projects
None yet
3 participants
@brson
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

This comment has been minimized.

Show comment
Hide comment
@benaryorg

benaryorg Jul 26, 2016

Contributor

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

Contributor

benaryorg commented Jul 26, 2016

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

@benaryorg

This comment has been minimized.

Show comment
Hide comment
@benaryorg

benaryorg Jul 26, 2016

Contributor

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)

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

This comment has been minimized.

Show comment
Hide comment
@brson

brson Jul 26, 2016

Contributor

Oh, nice. Thanks for testing @benaryorg.

Contributor

brson commented Jul 26, 2016

Oh, nice. Thanks for testing @benaryorg.

@benaryorg

This comment has been minimized.

Show comment
Hide comment
@benaryorg

benaryorg Jul 27, 2016

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@birkenfeld

birkenfeld Aug 6, 2016

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.

Contributor

birkenfeld commented Aug 6, 2016

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 in 5134800 Aug 7, 2016

brson added a commit that referenced this issue Aug 7, 2016

Merge pull request #28 from birkenfeld/issue-12
Fix tests on stable/beta (closes #12)
@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson Aug 9, 2016

Contributor

Thanks @birkenfeld !

Contributor

brson commented Aug 9, 2016

Thanks @birkenfeld !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment