Account for macros in const generics
This commit is contained in:
parent
e10201c9bb
commit
fb3e4b349a
@ -1138,6 +1138,7 @@ impl UnusedDelimLint for UnusedBraces {
|
|||||||
&& !cx.sess().source_map().is_multiline(value.span)
|
&& !cx.sess().source_map().is_multiline(value.span)
|
||||||
&& value.attrs.is_empty()
|
&& value.attrs.is_empty()
|
||||||
&& !value.span.from_expansion()
|
&& !value.span.from_expansion()
|
||||||
|
&& !inner.span.from_expansion()
|
||||||
{
|
{
|
||||||
self.emit_unused_delims_expr(cx, value, ctx, left_pos, right_pos)
|
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…
x
Reference in New Issue
Block a user