Skip to content

Commit

Permalink
change feature gating for _ to 2.1 (#15199)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 authored Nov 5, 2024
1 parent b6f467d commit 9a29c98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ impl<'env, 'rewriter> InlinedRewriter<'env, 'rewriter> {
.map(|param| {
let Parameter(sym, ty, loc) = *param;
let id = env.new_node(loc.clone(), ty.instantiate(self.type_args));
if env.language_version().is_at_least(LanguageVersion::V2_0)
if env.language_version().is_at_least(LanguageVersion::V2_1)
&& env.symbol_pool().string(*sym).as_ref() == "_"
{
Pattern::Wildcard(id)
Expand Down
6 changes: 3 additions & 3 deletions third_party/move/move-model/src/builder/exp_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,10 @@ impl<'env, 'translator, 'module_translator> ExpTranslator<'env, 'translator, 'mo
params: &[(PA::Var, EA::Type)],
for_move_fun: bool,
) -> Vec<Parameter> {
let is_lang_version_2 = self
let is_lang_version_2_1 = self
.env()
.language_version
.is_at_least(LanguageVersion::V2_0);
.is_at_least(LanguageVersion::V2_1);
params
.iter()
.enumerate()
Expand All @@ -690,7 +690,7 @@ impl<'env, 'translator, 'module_translator> ExpTranslator<'env, 'translator, 'mo
let sym = self.symbol_pool().make(var_str);
let loc = self.to_loc(&v.loc());

if !is_lang_version_2 || var_str != "_" {
if !is_lang_version_2_1 || var_str != "_" {
self.define_local(
&loc,
sym,
Expand Down
4 changes: 2 additions & 2 deletions third_party/move/move-model/src/builder/module_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1532,10 +1532,10 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> {
et.define_type_param(loc, *name, Type::new_param(pos), kind.clone(), false);
}
et.enter_scope();
let is_lang_version_2 = et.env().language_version.is_at_least(LanguageVersion::V2_0);
let is_lang_version_2_1 = et.env().language_version.is_at_least(LanguageVersion::V2_1);
for (idx, Parameter(n, ty, loc)) in params.iter().enumerate() {
let symbol_pool = et.parent.parent.env.symbol_pool();
if !is_lang_version_2 || symbol_pool.string(*n).as_ref() != "_" {
if !is_lang_version_2_1 || symbol_pool.string(*n).as_ref() != "_" {
et.define_local(loc, *n, ty.clone(), None, Some(idx));
}
}
Expand Down

0 comments on commit 9a29c98

Please sign in to comment.