pub fn check_stability(self, def_id: DefId, id: Option<NodeId>, span: Span) {
        match self.eval_stability(def_id, id, span) {
            EvalResult::Allow => {}
            EvalResult::Deny { feature, reason, issue } => {
                let msg = match reason {
                    Some(r) => format!("use of unstable library feature '{}': {}", feature, r),
                    None => format!("use of unstable library feature '{}'", &feature)
                };

                let msp: MultiSpan = span.into();
                let cm = &self.sess.parse_sess.source_map();
                let span_key = msp.primary_span().and_then(|sp: Span|
                    if !sp.is_dummy() {
                        let file = cm.lookup_char_pos(sp.lo()).file;
                        if file.name.is_macros() {
                            None
                        } else {
                            Some(span)
                        }
                    } else {
                        None
                    }
                );

                let error_id = (DiagnosticMessageId::StabilityId(issue), span_key, msg.clone());
                let fresh = self.sess.one_time_diagnostics.borrow_mut().insert(error_id);
                if fresh {
                    emit_feature_err(&self.sess.parse_sess, &feature.as_str(), span,
                                     GateIssue::Library(Some(issue)), &msg);
                }
            }
            EvalResult::Unmarked => {
                span_bug!(span, "encountered unmarked API: {:?}", def_id);
            }
        }
    }
/// Checks if an item is stable or error out.
///
/// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not
/// exist, emits an error.
///
/// Additionally, this function will also check if the item is deprecated. If so, and `id` is
/// not `None`, a deprecated lint attached to `id` will be emitted.
Checks if an item is stable or error out.
If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not
exist, emits an error.

Additionally, this function will also check if the item is deprecated.
Checks if an item is stable or error out . If the item defined by ` def_id ` is unstable and the corresponding ` #! [ feature ] ` does not exist emits an error . Additionally this function will also check if the item is deprecated .
pub fn check_stability(self, def_id: DefId, id: Option<NodeId>, span: Span) {
        match self.eval_stability(def_id, id, span) {
            EvalResult::Allow => {}
            EvalResult::Deny { feature, reason, issue } => {
                let msg = match reason {
                    Some(r) => format!("use of unstable library feature '{}': {}", feature, r),
                    None => format!("use of unstable library feature '{}'", &feature)
                };
                let msp: MultiSpan = span.into();
                let cm = &self.sess.parse_sess.source_map();
                let span_key = msp.primary_span().and_then(|sp: Span|
                    if !sp.is_dummy() {
                        let file = cm.lookup_char_pos(sp.lo()).file;
                        if file.name.is_macros() {
                            None
                        } else {
                            Some(span)
                        }
                    } else {
                        None
                    }
                );
                let error_id = (DiagnosticMessageId::StabilityId(issue), span_key, msg.clone());
                let fresh = self.sess.one_time_diagnostics.borrow_mut().insert(error_id);
                if fresh {
                    emit_feature_err(&self.sess.parse_sess, &feature.as_str(), span,
                                     GateIssue::Library(Some(issue)), &msg);
                }
            }
            EvalResult::Unmarked => {
                span_bug!(span, "encountered unmarked API: {:?}", def_id);
            }
        }
    }
pub fn check_stability ( self , def_id : DefId , id : Option < NodeId > , span : Span ) { match self . eval_stability ( def_id , id , span ) { EvalResult :: Allow => { } EvalResult :: Deny { feature , reason , issue } => { let msg = match reason { Some ( r ) => format ! ( " " feature r ) , None => format ! ( " " feature ) } ; let msp : MultiSpan = span . into ( ) ; let cm = & self . sess . parse_sess . source_map ( ) ; let span_key = msp . primary_span ( ) . and_then ( | sp : Span | if ! sp . is_dummy ( ) { let file = cm . lookup_char_pos ( sp . lo ( ) ) . file ; if file . name . is_macros ( ) { None } else { Some ( span ) } } else { None } ) ; let error_id = ( DiagnosticMessageId :: StabilityId ( issue ) , span_key , msg . clone ( ) ) ; let fresh = self . sess . one_time_diagnostics . borrow_mut ( ) . insert ( error_id ) ; if fresh { emit_feature_err ( & self . sess . parse_sess , & feature . as_str ( ) , span , GateIssue :: Library ( Some ( issue ) ) , & msg ) ; } } EvalResult :: Unmarked => { span_bug ! ( span " " def_id ) ; } } }
Checks if an item is stable or error out.
Checks if an item is stable or error out .
self
def_id
DefId
id
Option<NodeId>
span
Span
self
def_id
DefId
id
Option<NodeId>
span
Span