-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
@@ -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()) |
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.
write!(f, "Const {{ ty: {:?}, val: {:?} }}", self.ty(), self.kind()) | |
write!(f, "Const {{ ty: {:?}, kind: {:?} }}", self.ty(), self.kind()) |
r? @lcnr r=me after that nit |
5e2d8e6
to
97e6652
Compare
I fixed the nit, and adjusted the expected output of one test affected by it. @bors r=lcnr |
📌 Commit 97e66523e1bd6663ec52f82020ea1d6f3fa9dac9 has been approved by |
This comment has been minimized.
This comment has been minimized.
@bors r- |
☔ The latest upstream changes (presumably #97778) made this pull request unmergeable. Please resolve the merge conflicts. |
97e6652
to
95f2ac3
Compare
This comment has been minimized.
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.
95f2ac3
to
93e4b6e
Compare
@bors r=lcnr |
📌 Commit 93e4b6e has been approved by |
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
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
* 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
And likewise for the
Const::val
method.Because its type is called
ConstKind
. Alsoval
is a confusing namebecause
ConstKind
is an enum with seven variants, one of which iscalled
Value
. Also, this gives consistency withTyS
andPredicateS
which have
kind
fields.The commit also renames a few
Const
variables fromval
toc
, toavoid confusion with the
ConstKind::Value
variant.r? @BoxyUwU