fn finalize(&self, cx: &CodegenCx<'ll, 'tcx>) -> MetadataCreationResult<'ll> {
        match *self {
            FinalMetadata(metadata) => MetadataCreationResult::new(metadata, false),
            UnfinishedMetadata {
                unfinished_type,
                unique_type_id,
                metadata_stub,
                ref member_description_factory,
            } => {
                // Make sure that we have a forward declaration of the type in
                // the TypeMap so that recursive references are possible. This
                // will always be the case if the RecursiveTypeDescription has
                // been properly created through the
                // create_and_register_recursive_type_forward_declaration()
                // function.
                {
                    let type_map = debug_context(cx).type_map.borrow();
                    if type_map.find_metadata_for_unique_id(unique_type_id).is_none() ||
                       type_map.find_metadata_for_type(unfinished_type).is_none() {
                        bug!("Forward declaration of potentially recursive type \
                              '{:?}' was not found in TypeMap!",
                             unfinished_type);
                    }
                }

                // ... then create the member descriptions ...
                let member_descriptions =
                    member_description_factory.create_member_descriptions(cx);

                // ... and attach them to the stub to complete it.
                set_members_of_composite_type(cx,
                                              metadata_stub,
                                              member_descriptions);
                return MetadataCreationResult::new(metadata_stub, true);
            }
        }
    }
// Finishes up the description of the type in question (mostly by providing
// descriptions of the fields of the given type) and returns the final type
// metadata.
Finishes up the description of the type in question (mostly by providing
descriptions of the fields of the given type) and returns the final type
metadata.
Finishes up the description of the type in question ( mostly by providing descriptions of the fields of the given type ) and returns the final type metadata .
fn finalize(&self, cx: &CodegenCx<'ll, 'tcx>) -> MetadataCreationResult<'ll> {
        match *self {
            FinalMetadata(metadata) => MetadataCreationResult::new(metadata, false),
            UnfinishedMetadata {
                unfinished_type,
                unique_type_id,
                metadata_stub,
                ref member_description_factory,
            } => {
                // Make sure that we have a forward declaration of the type in
                // the TypeMap so that recursive references are possible. This
                // will always be the case if the RecursiveTypeDescription has
                // been properly created through the
                // create_and_register_recursive_type_forward_declaration()
                // function.
                {
                    let type_map = debug_context(cx).type_map.borrow();
                    if type_map.find_metadata_for_unique_id(unique_type_id).is_none() ||
                       type_map.find_metadata_for_type(unfinished_type).is_none() {
                        bug!("Forward declaration of potentially recursive type \
                              '{:?}' was not found in TypeMap!",
                             unfinished_type);
                    }
                }
                // ... then create the member descriptions ...
                let member_descriptions =
                    member_description_factory.create_member_descriptions(cx);
                // ... and attach them to the stub to complete it.
                set_members_of_composite_type(cx,
                                              metadata_stub,
                                              member_descriptions);
                return MetadataCreationResult::new(metadata_stub, true);
            }
        }
    }
fn finalize ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> MetadataCreationResult < ' ll > { match * self { FinalMetadata ( metadata ) => MetadataCreationResult :: new ( metadata , false ) , UnfinishedMetadata { unfinished_type , unique_type_id , metadata_stub , ref member_description_factory , } => { // Make sure that we have a forward declaration of the type in // the TypeMap so that recursive references are possible. This // will always be the case if the RecursiveTypeDescription has // been properly created through the // create_and_register_recursive_type_forward_declaration() // function. { let type_map = debug_context ( cx ) . type_map . borrow ( ) ; if type_map . find_metadata_for_unique_id ( unique_type_id ) . is_none ( ) || type_map . find_metadata_for_type ( unfinished_type ) . is_none ( ) { bug ! ( " \
 " unfinished_type ) ; } } // ... then create the member descriptions ... let member_descriptions = member_description_factory . create_member_descriptions ( cx ) ; // ... and attach them to the stub to complete it. set_members_of_composite_type ( cx , metadata_stub , member_descriptions ) ; return MetadataCreationResult :: new ( metadata_stub , true ) ; } } }
Finishes up the description of the type in question (mostly by providing
descriptions of the fields of the given type) and returns the final type
metadata.
Finishes up the description of the type in question ( mostly by providing descriptions of the fields of the given type ) and returns the final type metadata .
&self
cx
&CodegenCx<'ll, 'tcx>
&self
cx
&CodegenCx<'ll, 'tcx>