]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #80394 - RalfJung:const-err-future, r=oli-obk
authorMara Bos <m-ou.se@m-ou.se>
Wed, 3 Feb 2021 17:51:12 +0000 (18:51 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Feb 2021 17:51:12 +0000 (18:51 +0100)
make const_err a future incompat lint

This is the first step for https://github.com/rust-lang/rust/issues/71800: make const_err a future-incompat lint. I also rewrote the const_err lint description as the old one seemed wrong.

This has the unfortunate side-effect of making const-eval error even more verbose by making the const_err message longer without fixing the redundancy caused by additionally emitting an error on each use site of the constant. We cannot fix that redundancy until const_err is a *hard* error (at that point the error-on-use-site can be turned into a `delay_span_bug!` for uses of monomorphic consts, and into a nicely rendered error for [lazily / post-monomorhization evaluated] associated consts).

~~The one annoying effect of this PR is that `let _x = &(1/(1-1));` now also shows the future-incompat warning, even though of course we will *not* make this a hard error. We'll instead (hopefully) stop promoting it -- see https://github.com/rust-lang/rfcs/pull/3027. The only way I see to avoid the future-incompat warning is to use a different lint for "failure to evaluate promoted".~~

Cc `@rust-lang/wg-const-eval`


Trivial merge