about summary refs log tree commit diff
path: root/tests/ui/coverage-attr/subword.rs
blob: 84a5132ac4ac3e38fcd914dd0f7a3cb6bb80456f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(coverage_attribute)]
//@ edition: 2021
//@ reference: attributes.coverage.syntax

// Check that yes/no in `#[coverage(yes)]` and `#[coverage(no)]` must be bare
// words, not part of a more complicated substructure.

#[coverage(yes(milord))] //~ ERROR malformed `coverage` attribute input
fn yes_list() {}

#[coverage(no(milord))] //~ ERROR malformed `coverage` attribute input
fn no_list() {}

#[coverage(yes = "milord")] //~ ERROR malformed `coverage` attribute input
fn yes_key() {}

#[coverage(no = "milord")] //~ ERROR malformed `coverage` attribute input
fn no_key() {}

fn main() {}