]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #82707 - BoxyUwU:errooaaar, r=oli-obk
authorDylan DPC <dylan.dpc@gmail.com>
Sun, 21 Mar 2021 01:01:34 +0000 (02:01 +0100)
committerGitHub <noreply@github.com>
Sun, 21 Mar 2021 01:01:34 +0000 (02:01 +0100)
commit3a113f18f8f2a9b99ae0212b5a27bd56a24655c3
treef75e0d066cefb294363bee1bf1d53542b4904eb7
parent61edfd591cedff66fca639c02f66984f6271e5a6
parent8e353bb8eabc761d8fd800a985a859dd635adaa2
Rollup merge of #82707 - BoxyUwU:errooaaar, r=oli-obk

const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable`

Fixes #82279

We don't want to be emitting errors inside of is_const_evaluatable because we may call this during selection where it should be able to fail silently

There were two errors being emitted in `is_const_evaluatable`. The one causing the compile error in #82279 was inside the match arm for `FailureKind::MentionsParam` but I moved the other error being emitted too since it made things cleaner imo

The `NotConstEvaluatable` enum \*should\* have a fourth variant for when we fail to evaluate a concrete const, e.g. `0 - 1` but that cant happen until #81339

cc `@oli-obk` `@lcnr`
r? `@nikomatsakis`
compiler/rustc_middle/src/traits/mod.rs
compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
compiler/rustc_trait_selection/src/traits/fulfill.rs