Reject macro calls inside of #![crate_name]
This commit is contained in:
parent
46d53a68aa
commit
9b6fd35738
21 changed files with 196 additions and 115 deletions
|
@ -433,11 +433,11 @@ pub(crate) fn check_attr_crate_type(
|
|||
}
|
||||
} else {
|
||||
// This is here mainly to check for using a macro, such as
|
||||
// #![crate_type = foo!()]. That is not supported since the
|
||||
// `#![crate_type = foo!()]`. That is not supported since the
|
||||
// crate type needs to be known very early in compilation long
|
||||
// before expansion. Otherwise, validation would normally be
|
||||
// caught in AstValidator (via `check_builtin_attribute`), but
|
||||
// by the time that runs the macro is expanded, and it doesn't
|
||||
// caught during semantic analysis via `TyCtxt::check_mod_attrs`,
|
||||
// but by the time that runs the macro is expanded, and it doesn't
|
||||
// give an error.
|
||||
validate_attr::emit_fatal_malformed_builtin_attribute(
|
||||
&sess.psess,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue