Skip to content

Commit b8d71fc

Browse files
authored
Rollup merge of #105515 - estebank:issue-104141, r=oli-obk
Account for macros in const generics Fix #104141.
2 parents e396186 + fb3e4b3 commit b8d71fc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

compiler/rustc_lint/src/unused.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,7 @@ impl UnusedDelimLint for UnusedBraces {
11421142
&& !cx.sess().source_map().is_multiline(value.span)
11431143
&& value.attrs.is_empty()
11441144
&& !value.span.from_expansion()
1145+
&& !inner.span.from_expansion()
11451146
{
11461147
self.emit_unused_delims_expr(cx, value, ctx, left_pos, right_pos)
11471148
}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// build-pass
2+
pub fn foo<const BAR: bool> () {}
3+
4+
fn main() {
5+
foo::<{cfg!(feature = "foo")}>();
6+
}

0 commit comments

Comments
 (0)