Rollup merge of #105515 - estebank:issue-104141, r=oli-obk

Account for macros in const generics

Fix #104141.
This commit is contained in:
Matthias Krüger 2022-12-27 08:57:45 +01:00 committed by GitHub
commit b8d71fc41f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -1142,6 +1142,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")}>();
}