Stream: t-compiler/const-eval

Topic: Undef enum discriminant


RalfJ (Nov 01 2018 at 13:34, on Zulip):

@Oli any idea why this does not error in validation? https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be20fc6e56ea2fec2ebd34eb375b5bd9

oli (Nov 01 2018 at 13:36, on Zulip):

uh... does playground nightly contain my query-PR already?

RalfJ (Nov 01 2018 at 13:37, on Zulip):

I get the same locally. discovered it while working on that visitor PR.

oli (Nov 01 2018 at 13:37, on Zulip):

oh

oli (Nov 01 2018 at 13:38, on Zulip):

it's not a validation error

oli (Nov 01 2018 at 13:38, on Zulip):

it's a regular const eval error

oli (Nov 01 2018 at 13:38, on Zulip):

because of Scalar layout

RalfJ (Nov 01 2018 at 13:38, on Zulip):

yes. but validation should complain as well.

oli (Nov 01 2018 at 13:38, on Zulip):

no, validation is never reached

oli (Nov 01 2018 at 13:38, on Zulip):

we bail out before we get to validation

RalfJ (Nov 01 2018 at 13:39, on Zulip):

oh?

RalfJ (Nov 01 2018 at 13:39, on Zulip):

ah because we cannot create a ConstValue

oli (Nov 01 2018 at 13:39, on Zulip):

https://github.com/rust-lang/rust/blob/master/src/librustc_mir/const_eval.rs#L588

RalfJ (Nov 01 2018 at 13:39, on Zulip):

that's so odd that that makes it less hard of an error...

oli (Nov 01 2018 at 13:39, on Zulip):

and_then only enters if it's Ok

oli (Nov 01 2018 at 13:39, on Zulip):

yea :frown:

oli (Nov 01 2018 at 13:40, on Zulip):

maybe we can push that back and do the conversion to ConstValue after validation?

RalfJ (Nov 01 2018 at 13:44, on Zulip):

so, letting const_eval_raw always return an allocation and doing the conversion later? seems reasonable.

Jake Goulding (Nov 01 2018 at 22:12, on Zulip):

playground nightly contain

The version of both nightly and miri are in their respective menus, BTW

Last update: Nov 15 2019 at 21:35UTC