Account for macros in const generics

This commit is contained in:
Esteban Küber 2022-12-09 15:21:12 -08:00
parent e10201c9bb
commit fb3e4b349a
2 changed files with 7 additions and 0 deletions

View File

@ -1138,6 +1138,7 @@ fn check_unused_delims_expr(
&& !cx.sess().source_map().is_multiline(value.span)
&& value.attrs.is_empty()
&& !value.span.from_expansion()
&& !inner.span.from_expansion()
{
self.emit_unused_delims_expr(cx, value, ctx, left_pos, right_pos)
}

View File

@ -0,0 +1,6 @@
// build-pass
pub fn foo<const BAR: bool> () {}
fn main() {
foo::<{cfg!(feature = "foo")}>();
}