diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-06-10 11:18:06 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-06-14 13:06:44 +1000 |
| commit | 93e4b6ef06888085dc60d073ca9d66f2d7282112 (patch) | |
| tree | bb49d15663c725f09f9ee9be9ead04b8b97945a4 /compiler/rustc_mir_transform/src/required_consts.rs | |
| parent | ca122c7ebb3ab50149c9d3d24ddb59c252b32272 (diff) | |
| download | rust-93e4b6ef06888085dc60d073ca9d66f2d7282112.tar.gz rust-93e4b6ef06888085dc60d073ca9d66f2d7282112.zip | |
Rename the `ConstS::val` field as `kind`.
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.
Diffstat (limited to 'compiler/rustc_mir_transform/src/required_consts.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/required_consts.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/required_consts.rs b/compiler/rustc_mir_transform/src/required_consts.rs index b87220a3aa4..827ce0c02ac 100644 --- a/compiler/rustc_mir_transform/src/required_consts.rs +++ b/compiler/rustc_mir_transform/src/required_consts.rs @@ -15,7 +15,7 @@ impl<'a, 'tcx> RequiredConstsVisitor<'a, 'tcx> { impl<'tcx> Visitor<'tcx> for RequiredConstsVisitor<'_, 'tcx> { fn visit_constant(&mut self, constant: &Constant<'tcx>, _: Location) { let literal = constant.literal; - if let Some(ct) = literal.const_for_ty() && let ConstKind::Unevaluated(_) = ct.val() { + if let Some(ct) = literal.const_for_ty() && let ConstKind::Unevaluated(_) = ct.kind() { self.required_consts.push(*constant); } } |
