mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 01:42:54 +03:00
Keep encoding attributes for closures
This commit is contained in:
@@ -862,6 +862,11 @@ fn should_encode_attrs(def_kind: DefKind) -> bool {
|
||||
| DefKind::Macro(_)
|
||||
| DefKind::Field
|
||||
| DefKind::Impl { .. } => true,
|
||||
// Tools may want to be able to detect their tool lints on
|
||||
// closures from upstream crates, too. This is used by
|
||||
// https://github.com/model-checking/kani and is not a performance
|
||||
// or maintenance issue for us.
|
||||
DefKind::Closure => true,
|
||||
DefKind::TyParam
|
||||
| DefKind::ConstParam
|
||||
| DefKind::Ctor(..)
|
||||
@@ -874,7 +879,6 @@ fn should_encode_attrs(def_kind: DefKind) -> bool {
|
||||
| DefKind::ImplTraitPlaceholder
|
||||
| DefKind::LifetimeParam
|
||||
| DefKind::GlobalAsm
|
||||
| DefKind::Closure
|
||||
| DefKind::Generator => false,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user