@@ -96,9 +96,9 @@ allow to map machine code locations back to source code locations in order
96
96
to be useful. This functionality is also handled in this module. The
97
97
following functions allow to control source mappings:
98
98
99
- + set_source_location()
100
- + clear_source_location()
101
- + start_emitting_source_locations()
99
+ + ` set_source_location() `
100
+ + ` clear_source_location() `
101
+ + ` start_emitting_source_locations() `
102
102
103
103
` set_source_location() ` allows to set the current source location. All IR
104
104
instructions created after a call to this function will be linked to the
@@ -142,21 +142,22 @@ type identifier that tells it across compilation units which types are the
142
142
same as others. This type identifier is created by
143
143
` TypeMap::get_unique_type_id_of_type() ` using the following algorithm:
144
144
145
- (1) Primitive types have their name as ID
146
- (2) Structs, enums and traits have a multipart identifier
145
+ 1 . Primitive types have their name as ID
147
146
148
- (1) The first part is the SVH (strict version hash) of the crate they
149
- were originally defined in
147
+ 2 . Structs, enums and traits have a multipart identifier
150
148
151
- (2) The second part is the ast::NodeId of the definition in their
152
- original crate
149
+ 1 . The first part is the SVH (strict version hash) of the crate they
150
+ were originally defined in
153
151
154
- (3) The final part is a concatenation of the type IDs of their concrete
155
- type arguments if they are generic types.
152
+ 2 . The second part is the ast::NodeId of the definition in their
153
+ original crate
156
154
157
- (3) Tuple-, pointer and function types are structurally identified, which
158
- means that they are equivalent if their component types are equivalent
159
- (i.e., (i32, i32) is the same regardless in which crate it is used).
155
+ 3 . The final part is a concatenation of the type IDs of their concrete
156
+ type arguments if they are generic types.
157
+
158
+ 3 . Tuple-, pointer-, and function types are structurally identified, which
159
+ means that they are equivalent if their component types are equivalent
160
+ (i.e., ` (i32, i32) ` is the same regardless in which crate it is used).
160
161
161
162
This algorithm also provides a stable ID for types that are defined in one
162
163
crate but instantiated from metadata within another crate. We just have to
0 commit comments