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

Refactor tcx mk_const parameters. #103984

Merged
merged 1 commit into from
Nov 5, 2022

Conversation

V0ldek
Copy link
Contributor

@V0ldek V0ldek commented Nov 4, 2022

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 4, 2022
@BoxyUwU
Copy link
Member

BoxyUwU commented Nov 4, 2022

r? @BoxyUwU
@bors r+

@bors
Copy link
Contributor

bors commented Nov 4, 2022

📌 Commit c97fd81 has been approved by BoxyUwU

It is now in the queue for this repository.

@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 Nov 4, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2022
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#103868 (Use `TraitEngine` (by itself) less)
 - rust-lang#103878 (Fix artifact version/channel detection for stable)
 - rust-lang#103946 (Cleanup bind_pattern args)
 - rust-lang#103956 (Make mir opt unused file check blessable)
 - rust-lang#103977 (LLVM 16: Switch to using MemoryEffects)
 - rust-lang#103980 (rustdoc: simplify search results CSS and DOM)
 - rust-lang#103984 (Refactor tcx mk_const parameters.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b101f3a into rust-lang:master Nov 5, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 5, 2022
@@ -2569,9 +2569,14 @@ impl<'tcx> TyCtxt<'tcx> {
self.mk_ty_infer(TyVar(v))
}

#[inline]
pub fn mk_const(self, kind: ty::ConstKind<'tcx>, ty: Ty<'tcx>) -> Const<'tcx> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up idea:

Use kind: impl Into<ty::ConstKind<'tcx>> and remove mk_const_var, mk_const_param and mk_const_infer by adding the approriate From impls. Could also add one for ty::UnevaluatedConst, PlaceholderConst and ValTree and adjust the call sites sites to rely on the new impl

@V0ldek V0ldek deleted the 103974-refactor-mk_const branch November 5, 2022 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

change mk_const to take a ConstKind and Ty argument instead of writing out the ty::ConstS struct everywhere
5 participants