Keep encoding attributes for closures
This commit is contained in:
parent
33a01e2e93
commit
b7f570fff3
1 changed files with 5 additions and 1 deletions
|
@ -862,6 +862,11 @@ fn should_encode_attrs(def_kind: DefKind) -> bool {
|
||||||
| DefKind::Macro(_)
|
| DefKind::Macro(_)
|
||||||
| DefKind::Field
|
| DefKind::Field
|
||||||
| DefKind::Impl { .. } => true,
|
| 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::TyParam
|
||||||
| DefKind::ConstParam
|
| DefKind::ConstParam
|
||||||
| DefKind::Ctor(..)
|
| DefKind::Ctor(..)
|
||||||
|
@ -874,7 +879,6 @@ fn should_encode_attrs(def_kind: DefKind) -> bool {
|
||||||
| DefKind::ImplTraitPlaceholder
|
| DefKind::ImplTraitPlaceholder
|
||||||
| DefKind::LifetimeParam
|
| DefKind::LifetimeParam
|
||||||
| DefKind::GlobalAsm
|
| DefKind::GlobalAsm
|
||||||
| DefKind::Closure
|
|
||||||
| DefKind::Generator => false,
|
| DefKind::Generator => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue