]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: trivial typo fix.
authorMarc Poulhiès <dkm@kataplop.net>
Thu, 14 Sep 2023 21:24:26 +0000 (23:24 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:36 +0000 (19:04 +0100)
Fix subsititions -> substitutions

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::compile_function):
Fix typo in substitutions.
(HIRCompileBase::resolve_method_address): Likewise.
* backend/rust-compile-extern.h (CompileExternItem::visit):
Likewise.
* backend/rust-compile-implitem.cc (CompileTraitItem::visit):
Likewise.
* backend/rust-compile-intrinsic.cc (maybe_override_ctx):
Likewise.
* backend/rust-compile-item.cc (CompileItem::visit): Likewise.
* backend/rust-compile-resolve-path.cc
(HIRCompileBase::query_compile): Likewise.
* typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion):
Likewise.
* typecheck/rust-hir-type-check-item.cc
(TypeCheckItem::ResolveImplBlockSelfWithInference): Likewise.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit):
Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
Likewise.
* typecheck/rust-tyty.cc (BaseType::has_subsititions_defined):
Renamed into ...
(BaseType::has_substitutions_defined): ... this.
(ADTType::is_equal): Fix typo in substitutions.
(handle_substitions): Likewise.
(FnType::is_equal): Likewise.
(FnType::handle_substitions): Likewise.
* typecheck/rust-tyty.h (has_subsititions_defined): Renamed into
...
(has_substitutions_defined): ... this.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
12 files changed:
gcc/rust/backend/rust-compile-base.cc
gcc/rust/backend/rust-compile-extern.h
gcc/rust/backend/rust-compile-implitem.cc
gcc/rust/backend/rust-compile-intrinsic.cc
gcc/rust/backend/rust-compile-item.cc
gcc/rust/backend/rust-compile-resolve-path.cc
gcc/rust/typecheck/rust-coercion.cc
gcc/rust/typecheck/rust-hir-type-check-item.cc
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/rust/typecheck/rust-hir-type-check-type.cc
gcc/rust/typecheck/rust-tyty.cc
gcc/rust/typecheck/rust-tyty.h

index 02d45571b9bae9755beabcfae24f759f46ae7625..bfa09c8e9942a34f741c0d90594b8e8110d2897f 100644 (file)
@@ -564,7 +564,7 @@ HIRCompileBase::compile_function (
   tree fndecl = Backend::function (compiled_fn_type, ir_symbol_name,
                                   "" /* asm_name */, flags, locus);
 
-  setup_fndecl (fndecl, is_main_fn, fntype->has_subsititions_defined (),
+  setup_fndecl (fndecl, is_main_fn, fntype->has_substitutions_defined (),
                visibility, qualifiers, outer_attrs);
   setup_abi_options (fndecl, qualifiers.get_abi ());
 
@@ -792,7 +792,7 @@ HIRCompileBase::resolve_method_address (TyTy::FnType *fntype,
   HIR::Item *resolved_item = ctx->get_mappings ()->lookup_defid (id);
   if (resolved_item != nullptr)
     {
-      if (!fntype->has_subsititions_defined ())
+      if (!fntype->has_substitutions_defined ())
        return CompileItem::compile (resolved_item, ctx);
 
       return CompileItem::compile (resolved_item, ctx, fntype);
index bf17beebc9bd4a089d6b84a926fc8e4c0186b3af..127e9b099cce9f78e103b978d6c02a4832bbc65e 100644 (file)
@@ -91,7 +91,7 @@ public:
 
     rust_assert (fntype_tyty->get_kind () == TyTy::TypeKind::FNDEF);
     TyTy::FnType *fntype = static_cast<TyTy::FnType *> (fntype_tyty);
-    if (fntype->has_subsititions_defined ())
+    if (fntype->has_substitutions_defined ())
       {
        // we cant do anything for this only when it is used and a concrete type
        // is given
@@ -114,7 +114,7 @@ public:
        return;
       }
 
-    if (fntype->has_subsititions_defined ())
+    if (fntype->has_substitutions_defined ())
       {
        // override the Hir Lookups for the substituions in this context
        fntype->override_context ();
index 190812dfdec418da313a2ec2a2e203a8007ec9b9..824af3fed704396f814509495dcc5d5c697642e3 100644 (file)
@@ -71,7 +71,7 @@ CompileTraitItem::visit (HIR::TraitItemFunc &func)
        }
     }
 
-  if (fntype->has_subsititions_defined ())
+  if (fntype->has_substitutions_defined ())
     {
       // override the Hir Lookups for the substituions in this context
       fntype->override_context ();
index 2433b989946a245b69ee0990d52ca94997195639..feaf74dff7b771d1d9ba3dbca8c4255926aec61d 100644 (file)
@@ -290,7 +290,7 @@ check_for_cached_intrinsic (Context *ctx, TyTy::FnType *fntype, tree *lookup)
 static void
 maybe_override_ctx (TyTy::FnType *fntype)
 {
-  if (fntype->has_subsititions_defined ())
+  if (fntype->has_substitutions_defined ())
     fntype->override_context ();
 }
 
index 90a8fa76230e2577fe73ccc2c4930abadd838a0f..234ad2aa59c1529e96a9f47ba7ba5356207770f0 100644 (file)
@@ -118,7 +118,7 @@ CompileItem::visit (HIR::Function &function)
 
   rust_assert (fntype_tyty->get_kind () == TyTy::TypeKind::FNDEF);
   TyTy::FnType *fntype = static_cast<TyTy::FnType *> (fntype_tyty);
-  if (fntype->has_subsititions_defined ())
+  if (fntype->has_substitutions_defined ())
     {
       // we cant do anything for this only when it is used and a concrete type
       // is given
@@ -166,7 +166,7 @@ CompileItem::visit (HIR::Function &function)
       return;
     }
 
-  if (fntype->has_subsititions_defined ())
+  if (fntype->has_substitutions_defined ())
     {
       // override the Hir Lookups for the substituions in this context
       fntype->override_context ();
index 729a09933e2470f73c33f8bbb83fa437bb383dd8..366de59865ed0f2f4ea9690ee30f88264d8edb79 100644 (file)
@@ -184,7 +184,7 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
   bool is_fn = lookup->get_kind () == TyTy::TypeKind::FNDEF;
   if (is_hir_item)
     {
-      if (!lookup->has_subsititions_defined ())
+      if (!lookup->has_substitutions_defined ())
        return CompileItem::compile (resolved_item, ctx, nullptr, true,
                                     expr_locus);
       else
@@ -193,7 +193,7 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
     }
   else if (is_hir_extern_item)
     {
-      if (!lookup->has_subsititions_defined ())
+      if (!lookup->has_substitutions_defined ())
        return CompileExternItem::compile (resolved_extern_item, ctx, nullptr,
                                           true, expr_locus);
       else
@@ -222,7 +222,7 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
       bool is_impl_item = resolved_item != nullptr;
       if (is_impl_item)
        {
-         if (!lookup->has_subsititions_defined ())
+         if (!lookup->has_substitutions_defined ())
            return CompileInherentImplItem::Compile (resolved_item, ctx,
                                                     nullptr, true, expr_locus);
          else
@@ -285,7 +285,7 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
                impl->get_type ()->get_mappings ().get_hirid (), &self);
              rust_assert (ok);
 
-             if (!lookup->has_subsititions_defined ())
+             if (!lookup->has_substitutions_defined ())
                return CompileInherentImplItem::Compile (impl_item, ctx,
                                                         nullptr, true,
                                                         expr_locus);
index 97f99df9de97bbe13ca8542b63763fd18abf1d73..9577d42040e2804494b92060a05bd901306dbee6 100644 (file)
@@ -72,7 +72,7 @@ TypeCoercionRules::do_coercion (TyTy::BaseType *receiver)
       //     let _: Option<?T> = Some({ return; });
       //
       // here, we would coerce from `!` to `?T`.
-      if (expected->has_subsititions_defined () && !expected->is_concrete ())
+      if (expected->has_substitutions_defined () && !expected->is_concrete ())
        {
          location_t locus = mappings->lookup_location (receiver->get_ref ());
          TyTy::TyVar implicit_var
index 1290065f7c78eba407fd4010b06ad81859768a16..0bf4d709990e31d3925f1bfcff96de59a0abc3fa 100644 (file)
@@ -120,7 +120,7 @@ TypeCheckItem::ResolveImplBlockSelfWithInference (
 
   // we only need to apply to the bounds manually on types which dont bind
   // generics
-  if (!infer->has_subsititions_defined ())
+  if (!infer->has_substitutions_defined ())
     {
       for (auto &bound : infer->get_specified_bounds ())
        bound.handle_substitions (*infer_arguments);
index 43a779dc1e83901137e47ccae806aed219e31e63..7dfa93687295e97b2b515bdcc8d5362d47738140 100644 (file)
@@ -133,7 +133,7 @@ TypeCheckExpr::visit (HIR::QualifiedPathInExpression &expr)
   // turbo-fish segment path::<ty>
   if (item_seg.has_generic_args ())
     {
-      if (!infered->has_subsititions_defined ())
+      if (!infered->has_substitutions_defined ())
        {
          rust_error_at (item_seg.get_locus (),
                         "substitutions not supported for %s",
index 4db48f03bd2082c42d88273ef746505e6b62a372..62a17769c3fe4c9ebf21939c40500d847d2b3611 100644 (file)
@@ -283,7 +283,7 @@ TypeCheckType::visit (HIR::QualifiedPathInType &path)
       // turbo-fish segment path::<ty>
       if (generic_seg.has_generic_args ())
        {
-         if (!translated->has_subsititions_defined ())
+         if (!translated->has_substitutions_defined ())
            {
              rust_error_at (item_seg->get_locus (),
                             "substitutions not supported for %s",
index 2fbc1c176fe898567582a200c685011e898dc497..0a3ba85fff798cca3e2dd22b20c379cfbf14d206 100644 (file)
@@ -837,7 +837,7 @@ BaseType::is_concrete () const
 }
 
 bool
-BaseType::has_subsititions_defined () const
+BaseType::has_substitutions_defined () const
 {
   const TyTy::BaseType *x = destructure ();
   switch (x->get_kind ())
@@ -1680,10 +1680,10 @@ ADTType::is_equal (const BaseType &other) const
   if (number_of_variants () != other2.number_of_variants ())
     return false;
 
-  if (has_subsititions_defined () != other2.has_subsititions_defined ())
+  if (has_substitutions_defined () != other2.has_substitutions_defined ())
     return false;
 
-  if (has_subsititions_defined ())
+  if (has_substitutions_defined ())
     {
       if (get_num_substitutions () != other2.get_num_substitutions ())
        return false;
@@ -1757,7 +1757,7 @@ handle_substitions (SubstitutionArgumentMappings &subst_mappings,
            }
        }
     }
-  else if (fty->has_subsititions_defined () || !fty->is_concrete ())
+  else if (fty->has_substitutions_defined () || !fty->is_concrete ())
     {
       BaseType *concrete
        = Resolver::SubstMapperInternal::Resolve (fty, subst_mappings);
@@ -2001,10 +2001,10 @@ FnType::is_equal (const BaseType &other) const
   if (!get_return_type ()->is_equal (*other2.get_return_type ()))
     return false;
 
-  if (has_subsititions_defined () != other2.has_subsititions_defined ())
+  if (has_substitutions_defined () != other2.has_substitutions_defined ())
     return false;
 
-  if (has_subsititions_defined ())
+  if (has_substitutions_defined ())
     {
       if (get_num_substitutions () != other2.get_num_substitutions ())
        return false;
@@ -2141,7 +2141,7 @@ FnType::handle_substitions (SubstitutionArgumentMappings &subst_mappings)
                }
            }
        }
-      else if (fty->has_subsititions_defined () || !fty->is_concrete ())
+      else if (fty->has_substitutions_defined () || !fty->is_concrete ())
        {
          BaseType *concrete
            = Resolver::SubstMapperInternal::Resolve (fty, subst_mappings);
index 51bf0b463bdd11c6ef0d533f3f4cff00b8b839a4..16a80976e4f2535791843179a39e02cf5364e759 100644 (file)
@@ -155,7 +155,7 @@ public:
   const RustIdent &get_ident () const;
   location_t get_locus () const;
 
-  bool has_subsititions_defined () const;
+  bool has_substitutions_defined () const;
   bool needs_generic_substitutions () const;
 
   std::string mangle_string () const