collect attrs in const block expr
This commit is contained in:
parent
1d96de2a20
commit
1e42bb606d
@ -343,6 +343,9 @@ fn visit_expr(&mut self, expr: &'a Expr) {
|
||||
self.create_def(expr.id, kw::Empty, DefKind::Closure, expr.span)
|
||||
}
|
||||
ExprKind::ConstBlock(ref constant) => {
|
||||
for attr in &expr.attrs {
|
||||
visit::walk_attribute(self, attr);
|
||||
}
|
||||
let def = self.create_def(
|
||||
constant.id,
|
||||
kw::Empty,
|
||||
|
9
tests/ui/resolve/path-attr-in-const-block.rs
Normal file
9
tests/ui/resolve/path-attr-in-const-block.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// issue#126516
|
||||
// issue#126647
|
||||
|
||||
fn main() {
|
||||
const {
|
||||
#![path = foo!()]
|
||||
//~^ ERROR: cannot find macro `foo` in this scope
|
||||
}
|
||||
}
|
8
tests/ui/resolve/path-attr-in-const-block.stderr
Normal file
8
tests/ui/resolve/path-attr-in-const-block.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: cannot find macro `foo` in this scope
|
||||
--> $DIR/path-attr-in-const-block.rs:6:19
|
||||
|
|
||||
LL | #![path = foo!()]
|
||||
| ^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
Loading…
Reference in New Issue
Block a user