Commit c4d2abe
util/attributes: error on malformed #[link_name] input
Emit a diagnostic when #[link_name] is used without arguments,
matching rustc behavior. This prevents silent acceptance of empty
attributes and provides a helpful diagnostic that shows the expected form.
Fixes #4228
gcc/rust/ChangeLog:
* util/rust-attributes.cc: Emit diagnostic.
gcc/testsuite/ChangeLog:
* rust/compile/link_name-malformed.rs: New test.
Signed-off-by: Jayant Chauhan <[email protected]>1 parent 5103d5d commit c4d2abe
File tree
2 files changed
+16
-0
lines changed- gcc
- rust/util
- testsuite/rust/compile
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
869 | 880 | | |
870 | 881 | | |
871 | 882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments