]> git.lizzy.rs Git - rust.git/blob - tests/ui/paren-span.rs
Rollup merge of #103236 - tspiteri:redoc-int-adc-sbb, r=m-ou-se
[rust.git] / tests / ui / paren-span.rs
1 // Be smart about span of parenthesized expression in macro.
2
3 macro_rules! paren {
4     ($e:expr) => (($e))
5     //            ^^^^ do not highlight here
6 }
7
8 mod m {
9     pub struct S {
10         x: i32
11     }
12     pub fn make() -> S {
13         S { x: 0 }
14     }
15 }
16
17 fn main() {
18     let s = m::make();
19     paren!(s.x); //~ ERROR field `x` of struct `S` is private
20     //     ^^^ highlight here
21 }