Commit Graph

19 Commits

Author SHA1 Message Date
Zalathar
e48fc62ce0 Un-redact one occurrence of "coverage attribute not allowed here" 2024-12-25 19:23:48 +11:00
Zalathar
3996209398 Overhaul error messages for disallowed coverage attributes 2024-12-25 16:17:09 +11:00
Zalathar
9124662da3 Expand the main test for where the coverage attribute is allowed
Some of these cases are also implicitly checked by other tests, but it's
helpful to also explicitly list them in the main test.
2024-12-25 16:01:26 +11:00
Zalathar
5e98118901 Fully redact the [E0788] error message in tests, to make changes easier 2024-12-25 16:00:47 +11:00
Zalathar
d4005b6811 Rename tests/ui/coverage-attr/no-coverage.rs to allowed-positions.rs 2024-12-25 11:40:39 +11:00
Eric Huss
5d9f17f58c Add test for coverage on a body-less trait function 2024-12-24 00:09:39 +11:00
Zalathar
87c2f9a5be Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, r=wesleywiser"
This reverts commit 1d35638dc3, reversing
changes made to f23a80a4c2.
2024-12-23 12:30:37 +11:00
Eric Huss
dbf5ae3a86 Add reference annotations for the coverage attribute 2024-12-18 15:03:44 -08:00
ltdk
cb487cc2fa Stabilize #[coverage] attribute 2024-12-16 21:07:06 -05:00
Esteban Küber
65a54a7f27 Tweak multispan rendering
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-12 23:36:27 +00:00
Zalathar
622d5898c2 Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
Zalathar
8e382ba022 Avoid ICE in coverage builds with bad #[coverage(..)] attributes
This code can sometimes witness malformed coverage attributes in builds that
are going to fail, so use `span_delayed_bug` to avoid an inappropriate ICE in
that case.
2024-10-03 21:12:24 +10:00
Esteban Küber
692bc344d5 Make parse error suggestions verbose and fix spans
Go over all structured parser suggestions and make them verbose style.

When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-07-12 03:02:57 +00:00
Zalathar
7f37f8af5f coverage: Allow #[coverage(..)] on impl and mod
These attributes apply to all enclosed functions/methods/closures, unless
explicitly overridden by another coverage attribute.
2024-06-26 10:08:05 +10:00
Zalathar
1852141219 coverage: Bless coverage attribute tests 2024-06-24 20:15:03 +10:00
Zalathar
ebb3aa0d46 Also test that yes/no must be bare words 2024-06-20 17:11:53 +10:00
Zalathar
388aea471f More status-quo tests for the #[coverage(..)] attribute
These tests reveal some inconsistencies that are tracked by
<https://github.com/rust-lang/rust/issues/126658>.
2024-06-20 17:11:53 +10:00
Zalathar
9a084e6310 Add a more thorough test of incorrect/unusal #[coverage(..)] syntax
This test reflects the current implementation behaviour, which is not
necessarily the desired behaviour.
2024-06-18 21:07:37 +10:00
Zalathar
605b61534a Create tests/ui/coverage-attr/ 2024-06-18 20:30:25 +10:00