Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const_evaluatable_checked: Stop eagerly erroring in is_const_evaluatable #82707

Merged
merged 4 commits into from
Mar 21, 2021

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Mar 2, 2021

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 2, 2021
@lcnr lcnr added A-const-generics Area: const generics (parameters and arguments) F-generic_const_exprs `#![feature(generic_const_exprs)]` labels Mar 2, 2021
@rust-log-analyzer

This comment has been minimized.

@crlf0710
Copy link
Member

r? @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Mar 20, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Mar 20, 2021

📌 Commit 8e353bb has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2021
Rollup of 6 pull requests

Successful merges:

 - rust-lang#82707 (const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable`)
 - rust-lang#83040 (extract `ConstKind::Unevaluated` into a struct)
 - rust-lang#83280 (Fix pluralization in keyword docs)
 - rust-lang#83289 (Move some tests to more reasonable directories - 5)
 - rust-lang#83306 (Extend `proc_macro_back_compat` lint to `js-sys`)
 - rust-lang#83327 (Extend comment in `UsedLocals::visit_lhs`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3a113f1 into rust-lang:master Mar 21, 2021
@bors
Copy link
Contributor

bors commented Mar 21, 2021

⌛ Testing commit 8e353bb with merge bbf07c0...

@rustbot rustbot added this to the 1.52.0 milestone Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) F-generic_const_exprs `#![feature(generic_const_exprs)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
9 participants