mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
expand: Do not allocate Lrc
for allow_internal_unstable
list unless necessary
This commit is contained in:
parent
a15f484b91
commit
ddd20ef8cb
@ -757,7 +757,7 @@ impl SyntaxExtension {
|
|||||||
attrs: &[ast::Attribute],
|
attrs: &[ast::Attribute],
|
||||||
) -> SyntaxExtension {
|
) -> SyntaxExtension {
|
||||||
let allow_internal_unstable =
|
let allow_internal_unstable =
|
||||||
Some(attr::allow_internal_unstable(sess, &attrs).collect::<Vec<Symbol>>().into());
|
attr::allow_internal_unstable(sess, &attrs).collect::<Vec<Symbol>>();
|
||||||
|
|
||||||
let mut local_inner_macros = false;
|
let mut local_inner_macros = false;
|
||||||
if let Some(macro_export) = sess.find_by_name(attrs, sym::macro_export) {
|
if let Some(macro_export) = sess.find_by_name(attrs, sym::macro_export) {
|
||||||
@ -779,7 +779,8 @@ impl SyntaxExtension {
|
|||||||
SyntaxExtension {
|
SyntaxExtension {
|
||||||
kind,
|
kind,
|
||||||
span,
|
span,
|
||||||
allow_internal_unstable,
|
allow_internal_unstable: (!allow_internal_unstable.is_empty())
|
||||||
|
.then(|| allow_internal_unstable.into()),
|
||||||
allow_internal_unsafe: sess.contains_name(attrs, sym::allow_internal_unsafe),
|
allow_internal_unsafe: sess.contains_name(attrs, sym::allow_internal_unsafe),
|
||||||
local_inner_macros,
|
local_inner_macros,
|
||||||
stability,
|
stability,
|
||||||
|
Loading…
Reference in New Issue
Block a user