File tree Expand file tree Collapse file tree
compiler/rustc_attr_parsing/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -668,6 +668,15 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcHasIncoherentInherentImplsParse
668668 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcHasIncoherentInherentImpls ;
669669}
670670
671+ pub ( crate ) struct PanicHandlerParser ;
672+
673+ impl < S : Stage > NoArgsAttributeParser < S > for PanicHandlerParser {
674+ const PATH : & [ Symbol ] = & [ sym:: panic_handler] ;
675+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
676+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ; // Targets are checked per lang item in `rustc_passes`
677+ const CREATE : fn ( Span ) -> AttributeKind = |span| AttributeKind :: Lang ( LangItem :: PanicImpl , span) ;
678+ }
679+
671680pub ( crate ) struct RustcHiddenTypeOfOpaquesParser ;
672681
673682impl < S : Stage > NoArgsAttributeParser < S > for RustcHiddenTypeOfOpaquesParser {
Original file line number Diff line number Diff line change @@ -254,6 +254,7 @@ attribute_parsers!(
254254 Single <WithoutArgs <NoMangleParser >>,
255255 Single <WithoutArgs <NoStdParser >>,
256256 Single <WithoutArgs <NonExhaustiveParser >>,
257+ Single <WithoutArgs <PanicHandlerParser >>,
257258 Single <WithoutArgs <PanicRuntimeParser >>,
258259 Single <WithoutArgs <ParenSugarParser >>,
259260 Single <WithoutArgs <PassByValueParser >>,
You can’t perform that action at this time.
0 commit comments