( messages: &mut Messages<'a>, lang_items: &LangItems, type_store: &mut TypeStore<'a>, function_store: &FunctionStore<'a>, generator: &mut G, shape: ReadGuard<FunctionShape<'a>>, function_id: F
| 113 | } |
| 114 | |
| 115 | pub fn generate_function<'a, G: Generator>( |
| 116 | messages: &mut Messages<'a>, |
| 117 | lang_items: &LangItems, |
| 118 | type_store: &mut TypeStore<'a>, |
| 119 | function_store: &FunctionStore<'a>, |
| 120 | generator: &mut G, |
| 121 | shape: ReadGuard<FunctionShape<'a>>, |
| 122 | function_id: FunctionId, |
| 123 | ) { |
| 124 | if shape.trait_method_marker.is_some() { |
| 125 | return; |
| 126 | } |
| 127 | |
| 128 | let specialization = &shape.specializations[function_id.specialization_index]; |
| 129 | |
| 130 | for &type_argument in &specialization.type_arguments.ids { |
| 131 | let entry = type_store.type_entries.get(type_argument.item); |
| 132 | if entry.generic_poisoned { |
| 133 | return; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | generator.start_function(type_store, specialization, function_id); |
| 138 | |
| 139 | let module_path = shape.module_path; |
| 140 | let type_arguments = specialization.type_arguments.clone(); |
| 141 | let Some(block) = shape.block.clone() else { |
| 142 | unreachable!("{:?}", *shape); |
| 143 | }; |
| 144 | |
| 145 | drop(shape); |
| 146 | |
| 147 | let mut context = Context { |
| 148 | messages, |
| 149 | lang_items, |
| 150 | type_store, |
| 151 | function_store, |
| 152 | module_path, |
| 153 | function_type_arguments: &type_arguments, |
| 154 | function_id, |
| 155 | defer_stack: Vec::new(), |
| 156 | loop_stack: Vec::new(), |
| 157 | yield_target_stack: Vec::new(), |
| 158 | }; |
| 159 | |
| 160 | generate_block(&mut context, generator, block.as_ref()); |
| 161 | } |
| 162 | |
| 163 | pub fn generate_block<'a, 'b, G: Generator>( |
| 164 | context: &mut Context<'a, 'b>, |
no test coverage detected