@@ -197,7 +197,6 @@ pub struct ProgramBuilder<P> {
197197 scripts : Vec < String > ,
198198 pcodes : Vec < String > ,
199199 classes : Vec < String > ,
200- optimizations : OptimizationOptions ,
201200 compile_options : CompileOptions ,
202201}
203202
@@ -227,7 +226,6 @@ impl<P: SourceProvider> ProgramBuilder<P> {
227226 scripts : vec ! [ ] ,
228227 pcodes : vec ! [ ] ,
229228 classes : vec ! [ ] ,
230- optimizations : OptimizationOptions :: full ( ) ,
231229 compile_options : CompileOptions :: default ( ) ,
232230 }
233231 }
@@ -252,9 +250,8 @@ impl<P: SourceProvider> ProgramBuilder<P> {
252250 path : & str ,
253251 type_name : & str ,
254252 is_script : bool ,
255- optimizations : & OptimizationOptions ,
256253 known_script_paths : & IndexSet < String > ,
257- _compile_options : & CompileOptions ,
254+ compile_options : & CompileOptions ,
258255 ) -> Option < hir:: Document > {
259256 let source = match provider. load ( path) {
260257 Ok ( source) => source,
@@ -281,7 +278,7 @@ impl<P: SourceProvider> ProgramBuilder<P> {
281278 pending_classes. push ( name) ;
282279 }
283280 }
284- if optimizations. fold_constants {
281+ if compile_options . optimizations . fold_constants {
285282 while fold_constants ( & mut hir) {
286283 // Keep going until nothing changed
287284 }
@@ -322,7 +319,6 @@ impl<P: SourceProvider> ProgramBuilder<P> {
322319 & path,
323320 "" ,
324321 true ,
325- & self . optimizations ,
326322 & known_script_paths,
327323 & self . compile_options ,
328324 ) && let hir:: Document :: Script { statements, scope } = document
@@ -348,7 +344,6 @@ impl<P: SourceProvider> ProgramBuilder<P> {
348344 & filename,
349345 & type_name,
350346 false ,
351- & self . optimizations ,
352347 & known_script_paths,
353348 & self . compile_options ,
354349 ) {
0 commit comments