Constant evaluation error at wrong location #40604
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
When I try to pattern match on a constant created by a
const_fn
across two crates, I get a constant evaluation error (E0080) that points to a completely random location.Minimal Example
In
bar/src/lib.rs
:In
foo/Cargo.toml
:In
foo/src/lib.rs
:The Error
When running
cargo build
infoo
, the following error occurs on nightly (0aeb9c1 2017-03-15):It doesn't happen when I merge the
Foo
struct from thebar
crate into thefoo
crate or when I replace theFoo::new(0)
call withFoo(0)
.The text was updated successfully, but these errors were encountered: