@@ -199,13 +199,12 @@ impl Linter for SolidityLinter {
199199 sess
200200 }
201201
202- /// Run AST-based lints
203- fn early_lint < ' sess > ( & self , input : & [ PathBuf ] , mut pcx : ParsingContext < ' sess > ) {
202+ /// Run AST-based lints.
203+ ///
204+ /// Note: the `ParsingContext` should already have the sources loaded.
205+ fn early_lint < ' sess > ( & self , input : & [ PathBuf ] , pcx : ParsingContext < ' sess > ) {
204206 let sess = pcx. sess ;
205207 _ = sess. enter_parallel ( || -> Result < ( ) , diagnostics:: ErrorGuaranteed > {
206- // Load all files into the parsing ctx
207- pcx. load_files ( input) ?;
208-
209208 // Parse the sources
210209 let ast_arena = solar_sema:: thread_local:: ThreadLocal :: new ( ) ;
211210 let ast_result = pcx. parse ( & ast_arena) ;
@@ -223,13 +222,12 @@ impl Linter for SolidityLinter {
223222 } ) ;
224223 }
225224
226- /// Run HIR-based lints
227- fn late_lint < ' sess > ( & self , input : & [ PathBuf ] , mut pcx : ParsingContext < ' sess > ) {
225+ /// Run HIR-based lints.
226+ ///
227+ /// Note: the `ParsingContext` should already have the sources loaded.
228+ fn late_lint < ' sess > ( & self , input : & [ PathBuf ] , pcx : ParsingContext < ' sess > ) {
228229 let sess = pcx. sess ;
229230 _ = sess. enter_parallel ( || -> Result < ( ) , diagnostics:: ErrorGuaranteed > {
230- // Load all files into the parsing ctx
231- pcx. load_files ( input) ?;
232-
233231 // Parse and lower to HIR
234232 let hir_arena = solar_sema:: thread_local:: ThreadLocal :: new ( ) ;
235233 let hir_result = pcx. parse_and_lower ( & hir_arena) ;
0 commit comments