-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove const eval loop detector #70087
Remove const eval loop detector #70087
Conversation
This comment has been minimized.
This comment has been minimized.
d9e1918
to
044dc6e
Compare
@bors try |
⌛ Trying commit 044dc6e with merge f88e9a4452e792c29632101b348a1df9876d45cd... |
☀️ Try build successful - checks-azure |
@craterbot check |
🔒 Error: you're not allowed to interact with this bot. 🔑 If you are a member of the Rust team and need access, add yourself to the whitelist. |
@Centril well looks like I still need your help to start a crater run, sorry. |
Weird... cc @pietroalbini @craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
| | ||
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 }; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information | ||
= help: add `#![feature(const_if_match)]` to the crate attributes to enable | ||
|
||
warning: Constant evaluating a complex constant, this might take some time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be useful to keep around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean at like 1% or 10% of the step limit? Not sure how to choose a good number for that, but anything above 10% of the step limit seems useless since you're hitting the step limit soon, and anything below 30s will likely be annoying more often than not. It's very hard to silence this warning (it may be getting emitted in a different crate from the one currently being evaluated).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anecdotally, the default step limit only takes a few seconds to trigger, so I don't think preserving the warning is helpful.
🎉 Experiment
|
There's no nice way to add a |
fa847a0
to
b5636b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. r=me if you want.
@bors r=RalfJung |
📌 Commit b5636b8 has been approved by |
…op-detector, r=RalfJung Remove const eval loop detector Now that there is a configurable instruction limit for CTFE (see rust-lang#67260), we can replace the loop detector with something much simpler. See rust-lang#66946 for more discussion about this. Although the instruction limit is nightly-only, the only practical way to reach the default limit uses nightly-only features as well (although CTFE will still execute code using such features inside an array initializer on stable). This will at the very least require a crater run, since it will result in an error wherever the "long running const eval" warning appeared before. We may need to increase the default for `const_eval_limit` to work around this. Resolves rust-lang#54384 cc rust-lang#49980 r? @oli-obk cc @RalfJung
Rollup of 11 pull requests Successful merges: - rust-lang#67761 (Move the dep_graph construction to a dedicated crate.) - rust-lang#69740 (Replace some desc logic in librustc_lint with article_and_desc) - rust-lang#69981 (Evaluate repeat expression lengths as late as possible) - rust-lang#70087 (Remove const eval loop detector) - rust-lang#70242 (Improve E0308 error message wording) - rust-lang#70264 (Fix invalid suggestion on `&mut` iterators yielding `&` references) - rust-lang#70267 (get rid of ConstPropUnsupported; use ZST marker structs instead) - rust-lang#70277 (Remove `ReClosureBound`) - rust-lang#70283 (Add regression test for rust-lang#70155.) - rust-lang#70294 (Account for bad placeholder types in where clauses) - rust-lang#70309 (Clean up E0452 explanation) Failed merges: r? @ghost
…RalfJung Remove outdated reference to interpreter snapshotting This should have been a part of rust-lang#70087. r? @RalfJung
…RalfJung Remove outdated reference to interpreter snapshotting This should have been a part of rust-lang#70087. r? @RalfJung
Now that there is a configurable instruction limit for CTFE (see #67260), we can replace the loop detector with something much simpler. See #66946 for more discussion about this. Although the instruction limit is nightly-only, the only practical way to reach the default limit uses nightly-only features as well (although CTFE will still execute code using such features inside an array initializer on stable).
This will at the very least require a crater run, since it will result in an error wherever the "long running const eval" warning appeared before. We may need to increase the default for
const_eval_limit
to work around this.Resolves #54384 cc #49980
r? @oli-obk cc @RalfJung