File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,15 @@ fn solve(
168168 } ;
169169
170170 let solution = if is_chalk_debug ( ) {
171- let logging_db = LoggingRustIrDatabase :: new ( context) ;
172171 let solve = || {
173- let solution = solver. solve_limited ( & logging_db, goal, should_continue) ;
174- log:: debug!( "chalk program:\n {}" , logging_db) ;
175- solution
172+ if is_chalk_print ( ) {
173+ let logging_db = LoggingRustIrDatabase :: new ( context) ;
174+ let solution = solver. solve_limited ( & logging_db, goal, should_continue) ;
175+ log:: debug!( "chalk program:\n {}" , logging_db) ;
176+ solution
177+ } else {
178+ solver. solve_limited ( & context, goal, should_continue)
179+ }
176180 } ;
177181
178182 // don't set the TLS for Chalk unless Chalk debugging is active, to make
@@ -191,6 +195,10 @@ fn is_chalk_debug() -> bool {
191195 std:: env:: var ( "CHALK_DEBUG" ) . is_ok ( )
192196}
193197
198+ fn is_chalk_print ( ) -> bool {
199+ std:: env:: var ( "CHALK_PRINT" ) . is_ok ( )
200+ }
201+
194202fn solution_from_chalk (
195203 db : & dyn HirDatabase ,
196204 solution : chalk_solve:: Solution < Interner > ,
You can’t perform that action at this time.
0 commit comments