-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Use the type-level constant value ty::Value where needed
#136430
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
Conversation
|
Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval Some changes occurred in match checking cc @Nadrieril |
|
Everything but const_to_pat seems fine to me. There may be avenues for further improvements/deduplications, but I haven't come up with anything obviously improving things yet |
|
In |
26f48df to
709a63a
Compare
|
@bors r+ rollup |
|
@bors r- |
Signed-off-by: FedericoBruzzone <[email protected]>
709a63a to
6e0dfc8
Compare
Signed-off-by: FedericoBruzzone <[email protected]>
ty::Valuety::Value where needed
|
@bors r+ |
… r=oli-obk Use the type-level constant value `ty::Value` where needed **Follow-up to rust-lang#136180** ### Summary This PR refactors functions to accept a single type-level constant value `ty::Value` instead of separate `ty::ValTree` and `ty::Ty` parameters: - `valtree_to_const_value`: now takes `ty::Value` - `pretty_print_const_valtree`: now takes `ty::Value` - Uses `pretty_print_const_valtree` for formatting valtrees when `visit_const_operand` - Moves `try_to_raw_bytes` from `ty::Valtree` to `ty::Value` --- r? `@lukas-code` `@oli-obk`
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136289 (OnceCell & OnceLock docs: Using (un)initialized consistently) - rust-lang#136299 (Ignore NLL boring locals in polonius diagnostics) - rust-lang#136411 (Omit argument names from function pointers that do not have argument names) - rust-lang#136430 (Use the type-level constant value `ty::Value` where needed) - rust-lang#136476 (Remove generic `//@ ignore-{wasm,wasm32,emscripten}` in tests) - rust-lang#136484 (Notes on types/traits used for in-memory query caching) - rust-lang#136493 (platform-support: document CPU baseline for x86-32 targets) - rust-lang#136498 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136430 - FedericoBruzzone:follow-up-136180, r=oli-obk Use the type-level constant value `ty::Value` where needed **Follow-up to rust-lang#136180** ### Summary This PR refactors functions to accept a single type-level constant value `ty::Value` instead of separate `ty::ValTree` and `ty::Ty` parameters: - `valtree_to_const_value`: now takes `ty::Value` - `pretty_print_const_valtree`: now takes `ty::Value` - Uses `pretty_print_const_valtree` for formatting valtrees when `visit_const_operand` - Moves `try_to_raw_bytes` from `ty::Valtree` to `ty::Value` --- r? ``@lukas-code`` ``@oli-obk``
Follow-up to #136180
Summary
This PR refactors functions to accept a single type-level constant value
ty::Valueinstead of separatety::ValTreeandty::Typarameters:valtree_to_const_value: now takesty::Valuepretty_print_const_valtree: now takesty::Valuepretty_print_const_valtreefor formatting valtrees whenvisit_const_operandtry_to_raw_bytesfromty::Valtreetoty::Valuer? @lukas-code @oli-obk