Skip to content

Commit 3d4d670

Browse files
authored
Rollup merge of #111381 - oli-obk:closure_attr, r=petrochenkov
Keep encoding attributes for closures see model-checking/kani#2406 (comment) for some context. We stopped encoding attributes for closures, but some tools need them
2 parents d117b41 + b7f570f commit 3d4d670

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,11 @@ fn should_encode_attrs(def_kind: DefKind) -> bool {
862862
| DefKind::Macro(_)
863863
| DefKind::Field
864864
| DefKind::Impl { .. } => true,
865+
// Tools may want to be able to detect their tool lints on
866+
// closures from upstream crates, too. This is used by
867+
// https://github.com/model-checking/kani and is not a performance
868+
// or maintenance issue for us.
869+
DefKind::Closure => true,
865870
DefKind::TyParam
866871
| DefKind::ConstParam
867872
| DefKind::Ctor(..)
@@ -874,7 +879,6 @@ fn should_encode_attrs(def_kind: DefKind) -> bool {
874879
| DefKind::ImplTraitPlaceholder
875880
| DefKind::LifetimeParam
876881
| DefKind::GlobalAsm
877-
| DefKind::Closure
878882
| DefKind::Generator => false,
879883
}
880884
}

0 commit comments

Comments
 (0)