diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc index 92dedc1ae521..499b9ac481ce 100644 --- a/gcc/rust/backend/rust-compile-base.cc +++ b/gcc/rust/backend/rust-compile-base.cc @@ -212,7 +212,8 @@ HIRCompileBase::handle_deprecated_attribute_on_fndecl ( } else { - rust_error_at (attr.get_locus (), "unknown meta item %qs", + rust_error_at (attr.get_locus (), ErrorCode::E0541, + "unknown meta item %qs", key_value.first.as_string ().c_str ()); } } diff --git a/gcc/testsuite/rust/compile/attr_deprecated_2.rs b/gcc/testsuite/rust/compile/attr_deprecated_2.rs index 66f4ce3b076b..bbb6c12f2904 100644 --- a/gcc/testsuite/rust/compile/attr_deprecated_2.rs +++ b/gcc/testsuite/rust/compile/attr_deprecated_2.rs @@ -1,7 +1,7 @@ #[deprecated(since="1.0")] fn test1() {} -// { dg-excess-errors "unknown meta item ...." } +// { dg-excess-errors "unknown meta item .invalid." } #[deprecated(invalid="invalid")] fn test2() {}