Commit graph

6 commits

Author SHA1 Message Date
Smitty
4fe4ff95f6 Use better error message for hard errors in CTFE
Currently the same message is used for hard errors and soft errors. This
makes hard errors use a message that indicates the reality of the
situation correctly, since usage of the constant is never allowed when
there was a hard error evaluating it.
2021-06-15 19:16:10 -04:00
Aaron Hill
2779fc1c47
Emit a hard error when a panic occurs during const-eval
Previous, a panic during const evaluation would go through the
`const_err` lint. This PR ensures that such a panic always causes
compilation to fail.
2021-05-30 11:59:54 -05:00
Ralf Jung
8477d352ac make const_err a future incompat lint 2021-02-03 15:45:43 +01:00
David Hewitt
8d43b3cbb9 Add #[cfg(panic = "...")] 2020-11-09 15:30:49 +00:00
Dylan MacKenzie
d6139f76c0 Update tests 2020-06-28 10:08:10 -07:00
Dylan MacKenzie
5c377f37e4 Reorganize, bless and add tests for const control flow
This creates a new test directory, `ui/consts/control-flow` to hold
tests related to control flow in a const context. It also blesses all
existing tests with the new error messages, and adds new tests for the
`const_if_match` feature.
2019-11-21 16:55:13 -08:00