]> git.lizzy.rs Git - rust.git/commit
Avoid more unnecessary `MetaItem`/`Attribute` conversions.
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 28 Nov 2022 00:17:45 +0000 (11:17 +1100)
committerNicholas Nethercote <n.nethercote@gmail.com>
Tue, 29 Nov 2022 01:54:45 +0000 (12:54 +1100)
commita709f87be7d66e8a91c5ee2818cac6f077caac08
tree49ff2e0daaff47dd3c7b9295ea6479859d7e89ab
parentfc2a8a0c675bf7d111846b19fd3d5d7a13915425
Avoid more unnecessary `MetaItem`/`Attribute` conversions.

In `Expander::expand` the code currently uses `mk_attr_outer` to convert
a `MetaItem` to an `Attribute`, and then follows that with
`meta_item_list` which converts back. This commit avoids the unnecessary
conversions.

There was one wrinkle: the existing conversions caused the bogus `<>` on
`Default<>` to be removed. With the conversion gone, we get a second
error message about the `<>`. This is a rare case, so I think it
probably doesn't matter much.
compiler/rustc_builtin_macros/src/derive.rs
src/test/ui/span/macro-ty-params.rs
src/test/ui/span/macro-ty-params.stderr