Nicholas Nethercote
35b1187a65
Improve consistency of InvalidTarget attribute error messages
...
Mostly in a fashion similar to the previous commit.
There is one exceptional case: for errors involving `repr` the argument
is significant. For these, the argument is included in the error line
and the caret highlighting, e.g.
```
error: the `repr(C)` attribute cannot be used on functions
--> $DIR/naked-with-invalid-repr-attr.rs:10:3
|
LL | #[repr(C)]
| ^^^^^^^
|
= help: the `repr(C)` attribute can only be applied to data types
```
Contrast this with a more typical argument-excluding case used
everywhere else:
```
error: the `rustc_abi` attribute cannot be used on associated consts
--> $DIR/debug.rs:46:7
|
LL | #[rustc_abi(debug)]
| ^^^^^^^^^
|
= help: the `rustc_abi` attribute can be applied to functions and type aliases
```
2026-07-24 12:58:31 +10:00
..
2025-06-02 11:02:50 +02:00
2025-08-22 17:55:15 +00:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-06-25 16:52:31 +00:00
2026-07-20 07:28:14 +02:00
2026-03-04 16:38:36 +00:00
2025-07-31 17:31:51 +00:00
2025-07-31 17:31:51 +00:00
2025-06-25 16:52:31 +00:00
2025-07-31 17:31:51 +00:00
2025-07-31 17:31:51 +00:00
2025-07-31 17:31:51 +00:00
2025-06-03 10:52:32 -07:00
2025-06-03 10:52:32 -07:00
2026-03-04 08:06:45 +08:00
2025-09-24 15:02:41 +02:00
2026-07-19 20:55:47 +00:00
2026-06-25 17:12:10 +08:00
2025-08-22 17:55:15 +00:00
2025-08-22 17:55:15 +00:00
2025-11-27 14:13:58 -05:00
2025-11-27 14:13:58 -05:00
2026-01-13 01:16:58 +00:00
2025-09-26 15:33:48 +02:00
2025-09-26 15:33:48 +02:00
2026-07-24 12:58:29 +10:00
2026-07-24 12:58:29 +10:00
2026-07-24 12:58:29 +10:00
2026-02-12 15:12:29 +08:00
2026-02-12 15:12:29 +08:00
2025-10-01 00:47:58 +02:00
2025-08-14 18:18:42 +02:00
2026-07-24 12:58:31 +10:00
2025-08-19 21:27:10 +02:00
2025-08-19 21:27:10 +02:00
2026-02-16 17:27:40 +01:00
2026-02-16 17:27:40 +01:00
2025-07-26 21:53:13 +00:00
2025-07-26 21:53:13 +00:00
2025-08-19 21:27:10 +02:00
2025-07-26 21:53:13 +00:00
2026-03-04 08:06:45 +08:00
2026-03-04 08:06:45 +08:00
2025-09-21 03:26:21 +00:00
2025-09-21 03:26:21 +00:00
2026-03-04 08:06:45 +08:00
2025-08-22 17:55:15 +00:00
2026-03-04 08:06:45 +08:00
2025-07-23 13:48:04 +02:00
2025-07-23 13:48:04 +02:00
2025-07-23 13:48:04 +02:00
2025-08-22 17:55:15 +00:00
2026-03-04 08:06:45 +08:00
2025-07-28 16:09:59 +00:00
2025-07-28 16:09:59 +00:00
2025-08-19 21:27:10 +02:00
2025-07-31 17:31:51 +00:00
2025-07-23 13:48:04 +02:00
2026-07-19 20:55:47 +00:00
2026-02-09 15:09:43 +08:00
2026-02-09 15:09:43 +08:00
2025-12-10 23:41:19 +00:00
2025-08-19 13:12:31 +00:00
2026-05-05 17:44:35 +07:00
2026-07-03 14:55:08 +03:00
2025-08-19 21:27:10 +02:00
2026-04-13 11:45:07 +01:00
2026-04-13 11:45:07 +01:00
2026-07-19 20:55:47 +00:00
2026-02-11 14:13:44 +01:00
2025-06-06 20:12:11 +00:00
2025-06-13 01:16:36 +02:00
2025-06-13 01:16:36 +02:00
2025-06-13 01:16:36 +02:00
2025-06-13 01:16:36 +02:00
2025-07-23 13:48:04 +02:00
2026-03-04 08:06:45 +08:00
2025-08-19 21:27:10 +02:00
2025-08-19 21:27:10 +02:00
2025-08-19 21:27:10 +02:00
2025-11-27 14:13:58 -05:00
2026-01-26 17:34:31 +00:00
2026-02-16 12:24:15 +00:00