]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: [E0053] method 'x' has an incompatible type for trait 'y'
authorMuhammad Mahad <mahadtxt@gmail.com>
Wed, 5 Jul 2023 08:44:17 +0000 (13:44 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:32 +0000 (18:49 +0100)
The parameters of any trait method must match between
a trait implementation and the trait definition

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
called error function

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/typecheck/rust-hir-type-check-implitem.cc

index aeca121981c234f1902645550bbd183a43f9155c..6c1a07787c6d0a412b3699dafcd9f5f73d0cdcbf 100644 (file)
@@ -529,7 +529,7 @@ TypeCheckImplItemWithTrait::visit (HIR::Function &function)
       RichLocation r (function.get_locus ());
       r.add_range (resolved_trait_item.get_locus ());
 
-      rust_error_at (r,
+      rust_error_at (r, ErrorCode ("E0053"),
                     "method %<%s%> has an incompatible type for trait %<%s%>",
                     function.get_function_name ().as_string ().c_str (),
                     trait_reference.get_name ().c_str ());