Skip to content

cfg_attr in a cfg_attr does not apply correct.  #16821

Open
@wyatt-herkamp

Description

@wyatt-herkamp

rust-analyzer version: Introduced in #16789

rustc version: 1.76

code snippet to reproduce:

#[derive(serde::Deserialize)
pub struct Example {
	#[cfg_attr(feature = "serde", cfg_attr(feature = "with-defaults", serde(default)))]
	item: u8
}

The cfg stripping code only goes one deep. So if the inner attribute for cfg_attr is an cfg_attr that is passed along.

Metadata

Metadata

Assignees

Labels

C-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions