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

"every suggestion should have at least one span" #86

Closed
dtolnay opened this issue Nov 22, 2017 · 3 comments
Closed

"every suggestion should have at least one span" #86

dtolnay opened this issue Nov 22, 2017 · 3 comments

Comments

@dtolnay
Copy link
Contributor

dtolnay commented Nov 22, 2017

On the most recent nightly, 1.23.0-nightly (63739ab7b 2017-11-21), my compile-fail tests started failing with this error. The issue is reproduced as well in the test-project test cases in this repo. Is there a fix we need to grab from upstream?

test [compile-fail] compile-fail/asm-gated.rs ... FAILED
test [compile-fail] compile-fail/mut-suggestion.rs ... FAILED
test [compile-fail] compile-fail/multiple-errors.rs ... FAILED
test [compile-fail] compile-fail/trait-bounds-cant-coerce.rs ... FAILED
test [compile-fail] compile-fail/vector-cast-weirdness.rs ... FAILED
test [compile-fail] compile-fail/where-for-self.rs ... FAILED

failures:

---- [compile-fail] compile-fail/asm-gated.rs stdout ----
	thread '[compile-fail] compile-fail/asm-gated.rs' panicked at 'every suggestion should have at least one span', /checkout/src/libcore/option.rs:874:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- [compile-fail] compile-fail/mut-suggestion.rs stdout ----
	thread '[compile-fail] compile-fail/mut-suggestion.rs' panicked at 'every suggestion should have at least one span', /checkout/src/libcore/option.rs:874:4

---- [compile-fail] compile-fail/multiple-errors.rs stdout ----
	thread '[compile-fail] compile-fail/multiple-errors.rs' panicked at 'every suggestion should have at least one span', /checkout/src/libcore/option.rs:874:4

---- [compile-fail] compile-fail/trait-bounds-cant-coerce.rs stdout ----
	thread '[compile-fail] compile-fail/trait-bounds-cant-coerce.rs' panicked at 'every suggestion should have at least one span', /checkout/src/libcore/option.rs:874:4

---- [compile-fail] compile-fail/vector-cast-weirdness.rs stdout ----
	thread '[compile-fail] compile-fail/vector-cast-weirdness.rs' panicked at 'every suggestion should have at least one span', /checkout/src/libcore/option.rs:874:4

---- [compile-fail] compile-fail/where-for-self.rs stdout ----
	thread '[compile-fail] compile-fail/where-for-self.rs' panicked at 'every suggestion should have at least one span', /checkout/src/libcore/option.rs:874:4
@valff valff mentioned this issue Nov 22, 2017
@valff
Copy link
Contributor

valff commented Nov 22, 2017

Here is a temporary fix until upstream is merged. Add the following to the Cargo.toml.

[patch.crates-io.compiletest_rs]
git = "https://github.com/valff/compiletest-rs"

@dtolnay
Copy link
Contributor Author

dtolnay commented Nov 22, 2017

Thanks, I can confirm that fixes it.

@laumann
Copy link
Collaborator

laumann commented Nov 23, 2017

@dtolnay v0.3.2 is out

hcpl added a commit to hcpl/num-derive that referenced this issue Dec 25, 2017
- Update `quote` and `syn` to parse new Rust syntax;
- Update `compiletest_rs` to solve
  Manishearth/compiletest-rs#86;
- Add support for arbitrary constant expressions as enum discriminants;
- Remove the need to `extern crate num` just for deriving.
bors bot added a commit to rust-num/num-derive that referenced this issue Jan 22, 2018
3: Update deps and derivation algorithm r=cuviper a=hcpl

Fixes #2.

An updated version of rust-num/num#353 which includes suggestions outlined [here](rust-num/num#353 (review)) and [here](https://github.com/rust-num/num/pull/353/files/76b5b2189f2b45e864e14c38c7856be578125931#r157100221):

- Update `quote` and `syn` to parse new Rust syntax;
- Update `compiletest_rs` to solve Manishearth/compiletest-rs#86;
- Add support for arbitrary constant expressions as enum discriminants;
- Remove the need to `extern crate num` just for deriving.

Some notes:
- `#[derive(FromPrimitive)]` now uses if-else to do its job because non-literal expressions are not allowed for pattern matching.
- I added tests for self-containment of `#[derive]` alongside the code testing derivation functionality to keep the tests small. Would it be better to separate concerns?
- `with_custom_value` should have all three tests like `trivial`.
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