pub fn check_unused_features(sess: &Session,
                             used_lib_features: &FnvHashSet<InternedString>) {
    let ref lib_features = sess.features.borrow().lib_features;
    let mut active_lib_features: FnvHashMap<InternedString, Span>
        = lib_features.clone().into_iter().collect();

    for used_feature in used_lib_features.iter() {
        active_lib_features.remove(used_feature);
    }

    for (_, &span) in active_lib_features.iter() {
        sess.add_lint(lint::builtin::UNUSED_FEATURES,
                      ast::CRATE_NODE_ID,
                      span,
                      "unused or unknown feature".to_string());
    }
}
/// Given the list of enabled features that were not language features (i.e. that
/// were expected to be library features), and the list of features used from
/// libraries, identify activated features that don't exist and error about them.
Given the list of enabled features that were not language features , and the list of features used from
libraries, identify activated features that don't exist and error about them.
Given the list of enabled features that were not language features and the list of features used from libraries identify activated features that don ' t exist and error about them .
pub fn check_unused_features(sess: &Session,
                             used_lib_features: &FnvHashSet<InternedString>) {
    let ref lib_features = sess.features.borrow().lib_features;
    let mut active_lib_features: FnvHashMap<InternedString, Span>
        = lib_features.clone().into_iter().collect();
    for used_feature in used_lib_features.iter() {
        active_lib_features.remove(used_feature);
    }
    for (_, &span) in active_lib_features.iter() {
        sess.add_lint(lint::builtin::UNUSED_FEATURES,
                      ast::CRATE_NODE_ID,
                      span,
                      "unused or unknown feature".to_string());
    }
}
pub fn check_unused_features ( sess : & Session , used_lib_features : & FnvHashSet < InternedString > ) { let ref lib_features = sess . features . borrow ( ) . lib_features ; let mut active_lib_features : FnvHashMap < InternedString , Span > = lib_features . clone ( ) . into_iter ( ) . collect ( ) ; for used_feature in used_lib_features . iter ( ) { active_lib_features . remove ( used_feature ) ; } for ( _ , & span ) in active_lib_features . iter ( ) { sess . add_lint ( lint :: builtin :: UNUSED_FEATURES , ast :: CRATE_NODE_ID , span , " " . to_string ( ) ) ; } }
Given the list of enabled features that were not language features (i.e.
Given the list of enabled features that were not language features ( i . e .
sess
&Session
used_lib_features
&FnvHashSet<InternedString>
sess
&Session
used_lib_features
&FnvHashSet<InternedString>