-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
continue ParamEnv
to TypingEnv
transition
#133212
Conversation
36fdfa9
to
7937ab3
Compare
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in match checking cc @Nadrieril Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval |
fn is_item_raw
to TypingEnv
ParamEnv
to TypingEnv
transition
cc @BoxyUwU on the last commit |
7f67ec1
to
ae20d31
Compare
// Only anon consts can implicitly capture params. | ||
// FIXME: is this correct behavior? | ||
let typing_env = ty::TypingEnv::from_param_env(cx.tcx.param_env(*def_id)); | ||
let typing_env = ty::TypingEnv::post_analysis(cx.tcx, *def_id); | ||
cx.tcx.normalize_erasing_regions(typing_env, ct) |
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.
we're using normalize_erasing_regions
to evaluate the constant, so it's gonna switch to Reveal::All
anyways, cc @BoxyUwU
cd994f4
to
4813fda
Compare
What about the part where Currently the |
I agree, wanted to do this in a separate PR so that this one doesn't grow out of hand 🤔 edit: just gonna do it here as well |
Separate PR is fine, I was just confused since you didn't mention it in the PR description. :) |
This comment has been minimized.
This comment has been minimized.
617a554
to
002efeb
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.
r=me when green
@bors r=compiler-errors rollup=iffy |
@bors rollup=never probably slightly impacts performance again |
☀️ Test successful - checks-actions |
pub(crate) param_env: ty::ParamEnv<'tcx>, | ||
/// The current context in case we're evaluating in a | ||
/// polymorphic context. This always uses `ty::TypingMode::PostAnalysis` | ||
pub typing_env: ty::TypingEnv<'tcx>, |
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.
I don't think we should make this public, I want to be sure nobody mutates this field... I'll make a PR to privatize this again.
Finished benchmarking commit (70e814b): comparison URL. Overall result: ❌ regressions - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -1.4%, secondary -2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 4.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 793.573s -> 793.177s (-0.05%) |
Passing |
finish `Reveal` removal After rust-lang#133212 changed the `TypingMode` to be the only source of truth, this entirely rips out `Reveal`. cc rust-lang#132279 r? `@compiler-errors`
We can also go back to not storing the full env in the Cx, if that helps.
|
interpret: make typing_env field private This was made public in rust-lang#133212 but IMO it should remain private. (Specifically, this prevents it from being mutated.) r? `@lcnr`
finish `Reveal` removal After rust-lang#133212 changed the `TypingMode` to be the only source of truth, this entirely rips out `Reveal`. cc rust-lang#132279 r? `@compiler-errors`
Rollup merge of rust-lang#133241 - RalfJung:typing-env, r=lcnr interpret: make typing_env field private This was made public in rust-lang#133212 but IMO it should remain private. (Specifically, this prevents it from being mutated.) r? `@lcnr`
interpret: make typing_env field private This was made public in rust-lang/rust#133212 but IMO it should remain private. (Specifically, this prevents it from being mutated.) r? `@lcnr`
cc #132279
r? @compiler-errors