Skip to content

Commit c53d127

Browse files
committed
paren-span
1 parent 79453f4 commit c53d127

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/ui/macros/macro-paren-span-diagnostic.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
// Be smart about span of parenthesized expression in macro.
1+
//! Check that error spans in parenthesized macro expressions point to the call site.
22
3+
#[rustfmt::skip]
34
macro_rules! paren {
45
($e:expr) => (($e))
56
// ^^^^ do not highlight here
67
}
78

89
mod m {
910
pub struct S {
10-
x: i32
11+
x: i32,
1112
}
13+
1214
pub fn make() -> S {
1315
S { x: 0 }
1416
}

tests/ui/macros/macro-paren-span-diagnostic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0616]: field `x` of struct `S` is private
2-
--> $DIR/paren-span.rs:19:14
2+
--> $DIR/macro-paren-span-diagnostic.rs:21:14
33
|
44
LL | paren!(s.x);
55
| ^ private field

0 commit comments

Comments
 (0)