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

Rename the ConstS::val field as kind. #97935

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

nnethercote
Copy link
Contributor

And likewise for the Const::val method.

Because its type is called ConstKind. Also val is a confusing name
because ConstKind is an enum with seven variants, one of which is
called Value. Also, this gives consistency with TyS and PredicateS
which have kind fields.

The commit also renames a few Const variables from val to c, to
avoid confusion with the ConstKind::Value variant.

r? @BoxyUwU

@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

Some changes occured to rustc_codegen_cranelift

cc @bjorn3

Some changes occured in const_evaluatable.rs

cc @lcnr

Some changes occured in need_type_info.rs

cc @lcnr

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 10, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 10, 2022
@@ -29,15 +29,15 @@ impl<'tcx> fmt::Debug for Const<'tcx> {
// This reflects what `Const` looked liked before `Interned` was
// introduced. We print it like this to avoid having to update expected
// output in a lot of tests.
write!(f, "Const {{ ty: {:?}, val: {:?} }}", self.ty(), self.val())
write!(f, "Const {{ ty: {:?}, val: {:?} }}", self.ty(), self.kind())
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
write!(f, "Const {{ ty: {:?}, val: {:?} }}", self.ty(), self.kind())
write!(f, "Const {{ ty: {:?}, kind: {:?} }}", self.ty(), self.kind())

@lcnr
Copy link
Contributor

lcnr commented Jun 10, 2022

r? @lcnr

r=me after that nit

@rust-highfive rust-highfive assigned lcnr and unassigned BoxyUwU Jun 10, 2022
@nnethercote
Copy link
Contributor Author

I fixed the nit, and adjusted the expected output of one test affected by it.

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Jun 10, 2022

📌 Commit 97e66523e1bd6663ec52f82020ea1d6f3fa9dac9 has been approved by lcnr

@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 Jun 10, 2022
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

@bors r-
PR CI failed

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 11, 2022
@bors
Copy link
Contributor

bors commented Jun 12, 2022

☔ The latest upstream changes (presumably #97778) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

And likewise for the `Const::val` method.

Because its type is called `ConstKind`. Also `val` is a confusing name
because `ConstKind` is an enum with seven variants, one of which is
called `Value`. Also, this gives consistency with `TyS` and `PredicateS`
which have `kind` fields.

The commit also renames a few `Const` variables from `val` to `c`, to
avoid confusion with the `ConstKind::Value` variant.
@Dylan-DPC
Copy link
Member

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Jun 14, 2022

📌 Commit 93e4b6e has been approved by lcnr

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 14, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 14, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#97869 (BTree: tweak internal comments)
 - rust-lang#97935 (Rename the `ConstS::val` field as `kind`.)
 - rust-lang#97948 (lint: add diagnostic translation migration lints)
 - rust-lang#98042 (Fix compat_fn option method on miri)
 - rust-lang#98069 (rustdoc:  remove link on slice brackets)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9e5c5c5 into rust-lang:master Jun 14, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 14, 2022
@nnethercote nnethercote deleted the rename-ConstS-val-as-kind branch June 14, 2022 21:29
celinval added a commit to celinval/kani-dev that referenced this pull request Jul 6, 2022
The updates required were related to the following changes:
  - Simplify memory ordering intrinsics
    - rust-lang/rust#97423
  - once cell renamings
    - rust-lang/rust#98165
  - Rename the ConstS::val field as kind
    - rust-lang/rust#97935
  - Remove the source archive functionality of ArchiveWriter
    - rust-lang/rust#98098
  - Use valtrees as the type-system representation for constant values
    - rust-lang/rust#96591
celinval added a commit to model-checking/kani that referenced this pull request Jul 6, 2022
* Update toolchain to 2022-07-05

The updates required were related to the following changes:
  - Simplify memory ordering intrinsics
    - rust-lang/rust#97423
  - once cell renamings
    - rust-lang/rust#98165
  - Rename the ConstS::val field as kind
    - rust-lang/rust#97935
  - Remove the source archive functionality of ArchiveWriter
    - rust-lang/rust#98098
  - Use valtrees as the type-system representation for constant values
    - rust-lang/rust#96591

* Codegen unimplemented for unsupported constant slices

See #1339 for more details.

* Fix copyright check

* Use codegen_option_span instead
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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants