File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
turbopack/crates/turbo-tasks-backend/src/backend/operation Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -180,11 +180,22 @@ pub fn make_task_dirty(
180
180
181
181
// There must be no way to invalidate immutable tasks. If there would be a way the task is not
182
182
// immutable.
183
- debug_assert ! (
184
- !task. is_immutable( ) ,
185
- "Task {} is immutable, but was made dirty. This should not happen and is a bug." ,
186
- ctx. get_task_description( task_id)
187
- ) ;
183
+ #[ cfg( debug_assertions) ]
184
+ if task. is_immutable ( ) {
185
+ #[ cfg( feature = "trace_task_dirty" ) ]
186
+ let extra_info = format ! (
187
+ " Invalidation cause: {}" ,
188
+ TaskDirtyCauseInContext :: new( & cause, ctx)
189
+ ) ;
190
+ #[ cfg( not( feature = "trace_task_dirty" ) ) ]
191
+ let extra_info = "" ;
192
+
193
+ panic ! (
194
+ "Task {} is immutable, but was made dirty. This should not happen and is a \
195
+ bug.{extra_info}",
196
+ ctx. get_task_description( task_id) ,
197
+ ) ;
198
+ }
188
199
189
200
make_task_dirty_internal (
190
201
& mut task,
You can’t perform that action at this time.
0 commit comments