[−][src]Function rustc_hir::lang_items::extract
pub fn extract<'a, F>(
check_name: F,
attrs: &'a [Attribute]
) -> Option<(Symbol, Span)> where
F: Fn(&'a Attribute, Symbol) -> bool,
Extracts the first lang = "$name" out of a list of attributes.
The attributes #[panic_handler] and #[alloc_error_handler]
are also extracted out when found.
About the check_name argument: passing in a Session would be simpler,
because then we could call Session::check_name directly. But we want to
avoid the need for librustc_hir to depend on librustc_session, so we
use a closure instead.