gccrs: [E0541] Use of unknown meta item

gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc:
	Added ErrorCode.

gcc/testsuite/ChangeLog:

	* rust/compile/attr_deprecated_2.rs:
	Updated comment to pass the testcase.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
This commit is contained in:
Muhammad Mahad 2023-08-05 13:18:16 +05:00 committed by Arthur Cohen
parent 9f09284d8f
commit 2b20054948
2 changed files with 3 additions and 2 deletions

View file

@ -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 ());
}
}

View file

@ -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() {}