Rollup merge of #105515 - estebank:issue-104141, r=oli-obk
Account for macros in const generics Fix #104141.
This commit is contained in:
commit
b8d71fc41f
@ -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)
|
||||
}
|
||||
|
6
src/test/ui/lint/unused_braces_macro.rs
Normal file
6
src/test/ui/lint/unused_braces_macro.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// build-pass
|
||||
pub fn foo<const BAR: bool> () {}
|
||||
|
||||
fn main() {
|
||||
foo::<{cfg!(feature = "foo")}>();
|
||||
}
|
Loading…
Reference in New Issue
Block a user