@@ -103,58 +103,90 @@ pub fn generate_asts(
103103 . packages
104104 . get ( & module. package_name )
105105 . expect ( "Package not found" ) ;
106- match ( ast_path, module. source_type . to_owned ( ) ) {
107- // supress warnings in non-pinned deps
108- ( Ok ( ( _path, Some ( err) ) ) , SourceType :: SourceFile ( ref mut source_file) )
109- if package. is_pinned_dep =>
110- {
111- source_file. implementation . parse_state = ParseState :: Warning ;
112- source_file. implementation . parse_dirty = true ;
113- if let Some ( interface) = source_file. interface . as_mut ( ) {
114- interface. parse_dirty = false ;
106+ if is_dirty {
107+ module. compile_dirty = true
108+ }
109+ match ast_path {
110+ Ok ( ( _path, err) ) => {
111+ match module. source_type {
112+ SourceType :: SourceFile ( ref mut source_file) => {
113+ source_file. implementation . parse_dirty = false ;
114+ source_file
115+ . interface
116+ . as_mut ( )
117+ . map ( |interface| interface. parse_dirty = false ) ;
118+ }
119+ _ => ( ) ,
115120 }
116- logs:: append ( package, & err) ;
117- stderr. push_str ( & err) ;
118- }
119- ( Ok ( ( _path, None ) ) , SourceType :: SourceFile ( ref mut source_file) ) => {
120- source_file. implementation . parse_state = ParseState :: Success ;
121- source_file. implementation . parse_dirty = false ;
122- if let Some ( interface) = source_file. interface . as_mut ( ) {
123- interface. parse_dirty = false ;
121+ // supress warnings in non-pinned deps
122+ match module. source_type {
123+ SourceType :: SourceFile ( ref mut source_file) => {
124+ source_file. implementation . parse_state = ParseState :: Success ;
125+ }
126+ _ => ( ) ,
127+ }
128+
129+ if package. is_pinned_dep {
130+ if let Some ( err) = err {
131+ match module. source_type {
132+ SourceType :: SourceFile ( ref mut source_file) => {
133+ source_file. implementation . parse_state = ParseState :: Warning ;
134+ source_file. implementation . parse_dirty = true ;
135+ }
136+ _ => ( ) ,
137+ }
138+ logs:: append ( package, & err) ;
139+ stderr. push_str ( & err) ;
140+ }
124141 }
125142 }
126- ( Err ( err) , SourceType :: SourceFile ( ref mut source_file) ) => {
127- source_file. implementation . parse_state = ParseState :: ParseError ;
128- source_file. implementation . parse_dirty = true ;
143+ Err ( err) => {
144+ match module. source_type {
145+ SourceType :: SourceFile ( ref mut source_file) => {
146+ source_file. implementation . parse_state = ParseState :: ParseError ;
147+ source_file. implementation . parse_dirty = true ;
148+ }
149+ _ => ( ) ,
150+ }
129151 logs:: append ( package, & err) ;
130152 has_failure = true ;
131153 stderr. push_str ( & err) ;
132154 }
133- _ => ( ) ,
134155 } ;
135-
136- match ( iast_path, module. source_type . to_owned ( ) ) {
137- ( Ok ( Some ( ( _path, Some ( err) ) ) ) , SourceType :: SourceFile ( ref mut source_file) )
138- if package. is_pinned_dep =>
139- {
156+ match iast_path {
157+ Ok ( Some ( ( _path, err) ) ) => {
140158 // supress warnings in non-pinned deps
141- if let Some ( interface) = source_file. interface . as_mut ( ) {
142- interface. parse_state = ParseState :: Warning ;
143- interface. parse_dirty = true ;
159+ if package. is_pinned_dep {
160+ if let Some ( err) = err {
161+ match module. source_type {
162+ SourceType :: SourceFile ( ref mut source_file) => {
163+ source_file. interface . as_mut ( ) . map ( |interface| {
164+ interface. parse_state = ParseState :: ParseError ;
165+ interface. parse_dirty = true ;
166+ } ) ;
167+ }
168+ _ => ( ) ,
169+ }
170+ logs:: append ( package, & err) ;
171+ stderr. push_str ( & err) ;
172+ }
144173 }
145- logs:: append ( package, & err) ;
146- stderr. push_str ( & err) ;
147174 }
148- ( Err ( err) , SourceType :: SourceFile ( ref mut source_file) ) => {
149- if let Some ( interface) = source_file. interface . as_mut ( ) {
150- interface. parse_state = ParseState :: ParseError ;
151- interface. parse_dirty = true ;
175+ Ok ( None ) => ( ) ,
176+ Err ( err) => {
177+ match module. source_type {
178+ SourceType :: SourceFile ( ref mut source_file) => {
179+ source_file. interface . as_mut ( ) . map ( |interface| {
180+ interface. parse_state = ParseState :: ParseError ;
181+ interface. parse_dirty = true ;
182+ } ) ;
183+ }
184+ _ => ( ) ,
152185 }
153186 logs:: append ( package, & err) ;
154187 has_failure = true ;
155188 stderr. push_str ( & err) ;
156189 }
157- _ => ( ) ,
158190 } ;
159191 }
160192 } ) ;
0 commit comments