fn check_import(&mut self, id: ast::NodeId, span: Span) {
        if !self.used_imports.contains(&(id, TypeNS)) &&
           !self.used_imports.contains(&(id, ValueNS)) {
            if self.maybe_unused_trait_imports.contains(&id) {
                // Check later.
                return;
            }
            self.session.add_lint(lint::builtin::UNUSED_IMPORTS,
                                  id,
                                  span,
                                  "unused import".to_string());
        } else {
            // This trait import is definitely used, in a way other than
            // method resolution.
            self.maybe_unused_trait_imports.remove(&id);
        }
    }
// We have information about whether `use` (import) directives are actually
// used now. If an import is not used at all, we signal a lint error.
We have information about whether `use` (import) directives are actually
used now. If an import is not used at all, we signal a lint error.
We have information about whether ` use ` ( import ) directives are actually used now . If an import is not used at all we signal a lint error .
fn check_import(&mut self, id: ast::NodeId, span: Span) {
        if !self.used_imports.contains(&(id, TypeNS)) &&
           !self.used_imports.contains(&(id, ValueNS)) {
            if self.maybe_unused_trait_imports.contains(&id) {
                // Check later.
                return;
            }
            self.session.add_lint(lint::builtin::UNUSED_IMPORTS,
                                  id,
                                  span,
                                  "unused import".to_string());
        } else {
            // This trait import is definitely used, in a way other than
            // method resolution.
            self.maybe_unused_trait_imports.remove(&id);
        }
    }
fn check_import ( & mut self , id : ast :: NodeId , span : Span ) { if ! self . used_imports . contains ( & ( id , TypeNS ) ) && ! self . used_imports . contains ( & ( id , ValueNS ) ) { if self . maybe_unused_trait_imports . contains ( & id ) { // Check later. return ; } self . session . add_lint ( lint :: builtin :: UNUSED_IMPORTS , id , span , " " . to_string ( ) ) ; } else { // This trait import is definitely used, in a way other than // method resolution. self . maybe_unused_trait_imports . remove ( & id ) ; } }
We have information about whether `use` (import) directives are actually
used now.
We have information about whether ` use ` ( import ) directives are actually used now .
&mut self
id
ast::NodeId
span
Span
&mut self
id
ast::NodeId
span
Span