about summary refs log tree commit diff
path: root/tests/ui/coverage-attr
AgeCommit message (Collapse)AuthorLines
2025-08-22Updated uitests for new parserJonathan Brouwer-12/+12
2025-08-21refactor target checking, move out of context.rs and rename MaybeWarn to PolicyJana Dönszelmann-31/+31
2025-08-16take attr style into account in attr diagnosticsJana Dönszelmann-8/+6
2025-08-14Update uitestsJonathan Brouwer-140/+223
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-16Port `#[coverage]` to the new attribute systemSasha Pourcelot-364/+215
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-1/+1
2025-04-02Factor some code out of `AstValidator::visit_items`.Nicholas Nethercote-32/+32
Currently it uses `walk_item` on some item kinds. For other item kinds it visits the fields individually. For the latter group, this commit adds `visit_attrs_vis` and `visit_attrs_vis_ident` which bundle up visits to the fields that don't need special handling. This makes it clearer that they haven't been forgotten about. Also, it's better to do the attribute visits at the start because attributes precede the items in the source code. Because of this, a couple of tests have their output improved: errors appear in an order that matches the source code order.
2025-02-21Trim suggestion part before generating highlightsMichael Goulet-28/+28
2025-02-21More sophisticated span trimmingMichael Goulet-68/+36
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-100/+176
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2024-12-25Un-redact one occurrence of "coverage attribute not allowed here"Zalathar-1/+1
2024-12-25Overhaul error messages for disallowed coverage attributesZalathar-62/+124
2024-12-25Expand the main test for where the coverage attribute is allowedZalathar-48/+148
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-25Fully redact the [E0788] error message in tests, to make changes easierZalathar-26/+26
2024-12-25Rename `tests/ui/coverage-attr/no-coverage.rs` to `allowed-positions.rs`Zalathar-14/+16
2024-12-24Add test for coverage on a body-less trait functionEric Huss-10/+35
2024-12-23Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, ↵Zalathar-67/+104
r=wesleywiser" This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
2024-12-18Add reference annotations for the `coverage` attributeEric Huss-67/+75
2024-12-16Stabilize #[coverage] attributeltdk-104/+67
2024-12-12Tweak multispan renderingEsteban Küber-4/+0
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-10-09Rename directive `needs-profiler-support` to `needs-profiler-runtime`Zalathar-1/+1
2024-10-03Avoid ICE in coverage builds with bad `#[coverage(..)]` attributesZalathar-0/+57
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-07-12Make parse error suggestions verbose and fix spansEsteban Küber-4/+7
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-06-26coverage: Allow `#[coverage(..)]` on `impl` and `mod`Zalathar-167/+41
These attributes apply to all enclosed functions/methods/closures, unless explicitly overridden by another coverage attribute.
2024-06-24coverage: Bless coverage attribute testsZalathar-265/+648
2024-06-20Also test that yes/no must be bare wordsZalathar-0/+45
2024-06-20More status-quo tests for the `#[coverage(..)]` attributeZalathar-4/+398
These tests reveal some inconsistencies that are tracked by <https://github.com/rust-lang/rust/issues/126658>.
2024-06-18Add a more thorough test of incorrect/unusal `#[coverage(..)]` syntaxZalathar-0/+136
This test reflects the current implementation behaviour, which is not necessarily the desired behaviour.
2024-06-18Create `tests/ui/coverage-attr/`Zalathar-0/+156